|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.matthias_burbach.flux4eclipse.popup.actions.GenerateAction
Collects Flux preferences and properties, validates them and calls the Flux generator if validation is successfull.
Displays error messages if validation or generation fails, shows a success message otherwise.
Field Summary | |
private static java.lang.String |
MESSAGE_TITLE
The title of message dialogs displayed. |
private static java.lang.String |
MODULE_VARIABLE
The module variable that can be used in preference values. |
private org.eclipse.ui.IWorkbenchPart |
part
|
private org.eclipse.jface.viewers.IStructuredSelection |
selection
|
Constructor Summary | |
GenerateAction()
|
Method Summary | |
private void |
displayErrorMessage(java.lang.String message)
|
private void |
displayFatalMessage(java.lang.Exception e)
|
private void |
displayInfoMessage(java.lang.String message)
|
private void |
displayModelCheckerMessage(ModelCheckerException mce)
Uses an extra window to display the potentially long model checker problem report. |
private void |
generate(org.eclipse.core.resources.IFile selectedFile)
Collects Flux preferences and properties, validates them and calls the Flux generator if validation is successfull. |
private java.util.Properties |
getGeneratorProperties(org.eclipse.core.resources.IFile selectedFile)
Collects Flux preferences and properties and validates them. |
private java.lang.String |
getMessage(java.lang.String messageSoFar,
java.lang.String settingName,
java.lang.String settingValue)
Helps to assemble an error message when validation of preferences and properties (settings) fails. |
private java.lang.String |
getModuleFromConfigFile(java.lang.String configFile,
java.lang.String rootModule)
Extracts the module part from the struts-config-%MODULE%.xml file name. |
private java.lang.String |
hasValidSettings(java.lang.String dispatcherAction,
java.lang.String modeDispatcherAction,
java.lang.String relayAction,
java.lang.String enterModuleAction,
java.lang.String finalStateAction,
java.lang.String physicalPagePrefix,
java.lang.String physicalPageSuffix,
java.lang.String defaultFormName,
java.lang.String defaultPackage,
java.lang.String modelFile,
java.lang.String configFile)
Validates all the parameters passed in one by one. |
private boolean |
isValidBeanName(java.lang.String name)
|
private boolean |
isValidConfigFile(java.lang.String configFile)
|
private boolean |
isValidDefaultFormName(java.lang.String defaultFormName)
|
private boolean |
isValidDefaultPackage(java.lang.String defaultPackage)
|
private boolean |
isValidDispatcherAction(java.lang.String dispatcherAction)
|
private boolean |
isValidEnterModuleAction(java.lang.String enterModuleAction)
|
private boolean |
isValidFinalStateAction(java.lang.String finalStateAction)
|
private boolean |
isValidJavaClassName(java.lang.String name)
|
private boolean |
isValidJavaPackage(java.lang.String name)
|
private boolean |
isValidModeDispatcherAction(java.lang.String modeDispatcherAction)
|
private boolean |
isValidModelFile(java.lang.String modelFile)
|
private boolean |
isValidPhysicalPagePrefix(java.lang.String physicalPagePrefix)
|
private boolean |
isValidPhysicalPageSuffix(java.lang.String physicalPageSuffix)
|
private boolean |
isValidRelayAction(java.lang.String relayAction)
|
void |
run(org.eclipse.jface.action.IAction action)
|
void |
selectionChanged(org.eclipse.jface.action.IAction action,
org.eclipse.jface.viewers.ISelection selection)
|
void |
setActivePart(org.eclipse.jface.action.IAction action,
org.eclipse.ui.IWorkbenchPart targetPart)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String MESSAGE_TITLE
private static final java.lang.String MODULE_VARIABLE
private org.eclipse.ui.IWorkbenchPart part
private org.eclipse.jface.viewers.IStructuredSelection selection
Constructor Detail |
public GenerateAction()
Method Detail |
public void setActivePart(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart)
setActivePart
in interface org.eclipse.ui.IObjectActionDelegate
IObjectActionDelegate.setActivePart(IAction, IWorkbenchPart)
public void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
selectionChanged
in interface org.eclipse.ui.IActionDelegate
IActionDelegate#selectionChanged(IAction, ISelection)
public void run(org.eclipse.jface.action.IAction action)
run
in interface org.eclipse.ui.IActionDelegate
IActionDelegate#run(IAction)
private void generate(org.eclipse.core.resources.IFile selectedFile)
selectedFile
- the struts-config-%MODULE%.xml file the user selected
to perform the generation forprivate java.util.Properties getGeneratorProperties(org.eclipse.core.resources.IFile selectedFile)
selectedFile
- the struts-config-%MODULE%.xml file the user selected
to perform the generation for
null
if validation was not successfullprivate java.lang.String hasValidSettings(java.lang.String dispatcherAction, java.lang.String modeDispatcherAction, java.lang.String relayAction, java.lang.String enterModuleAction, java.lang.String finalStateAction, java.lang.String physicalPagePrefix, java.lang.String physicalPageSuffix, java.lang.String defaultFormName, java.lang.String defaultPackage, java.lang.String modelFile, java.lang.String configFile)
dispatcherAction
- modeDispatcherAction
- relayAction
- enterModuleAction
- physicalPagePrefix
- physicalPageSuffix
- defaultFormName
- defaultPackage
- modelFile
- configFile
-
null
if validation
was successfullprivate java.lang.String getMessage(java.lang.String messageSoFar, java.lang.String settingName, java.lang.String settingValue)
messageSoFar
- the message having been assembled so farsettingName
- the setting that has a problemsettingValue
- the erroneous value of the setting
messageSoFar
plus the new info about
the erroneous settingprivate boolean isValidDispatcherAction(java.lang.String dispatcherAction)
private boolean isValidModeDispatcherAction(java.lang.String modeDispatcherAction)
private boolean isValidRelayAction(java.lang.String relayAction)
private boolean isValidEnterModuleAction(java.lang.String enterModuleAction)
private boolean isValidFinalStateAction(java.lang.String finalStateAction)
private boolean isValidPhysicalPagePrefix(java.lang.String physicalPagePrefix)
private boolean isValidPhysicalPageSuffix(java.lang.String physicalPageSuffix)
private boolean isValidDefaultFormName(java.lang.String defaultFormName)
private boolean isValidDefaultPackage(java.lang.String defaultPackage)
private boolean isValidModelFile(java.lang.String modelFile)
private boolean isValidConfigFile(java.lang.String configFile)
private boolean isValidJavaClassName(java.lang.String name)
private boolean isValidJavaPackage(java.lang.String name)
private boolean isValidBeanName(java.lang.String name)
private java.lang.String getModuleFromConfigFile(java.lang.String configFile, java.lang.String rootModule)
configFile
- the struts-config file namerootModule
- the name returned if configFile
is the
the root file 'struts-config.xml'
private void displayInfoMessage(java.lang.String message)
private void displayErrorMessage(java.lang.String message)
private void displayFatalMessage(java.lang.Exception e)
private void displayModelCheckerMessage(ModelCheckerException mce)
mce
- the exception holding the problem report facts
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |