Package com.iizigo.editor
Class CreateResourcesFromProperties
java.lang.Object
org.eclipse.core.commands.operations.AbstractOperation
com.iizigo.editor.CreateResourcesFromProperties
- All Implemented Interfaces:
- IUndoableOperation
Class used to create resources from properties, with undo support.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- static String- createFile- (Shell shell, String label, IContainer folder, PropCnr cnr, String fileName, boolean doOverwrite) Creates a resource file for a property with undo support.- static String- createFile- (Shell shell, String label, IContainer folder, PropCnr cnr, String fileName, boolean doOverwrite, boolean showErrorDialog) Creates a resource file for a property with undo support.- static String- createResources- (Shell shell, String label, DesignerProp parent, GProp<?>[] props, String[] names) Creates the resources for the list of properties in the specified property.- static String- createResources- (Shell shell, String label, DesignerProp parent, GProp<?>[] props, String[] names, boolean showErrorDialog) Creates the resources for the list of properties in the specified property.- execute- (IProgressMonitor monitor, IAdaptable info) Execute the operation.- redo- (IProgressMonitor monitor, IAdaptable info) Redo the operation.- undo- (IProgressMonitor monitor, IAdaptable info) Undo the operation.- Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation- addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
- Method Details- executeExecute the operation. This method should only be called the first time that an operation is executed.- Specified by:
- executein interface- IUndoableOperation
- Specified by:
- executein class- AbstractOperation
- Parameters:
- monitor- The progress monitor (or- null) to use for reporting progress to the user.
- info- The IAdaptable (or- null) provided by the caller in order to supply UI information for prompting the user if necessary. When this parameter is not- null, it should minimally contain an adapter for the org.eclipse.swt.widgets.Shell.class.
- Returns:
- the IStatus of the execution. The status severity should be set to OKif the operation was successful, andERRORif it was not. Any other status is assumed to represent an incompletion of the execution.
- Throws:
- ExecutionException- Tf an exception occurred during execution.
 
- redoRedo the operation. This method should only be called after an operation has been undone.- Specified by:
- redoin interface- IUndoableOperation
- Specified by:
- redoin class- AbstractOperation
- Parameters:
- monitor- The progress monitor (or- null) to use for reporting progress to the user.
- info- The IAdaptable (or- null) provided by the caller in order to supply UI information for prompting the user if necessary. When this parameter is not- null, it should minimally contain an adapter for the org.eclipse.swt.widgets.Shell.class.
- Returns:
- The IStatus of the redo. The status severity should be set to OKif the redo was successful, andERRORif it was not. Any other status is assumed to represent an incompletion of the redo.
- Throws:
- ExecutionException- If an exception occurred during redo.
 
- undoUndo the operation. This method should only be called after an operation has been executed.- Specified by:
- undoin interface- IUndoableOperation
- Specified by:
- undoin class- AbstractOperation
- Parameters:
- monitor- The progress monitor (or- null) to use for reporting progress to the user.
- info- The IAdaptable (or- null) provided by the caller in order to supply UI information for prompting the user if necessary. When this parameter is not- null, it should minimally contain an adapter for the org.eclipse.swt.widgets.Shell.class.
- Returns:
- The IStatus of the undo. The status severity should be set to OKif the redo was successful, andERRORif it was not. Any other status is assumed to represent an incompletion of the undo.
- Throws:
- ExecutionException- If an exception occurred during undo.
 
- createResourcespublic static String createResources- (Shell shell, String label, DesignerProp parent, GProp<?>[] props, String[] names) Creates the resources for the list of properties in the specified property.- Parameters:
- shell- The shell.
- parent- The parent property.
- props- The properties to create.
- names- The new (or existing) names of the properties.
- Returns:
- null for OK, otherwise an error message.
 
- createResourcespublic static String createResources- (Shell shell, String label, DesignerProp parent, GProp<?>[] props, String[] names, boolean showErrorDialog) Creates the resources for the list of properties in the specified property.- Parameters:
- shell- The shell.
- label- The label of the operation.
- parent- The parent property.
- props- The properties to create.
- names- The new (or existing) names of the properties.
- showErrorDialog- Flag to show an error dialog or not.
- Returns:
- null for OK, otherwise an error message.
 
- createFilepublic static String createFile- (Shell shell, String label, IContainer folder, PropCnr cnr, String fileName, boolean doOverwrite) Creates a resource file for a property with undo support.- Parameters:
- shell- The shell.
- label- Label for operation.
- folder- Folder to place file.
- cnr- The property container.
- fileName- The file name relative the folder.
- doOverwrite- Overwrite allowed flag.
- Returns:
- An error message, or null for success.
 
- createFilepublic static String createFile- (Shell shell, String label, IContainer folder, PropCnr cnr, String fileName, boolean doOverwrite, boolean showErrorDialog) Creates a resource file for a property with undo support.- Parameters:
- shell- The shell.
- label- Label for operation.
- folder- Folder to place file.
- cnr- The property container.
- fileName- The file name relative the folder.
- doOverwrite- Overwrite allowed flag.
- showErrorDialog- Flag to show an error dialog or not.
- Returns:
- An error message, or null for success.