Class PropHelper
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final ObjectSpecial object returned for getCommonValue() when many different values exist.
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- static void- addUndoContext- (GProp<?> gp, org.eclipse.core.commands.operations.IUndoableOperation operation) Adds the undo contexts from a property to an operation.- static void- addUndoContexts- (GProp<?>[] props, org.eclipse.core.commands.operations.IUndoableOperation operation) Adds the undo contexts from a property to an operation.- static String[]Auto-renames properties.- static String- canPerform- (GProp<?>[] props, int operation) Checks properties for a valid operation.- static String- canPerform- (ArrayList<DesignerProp> list, int operation) Checks properties for a valid operation.- static String- doAdd- (String description, PropCnr target, GProp<?>[] props, IPropUndoRedo undoRedo, boolean doAutoRename) Adds properties with undo/redo support.- static String- doAdd- (String description, PropCnr target, GProp<?> prop, IPropUndoRedo undoRedo, boolean doAutoRename) Adds a property with undo/redo support.- static void- doCopy- (org.eclipse.swt.widgets.Shell parent, org.eclipse.jface.viewers.ISelection selection, Runnable completeCallback) Performs the Copy operation.- static String- doCut- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo, Runnable completeCallback) Cuts the selection in a viewer.- static String- doDelete- (String description, GProp<?>[] props, IPropUndoRedo undoRedo, Runnable completeCallback) Performs a delete of pure properties (cannot be resource based).- static String- doDelete- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo, Runnable completeCallback) Deletes the selection in a viewer.- static String- doInsert- (String description, PropCnr target, int index, GProp<?>[] props, IPropUndoRedo undoRedo, boolean doAutoRename) Adds or inserts properties with undo/redo support.- static void- doLink- (org.eclipse.swt.widgets.Shell shell, DesignerProp base, org.eclipse.jface.viewers.ISelection selection) Performs a Link of properties command.- static String- doMove- (boolean doPerform, String description, PropCnr target, GProp<?> reference, boolean isAfter, GProp<?>[] props, boolean doAutoRename, IPropUndoRedo undoRedo) Performs the move operation of the properties, with auto-renaming as a potential dialog box.- static void- doMove- (DesignerProp base, org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo) Performs a Move of properties command by displaying a dialog box to the user so a target can be selected for the move.- static booleanPerforms a Open of properties command.- static FilePropCnr- doOpen- (boolean doPerform, GProp<?> gp, PropEditorPart[] partReturn) Opens the Editor associated with the specified property.- static org.eclipse.ui.IEditorPart- doOpen- (org.eclipse.core.resources.IFile file) Opens the Editor of the specified file.- static boolean- doOpenAndFocus- (boolean doPerform, GProp<?> gp, int index) Opens the selected property in its associated editor, focuses the editor and selects the appropriate property.- static String- doPaste- (DesignerProp target, int position, IPropUndoRedo undoRedo) Performs a Paste operation with undo support.- static String- doPaste- (org.eclipse.jface.viewers.ISelection selection, int position, IPropUndoRedo undoRedo) Performs a Paste operation with undo support.- static String- doPasteLink- (DesignerProp target, IPropUndoRedo undoRedo) Performs a Paste-Link operation with undo support.- static String- doPasteLink- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo) Performs a Paste-Link operation with undo support.- static boolean- doRename- (GProp<?> prop, Atom newName, IPropUndoRedo undoRedo) Performs a rename property with undo/redo support.- static String- doRename- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo) Renames the selection in a viewer.- static void- doRename- (org.eclipse.swt.widgets.Shell shell, org.eclipse.core.resources.IResource resource, String newName, org.eclipse.core.commands.operations.IUndoContext undoContext) Performs a resource rename with undo support.- static voidVerifies the property.- static void- doVerify- (PropCnr property, IKStringInfoProvider kstringInfoProvider) Verifies the property.- static String- executeOperation- (org.eclipse.swt.widgets.Shell shell, org.eclipse.core.commands.operations.AbstractOperation op) Executes an operation.- static void- expandAll- (org.eclipse.jface.viewers.TreeViewer viewer) Expands all items in a "standard tree viewer" that belong to the IIZI Module, i.e.- static void- expandAllInPath- (org.eclipse.jface.viewers.StructuredViewer viewer, org.eclipse.jface.viewers.TreePath path) Expands all elements in a path.- static void- expandAllInPaths- (org.eclipse.jface.viewers.StructuredViewer viewer, org.eclipse.jface.viewers.TreePath[] paths) Expands all elements in specified paths.- static void- expandModuleItems- (org.eclipse.jface.viewers.TreeViewer viewer) Expand a "standard tree viewer" with all project item of the IIZI Module so that all its files are displayed.- static PropCnr- getAncestor- (GProp<?> gp1, GProp<?> gp2) Gets the common ancestor of two properties.- static PropCnr- getCommonParent- (GProp<?>[] props) Gets the common parent for all properties.- static DesignerProp- getDesignerProp- (GProp<?> gp) Gets a DesignerProp for a property, by searching it and its parents.- static ArrayList<DesignerProp>- getDesignerProps- (GProp<?>[] props) Gets the DesignerProps for the specified properties.- static ModuleFolderGets the common ModuleFolder for properties.- static ModuleModel- getModuleModel- (GProp<?> gp) Gets the IIZI Module Model from a property.- static ModuleModel- getModuleModel- (GProp<?>... props) Gets the common Module Model from properties.- static org.eclipse.jface.viewers.TreePath- getNearestSelectionPath- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Finds the selection path for a DesignerProp in a viewer.- static GProp<?>[]Gets the selected properties array.- static Object- getPropsValue- (PropCnr[] containers, Atom atom) Helper method to get a single value from many containers.- static org.eclipse.jface.viewers.TreePath- getSelectionPath- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Finds the selection path for a DesignerProp in a viewer.- static org.eclipse.jface.viewers.TreePath- getSelectionPath- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp, HashSet<Object> filtered) Finds the selection path for a DesignerProp in a viewer.- static org.eclipse.jface.viewers.TreePath- getSelectionPath- (org.eclipse.jface.viewers.TreeViewer viewer, Object element) Finds the selection path for a DesignerProp in a viewer.- static org.eclipse.core.commands.operations.IUndoContext- getUndoContext- (GProp<?> gp) Gets the undo context for a property.- static Atom[]- getUniqueNames- (PropCnr cnr, GProp<?>[] props, String suffix, boolean isCopy) Gets the names of properties to move to or add in a container.- static boolean- queueVerify- (PropCnr property) Asynchronous-verifies the property in a queue in the SWT thread.- static boolean- queueVerify- (PropCnr property, IKStringInfoProvider kstringInfoProvider, Runnable callback) Asynchronous-verifies the property in a queue in the SWT thread.- static boolean- queueVerify- (PropCnr property, Runnable callback) Asynchronous-verifies the property in a queue in the SWT thread.- static void- restoreState- (org.eclipse.jface.viewers.Viewer viewer, ModuleRootPropCnr root, org.eclipse.ui.IMemento memento) Restores the state of a viewer once the viewer contents has been set.- static void- restoreTree- (org.eclipse.core.resources.IFile file, org.eclipse.ui.IMemento memento, String key, org.eclipse.jface.viewers.TreeViewer viewer, PropCnr editedProperty) Restores the selection of the properties in the memento or the file, in the memento as a priority over the file.- static void- saveState- (org.eclipse.jface.viewers.Viewer viewer, org.eclipse.ui.IMemento memento) Saves the memento for a Tree or Table Viewer, i.e.- static void- saveViewer- (org.eclipse.core.resources.IFile file, org.eclipse.jface.viewers.TreeViewer viewer) Saves the selection and expanded states of the properties in the file permanent properties.- static void- saveViewer- (org.eclipse.jface.viewers.TreeViewer viewer, StringBuilder selection, StringBuilder expanded) Saves the selection and expanded state of a viewer into two buffers.- static void- saveViewer- (org.eclipse.ui.IMemento memento, String key, org.eclipse.jface.viewers.TreeViewer viewer) Saves the selection and expanded states of the properties in the memento.- static void- scheduleDeleteJob- (String jobName, org.eclipse.swt.widgets.Shell shell, org.eclipse.core.resources.IResource[] resourcesToDelete, boolean deleteContent, org.eclipse.core.commands.operations.IUndoContext undoContext, Runnable completeCallback) Schedules a delete resources job.- static void- selectPropsAndFocusTreeViewer- (GProp<?>[] props, org.eclipse.jface.viewers.StructuredViewer viewer) Request a selection of the properties.- static String- setAttribute- (GProp<?> prop, int attr, boolean flag, IPropUndoRedo undoRedo) Sets property attribute.- static String- setError- (GProp<?> prop, String errorID, IPropErrorItem item, IPropUndoRedo undoRedo) Sets property error: adds, changes or removes the error, with undo/redo support.- static boolean- setNearestSelection- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Sets the nearest selection to the DesignerProp.- static boolean- setSelection- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Sets the selection of the property.- static int- setSelection- (org.eclipse.jface.viewers.StructuredViewer viewer, Collection<DesignerProp> list) Sets the selection of the properties.- static String- setValue- (String description, GProp<?>[] props, Object[] values, IPropUndoRedo undoRedo) Sets property values.- static String- setValue- (String description, GProp<?> prop, Object value, IPropUndoRedo undoRedo) Sets a single property value.- static String- setValue- (String description, PropCnr container, GProp<?> prop, IPropUndoRedo undoRedo) Sets a single property value in a property container.- static void- syncExec- (GEvent e, EventListener listener) Helper routine to execute a property event in the SWT thread synchronously.- static String- validateReferenceNameFormat- (String name, boolean doCheckValidProject, boolean doLookup, Class<?>[] possibleClasses) Validates a reference name to be of correct format.- static org.eclipse.jface.viewers.StructuredViewer- viewerContainingAllProperties- (Object viewer, GProp<?> single, GProp<?>[] props) Checks if a viewer container the properties in question.
- Field Details- MANY_VALUESSpecial object returned for getCommonValue() when many different values exist.
 
- Constructor Details- PropHelperpublic PropHelper()
 
- Method Details- getPropspublic static GProp<?>[] getProps- (org.eclipse.jface.viewers.ISelection selection, Class<?>... propClasses) Gets the selected properties array. If the selection doesn't contain any properties of the list of possible classes (i.e. has an unknown class), a null array is returned.- Parameters:
- selection- The selection.
- propClasses- List of classes that are accepted in the returned array.
- Returns:
- The array list of selected properties, or null if the selection contains other elements than properties.
 
- doCopypublic static void doCopy- (org.eclipse.swt.widgets.Shell parent, org.eclipse.jface.viewers.ISelection selection, Runnable completeCallback) Performs the Copy operation. If the selection doesn't contain properties a message box is displayed.- Parameters:
- parent- The shell.
- selection- The selection in the viewer.
- completeCallback- If non-null, the callback that will be called in the SWT thread when undo completed (e.g. to update states).
 
- doPastepublic static String doPaste- (org.eclipse.jface.viewers.ISelection selection, int position, IPropUndoRedo undoRedo) Performs a Paste operation with undo support.- Parameters:
- selection- The selection in the viewer.
- position- The position in the target (0=inside, -1=before target in parent, 1=after target in parent).
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- doPastePerforms a Paste operation with undo support.- Parameters:
- target- Target property.
- position- The position in the target (0=inside, -1=before target in parent, 1=after target in parent).
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- doPasteLinkpublic static String doPasteLink- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo) Performs a Paste-Link operation with undo support.- Parameters:
- selection- The selection in the viewer.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- doPasteLinkPerforms a Paste-Link operation with undo support.- Parameters:
- target- Target property.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- doAddpublic static String doAdd- (String description, PropCnr target, GProp<?> prop, IPropUndoRedo undoRedo, boolean doAutoRename) Adds a property with undo/redo support.- Parameters:
- description- The description of the operation (if props.length>1, make it in plural).
- target- The target property container.
- prop- The property to add.
- undoRedo- The undo/redo interface.
- doAutoRename- Flag set to true to indicate automatic rename of existing property names.
- Returns:
- The success response is null, otherwise an error message.
 
- doAddpublic static String doAdd- (String description, PropCnr target, GProp<?>[] props, IPropUndoRedo undoRedo, boolean doAutoRename) Adds properties with undo/redo support.- Parameters:
- description- The description of the operation (if props.length>1, make it in plural).
- target- The target property container.
- props- The properties.
- undoRedo- The undo/redo interface.
- doAutoRename- Flag set to true to indicate automatic rename of existing property names.
- Returns:
- The success response is null, otherwise an error message.
 
- doInsertpublic static String doInsert- (String description, PropCnr target, int index, GProp<?>[] props, IPropUndoRedo undoRedo, boolean doAutoRename) Adds or inserts properties with undo/redo support.- Parameters:
- description- The description of the operation (if props.length>1, make it in plural).
- target- The target property container.
- index- The index in target, -1 for none (then position is assumed to be 0, and vice versa).
- props- The properties.
- undoRedo- The undo/redo interface.
- doAutoRename- Flag set to true to indicate automatic rename of existing property names.
- Returns:
- The success response is null, otherwise an error message.
 
- executeOperationpublic static String executeOperation- (org.eclipse.swt.widgets.Shell shell, org.eclipse.core.commands.operations.AbstractOperation op) Executes an operation.- Parameters:
- shell- The shell.
- op- The operation.
- Returns:
- null For OK, otherwise an error message that has been displayed in a message box.
 
- doDeletepublic static String doDelete- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo, Runnable completeCallback) Deletes the selection in a viewer. If the selection contains a resource, all the selected items must be resources.- Parameters:
- selection- The selection in the viewer.
- undoRedo- The undo/redo interface.
- completeCallback- If non-null, the callback that will be called in the SWT thread when undo completed (e.g. to update states).
- Returns:
- The success response is null, otherwise an error message.
 
- doCutpublic static String doCut- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo, Runnable completeCallback) Cuts the selection in a viewer. If the selection contains a resource, all the selected items must be resources.- Parameters:
- selection- The selection in the viewer.
- undoRedo- The undo/redo interface.
- completeCallback- If non-null, the callback that will be called in the SWT thread when undo completed (e.g. to update states).
- Returns:
- The success response is null, otherwise an error message.
 
- scheduleDeleteJobpublic static void scheduleDeleteJob- (String jobName, org.eclipse.swt.widgets.Shell shell, org.eclipse.core.resources.IResource[] resourcesToDelete, boolean deleteContent, org.eclipse.core.commands.operations.IUndoContext undoContext, Runnable completeCallback) Schedules a delete resources job.
- doDeletepublic static String doDelete- (String description, GProp<?>[] props, IPropUndoRedo undoRedo, Runnable completeCallback) Performs a delete of pure properties (cannot be resource based). If a property is resource based, an assertion is thrown.- Parameters:
- description- The description of the operation.
- props- The properties to remove.
- undoRedo- The undo/redo instance.
- completeCallback- Callback called when operation completes, null for none.
- Returns:
- The success response is null, otherwise an error message.
 
- doRenamepublic static String doRename- (org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo) Renames the selection in a viewer. The selection must be a single resource based property.- Parameters:
- selection- The selection in the viewer.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- setValuepublic static String setValue- (String description, GProp<?> prop, Object value, IPropUndoRedo undoRedo) Sets a single property value.- Parameters:
- description- The description of the operation.
- prop- The property.
- value- The value.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- setValuepublic static String setValue- (String description, PropCnr container, GProp<?> prop, IPropUndoRedo undoRedo) throws PropException Sets a single property value in a property container. If the container contains the property, that property is set. If not, the property is added to the container with the set value.- Parameters:
- description- The description of the operation.
- container- The container.
- prop- The property.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
- Throws:
- PropException- If the value cannot be set in the property.
 
- setAttributeSets property attribute.- Parameters:
- prop- The property.
- attr- The attribute PropAttrEvent.PROP_*
- flag- The flag.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- setErrorpublic static String setError- (GProp<?> prop, String errorID, IPropErrorItem item, IPropUndoRedo undoRedo) Sets property error: adds, changes or removes the error, with undo/redo support.- Parameters:
- prop- The property.
- errorID- The error ID (might be null).
- item- Error item, null to remove the error, otherwise an error instance to set the error.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- setValuepublic static String setValue- (String description, GProp<?>[] props, Object[] values, IPropUndoRedo undoRedo) Sets property values. The arrays must be of equal lengths.- Parameters:
- description- The description of the operation.
- props- The array of properties.
- values- The array of values.
- undoRedo- The undo/redo interface.
- Returns:
- The success response is null, otherwise an error message.
 
- saveStatepublic static void saveState- (org.eclipse.jface.viewers.Viewer viewer, org.eclipse.ui.IMemento memento) Saves the memento for a Tree or Table Viewer, i.e. the current selection and the expanded items (tree only).- Parameters:
- viewer- The viewer.
- memento- The memento should be a child of the Editor Part saving the state.
 
- restoreStatepublic static void restoreState- (org.eclipse.jface.viewers.Viewer viewer, ModuleRootPropCnr root, org.eclipse.ui.IMemento memento) Restores the state of a viewer once the viewer contents has been set.- Parameters:
- viewer- The viewer.
- root- The Module root property of the project.
- memento- The memento should be a child of the Editor Part saving the state, can be null.
 
- getDesignerPropsGets the DesignerProps for the specified properties.
- selectPropsAndFocusTreeViewerpublic static void selectPropsAndFocusTreeViewer- (GProp<?>[] props, org.eclipse.jface.viewers.StructuredViewer viewer) Request a selection of the properties. This method may be called from a non-SWT thread, resulting in a synchronous operation call to the SWT thread.
- setSelectionpublic static boolean setSelection- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Sets the selection of the property. Must be from SWT thread and focus is not changed.- Returns:
- true if selection was set, false for failure.
 
- setSelectionpublic static int setSelection- (org.eclipse.jface.viewers.StructuredViewer viewer, Collection<DesignerProp> list) Sets the selection of the properties. Must be from SWT thread and focus is not changed.- Returns:
- Count of items selected, zero means failure if list is non-empty.
 
- expandAllInPathpublic static void expandAllInPath- (org.eclipse.jface.viewers.StructuredViewer viewer, org.eclipse.jface.viewers.TreePath path) Expands all elements in a path.- Parameters:
- viewer- The viewer, hopefully a tree viewer.
- path- The path.
 
- expandAllInPathspublic static void expandAllInPaths- (org.eclipse.jface.viewers.StructuredViewer viewer, org.eclipse.jface.viewers.TreePath[] paths) Expands all elements in specified paths.- Parameters:
- viewer- The viewer, hopefully a tree viewer.
- paths- The paths.
 
- getSelectionPathpublic static org.eclipse.jface.viewers.TreePath getSelectionPath- (org.eclipse.jface.viewers.TreeViewer viewer, Object element) Finds the selection path for a DesignerProp in a viewer.
- getSelectionPathpublic static org.eclipse.jface.viewers.TreePath getSelectionPath- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Finds the selection path for a DesignerProp in a viewer.
- setNearestSelectionpublic static boolean setNearestSelection- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Sets the nearest selection to the DesignerProp.- Returns:
- true if selection is found, false otherwise.
 
- getNearestSelectionPathpublic static org.eclipse.jface.viewers.TreePath getNearestSelectionPath- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp) Finds the selection path for a DesignerProp in a viewer.
- getSelectionPathpublic static org.eclipse.jface.viewers.TreePath getSelectionPath- (org.eclipse.jface.viewers.StructuredViewer viewer, DesignerProp dp, HashSet<Object> filtered) Finds the selection path for a DesignerProp in a viewer.
- doRenamepublic static boolean doRename- (GProp<?> prop, Atom newName, IPropUndoRedo undoRedo) throws PropTypeException Performs a rename property with undo/redo support.- Returns:
- true for change, false for no change.
- Throws:
- PropTypeException- When the property cannot be renamed, same name or read-only.
 
- doRenamepublic static void doRename- (org.eclipse.swt.widgets.Shell shell, org.eclipse.core.resources.IResource resource, String newName, org.eclipse.core.commands.operations.IUndoContext undoContext) Performs a resource rename with undo support.
- syncExecHelper routine to execute a property event in the SWT thread synchronously. If the current thread is the SWT thread, the listener is called directly.
- autoRenamepublic static String[] autoRename- (PropCnr target, GProp<?>[] props, String first, String next, String next2) Auto-renames properties. If the source is from an assets directory and target is not, the file extension is removed if it matches the destination.- Parameters:
- target- The target container.
- props- The properties.
- first- The first appended string, e.g. "Copy of ".
- next- The next appended string, e.g. "Copy ". The next and next2 are used to append string, e.g. "Copy 2 of NNN".
- next2- The next #2 appended string, e.g. " of ".
- Returns:
- The string array of the property names.
 
- getUndoContextGets the undo context for a property.- Parameters:
- gp- The property.
- Returns:
- The undo context or null for none.
 
- addUndoContextpublic static void addUndoContext- (GProp<?> gp, org.eclipse.core.commands.operations.IUndoableOperation operation) Adds the undo contexts from a property to an operation.
- addUndoContextspublic static void addUndoContexts- (GProp<?>[] props, org.eclipse.core.commands.operations.IUndoableOperation operation) Adds the undo contexts from a property to an operation.
- getFolderGets the common ModuleFolder for properties.- Returns:
- The common Module Folder, or null for none.
 
- getDesignerPropGets a DesignerProp for a property, by searching it and its parents.
- getCommonParentGets the common parent for all properties.- Parameters:
- props- The properties.
- Returns:
- The common parent, or null if not possible (e.g. different projects).
 
- getAncestorGets the common ancestor of two properties.
- doMovepublic static void doMove- (DesignerProp base, org.eclipse.jface.viewers.ISelection selection, IPropUndoRedo undoRedo) Performs a Move of properties command by displaying a dialog box to the user so a target can be selected for the move.
- doMovepublic static String doMove- (boolean doPerform, String description, PropCnr target, GProp<?> reference, boolean isAfter, GProp<?>[] props, boolean doAutoRename, IPropUndoRedo undoRedo) Performs the move operation of the properties, with auto-renaming as a potential dialog box.- Parameters:
- doPerform- Flag to perform the operation if true, false to test operation only.
- description- Description of the operation.
- target- Target property.
- reference- Reference property in target where to place the moved properties (can be null if target is not index based or if they should be added last).
- isAfter- Flag indicating how to move the properties in regards to the reference property (when reference is not null).
- props- Properties to move.
- doAutoRename- Auto-rename of properties.
- undoRedo- Undo-redo instance.
- Returns:
- An error message for operation, or null for success.
 
- doLinkpublic static void doLink- (org.eclipse.swt.widgets.Shell shell, DesignerProp base, org.eclipse.jface.viewers.ISelection selection) Performs a Link of properties command.
- doOpenPerforms a Open of properties command. If a property is open in an editor, that editor is placed in focus.- Parameters:
- doPerform- Set to false to see if this open command would succeed, true to perform the open.
- props- The properties to open in an Editor.
- Returns:
- The success flag, false if none could be opened.
 
- doOpenOpens the Editor associated with the specified property.- Parameters:
- doPerform- Set to false to see if this open command would succeed, true to perform the open.
- gp- The property to open in an Editor.
- partReturn- Array of 1 in length (minimum), where index 0 is filled upon successful return, or set to null for failure or no need to call doOpen on the part with the property. Set partReturn to null for no return value.
- Returns:
- The success property container opened, null if none could be opened.
 
- doOpenAndFocusOpens the selected property in its associated editor, focuses the editor and selects the appropriate property.- Parameters:
- doPerform- Flag for testing only, or to perform the actual open.
- gp- The property.
- index- Index for a multi-prop, otherwise not used.
- Returns:
- The success property container opened, null if none could be opened.
 
- doOpenpublic static org.eclipse.ui.IEditorPart doOpen- (org.eclipse.core.resources.IFile file) Opens the Editor of the specified file.- Parameters:
- file- The file to open.
- Returns:
- The IEditorPart, if an "IIZI Module Editor", an instance of PropEditorPart. For errors, null is returned.
 
- canPerformChecks properties for a valid operation.- Parameters:
- props- The properties.
- operation- The operation: DesignerProp.OP_MOVE or OP_DELETE.
- Returns:
- null for success (operation can be performed), otherwise the error message.
 
- canPerformChecks properties for a valid operation.- Parameters:
- list- The properties.
- operation- The operation (DesignerProp.OP_*).
 
- expandModuleItemspublic static void expandModuleItems- (org.eclipse.jface.viewers.TreeViewer viewer) Expand a "standard tree viewer" with all project item of the IIZI Module so that all its files are displayed.
- expandAllpublic static void expandAll- (org.eclipse.jface.viewers.TreeViewer viewer) Expands all items in a "standard tree viewer" that belong to the IIZI Module, i.e. doesn't expand the JRE items that takes forever...
- validateReferenceNameFormatpublic static String validateReferenceNameFormat- (String name, boolean doCheckValidProject, boolean doLookup, Class<?>[] possibleClasses) Validates a reference name to be of correct format.- Parameters:
- name- The reference name to check.
- doCheckValidProject- To check the validity of project.
- doLookup- To look-up for real existing reference.
- possibleClasses- The classes to look-up.
- Returns:
- The error string.
 
- doVerifyVerifies the property. This method can only be called for editable properties that are located in a FilePropCnr or a FolderPropCnr, i.e. the data container property. All other properties will generate a logged message and no verification will take place.- Parameters:
- property- Property to verify.
 
- doVerifyVerifies the property. This method can only be called for editable properties that are located in a FilePropCnr or a FolderPropCnr, i.e. the data container property. All other properties will generate a logged message and no verification will take place.- Parameters:
- property- Property to verify.
- kstringInfoProvider- The KStringInfoProvider instance.
- Throws:
- NullPointerException- If- kstringInfoProvideris- null.
 
- queueVerifyAsynchronous-verifies the property in a queue in the SWT thread. This call can be made several times, and the property will only be verified once.- This method can only be called for editable properties that are located in a FilePropCnr or a FolderPropCnr, i.e. the data container property. All other properties will generate a logged message and no verification will take place. - Parameters:
- property- Property to verify.
- Returns:
- true if queued, false if already in queue for verification
 
- queueVerifyAsynchronous-verifies the property in a queue in the SWT thread. This call can be made several times, and the property will only be verified once.- This method can only be called for editable properties that are located in a FilePropCnr or a FolderPropCnr, i.e. the data container property. All other properties will generate a logged message and no verification will take place. - If there is an existing entry for the property in the queue, nothing will be done and - falseis returned. Be careful about this as the queued item may have a different callback set! Use- doVerify()if this is important!- Parameters:
- property- Property to verify.
- callback- Callback to be called when verification has been run,- nullfor none.
- Returns:
- true if queued, false if already in queue for verification, property is disposed of, or workbench is closing.
 
- queueVerifypublic static boolean queueVerify- (PropCnr property, IKStringInfoProvider kstringInfoProvider, Runnable callback) Asynchronous-verifies the property in a queue in the SWT thread. This call can be made several times, and the property will only be verified once.- This method can only be called for editable properties that are located in a FilePropCnr or a FolderPropCnr, i.e. the data container property. All other properties will generate a logged message and no verification will take place. - If there is an existing entry for the property in the queue, nothing will be done and - falseis returned. Be careful about this as the queued item may have a different callback set! Use- doVerify()if this is important!- Parameters:
- property- Property to verify.
- kstringInfoProvider- The KStringInfoProvider instance.
- callback- Callback to be called when verification has been run,- nullfor none.
- Throws:
- NullPointerException- If- kstringInfoProvideris- null.
 
- saveViewerpublic static void saveViewer- (org.eclipse.ui.IMemento memento, String key, org.eclipse.jface.viewers.TreeViewer viewer) Saves the selection and expanded states of the properties in the memento.
- saveViewerpublic static void saveViewer- (org.eclipse.core.resources.IFile file, org.eclipse.jface.viewers.TreeViewer viewer) Saves the selection and expanded states of the properties in the file permanent properties.
- restoreTreepublic static void restoreTree- (org.eclipse.core.resources.IFile file, org.eclipse.ui.IMemento memento, String key, org.eclipse.jface.viewers.TreeViewer viewer, PropCnr editedProperty) Restores the selection of the properties in the memento or the file, in the memento as a priority over the file.- Parameters:
- file- The file to load properties from, or null for none.
- memento- The memento to use in priority over the file, null for none.
- key- The memento key to use.
- viewer- The tree viewer.
- editedProperty- The edited property.
 
- saveViewerpublic static void saveViewer- (org.eclipse.jface.viewers.TreeViewer viewer, StringBuilder selection, StringBuilder expanded) Saves the selection and expanded state of a viewer into two buffers.
- viewerContainingAllPropertiespublic static org.eclipse.jface.viewers.StructuredViewer viewerContainingAllProperties- (Object viewer, GProp<?> single, GProp<?>[] props) Checks if a viewer container the properties in question. This method is used in the undo/redo operations for selecting in the viewers.
- getPropsValueHelper method to get a single value from many containers.- Parameters:
- containers- The containers to look-up a value in.
- atom- The name of the property to get.
- Returns:
- MANY_VALUES if the value is not common in the containers, null for no value, otherwise the value.
 
- getUniqueNamesGets the names of properties to move to or add in a container. Support also exists if the component is already in the container, then the name is not changed.- Parameters:
- cnr- The destination container.
- props- The properties.
- suffix- String to add when name exists, e.g. " Copy" or " Move".
 
- getModuleModelGets the IIZI Module Model from a property.- Parameters:
- gp- The property (or null for none).
- Returns:
- The Module Model instance, or null if not found.
 
- getModuleModelGets the common Module Model from properties.