Package com.iizigo.panel
Class PanelEditor
- All Implemented Interfaces:
- IComplexOperationSelection,- IActivationListener,- IDraggingFix,- IWorkbenchPartIZ,- IPreviewThemeProvider,- IPropertyEditorController,- IPropUndoContext,- IPropUndoRedo,- IAdaptable,- IExecutableExtension,- ISelectionChangedListener,- ISelectionProvider,- IGotoMarker,- IEditorPart,- INavigationLocationProvider,- IPersistable,- IPersistableEditor,- ISaveablePart,- ISaveablesSource,- IWorkbenchPart,- IWorkbenchPart2,- IWorkbenchPart3,- IWorkbenchPartOrientation
public class PanelEditor extends PropEditorPart implements IComplexOperationSelection, IPreviewThemeProvider
The panel editor.
- Author:
- Christopher Mindus
- Nested Class SummaryNested ClassesModifier and TypeClassDescription- static classClass holding a grid layout and components or indexes for the grid operations.- Nested classes/interfaces inherited from class com.iizigo.editor.PropEditorPart- PropEditorPart.DragSourceDelegator
- Field SummaryFields- Fields inherited from class com.iizigo.editor.PropEditorPart- appUI, copyAction, copyFullPathAction, copyReferenceAction, cutAction, deleteAction, dslPaste, editedPropCnr, EMPTY, filePropCnr, fileResource, globalActionBars, ir, linkAction, moveAction, partSelection, pasteAction, pasteAfterAction, pasteBeforeAction, pasteLinkAction, printAction, propEventListener, redoAction, renameAction, restoreMemento, revertAction, rootPropCnr, saveAction, selectAllAction, selectionEnabler, tiPaste, toolBar, toolBar2, undoAction, updateSelectionAndStatesRunner- Fields inherited from interface org.eclipse.ui.IEditorPart- PROP_DIRTY, PROP_INPUT- Fields inherited from interface org.eclipse.ui.IWorkbenchPart- PROP_TITLE
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- booleanReturns if styles are displayed or not.- static String- clearInternalBrowserCache- (IPreferenceStore store, boolean force, Browser browser) Checks if clearing the browser cache is required due to a new iiziGo Build or a compression settings.- protected void- createEditorComposite- (Composite parent) Creates the Editor Main Composite.- void- dispose()Disposes of the Panel Editor.- void- doComplexOperationSelection- (GProp<?>[] props) Performs the selection of the components.- static voidPerforms flashing of a component in all open editors.- booleanOpens the property by selecting it in focus.- booleanOpens the property by selecting it in focus.Gets the current language code.- intGets the current drop mode: 0 = Horizontal insert, 1 = Vertical insert, 2 = Horizontal overwrite, 3 = Horizontal overwrite wrapping, 4 = Vertically overwrite.Gets the edited panel.Gets the selection of marks for drag-drop.Gets the theme information for the current editor used for the image preview.Returns the tree viewer for the panel editor.Gets the VirtualSpace of the edited panel.- protected void- initEditor- (PropCnr cnr) The initialize editor method.- void- onClose()Called when the part is being closed but is not yet disposed but hidden.- protected voidCalled when verification listener gets called for verify, very commonly in a non-SWT thread.- voidCalled when the folder settings are changed.- voidAsks this part to take focus within the workbench.- protected voidCalled just in the beginning of updateStates() before selections are processed.- boolean- performClearCells- (boolean useComponentSelection, boolean doit) Clears cells in a grid.- protected boolean- performCopyFullPath- (boolean doPerform) Copies the full path.- protected boolean- performCopyReference- (boolean doPerform) Copies the reference.- boolean- performDeleteColumn- (boolean useComponentSelection, boolean doit) Delete column.- boolean- performDeleteRow- (boolean useComponentSelection, boolean doit) Delete row.- boolean- performInsertColumn- (boolean isAfter, boolean useComponentSelection, boolean doit) Inserts a column before or after.- boolean- performInsertRow- (boolean isAfter, boolean useComponentSelection, boolean doit) Inserts a row before or after.- voidPerforms Paste Before.- voidPerforms Paste Before.- protected voidPrint the window.- protected void- saveStateImpl- (IMemento memento) Saves the state.- protected voidSelection changes in the tree.- void- setDevice- (GSimpleDevice dev) Sets the device to use in the panel editor without undo functionality.- voidSets the fit-now zoom level.- void- setIncludeStyles- (boolean on) Enables or disables viewing of styles.- boolean- setTreeSelection- (GProp<?> prop) Sets the tree selection to the property in question.- protected booleanReturns if the Copy path should be present or not.- protected booleanReturns if the Copy reference should be present or not.- protected voidCalled to update the states.- protected voidInitializes the paste before/after validity.- protected booleanProcessing of paste before/after is enabled.- voidChecks if the browser is internal, and if so waits for the ClientSideEditor to start.- Methods inherited from class com.iizigo.editor.PropEditorPart- addForDisposalAtDispose, addListener, addOpenFile, addSelectionChangedListener, addToolbar2PushButton, addToolbar2PushButton, addToolbar2Separator, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarPushButton, addToolbarSeparator, addToolbarSeparator, closeFile, createCommonViewer, createEmptyNavigationLocation, createFilteredCommonViewer, createFilteredCommonViewer, createLicenseExceptionComposite, createMenu, createMenu, createNavigationLocation, createPartControl, doSave, doSaveAs, fireSelectionAndStates, getActiveEditor, getActiveEditor, getActivePart, getActiveSaveables, getAdapter, getCurrentTreeViewer, getEditors, getExtension, getLicenseException, getModuleModel, getMultiSelectionProvider, getPartComposite, getPartName, getRedoAction, getSaveables, getSelection, getSelectionEnabler, getShell, getSyntClipboardSelection, getTargetViewer, getTitleImage, getTitleToolTip, getTitleToolTip, getTopmostEditor, getUndoAction, getUndoContext, getUndoRedo, gotoMarker, hasInitError, init, invalidLicense, isDirty, isDisposed, isDragging, isSaveAsAllowed, isSaveOnCloseNeeded, onActivated, onCloseProject, onComponentFocus, onDragBegin, onDragEnd, onEditorActivated, onEditorReady, onFileClosed, onPartRenamed, performCollapseAll, performCopy, performCut, performDelete, performExpandAll, performLink, performMove, performPaste, performPasteLink, performRedo, performRename, performRevert, performSave, performSelectAll, performUndo, postAsyncUpdateStates, proceedInit, proceedInitProperty, refreshViewers, registerFormControl, registerViewer, registerViewer, removeListener, removePropertyValue, removeSelectionChangedListener, restoreMemento, restoreState, saveState, selectionChanged, setActionsUndoContext, setBlockViewerFocus, setFocus, setFocus, setInput, setPropertyAttrFlag, setPropertyError, setPropertyValue, setSelection, setTargetViewer, updateAllStates, updateStates, updateTitle, verifyDirtyStateChanged- Methods inherited from class org.eclipse.ui.part.EditorPart- checkSite, getEditorInput, getEditorSite, setContentDescription, setInitializationData, setInputWithNotify, setPartName- Methods inherited from class org.eclipse.ui.part.WorkbenchPart- addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy- Methods inherited from class org.eclipse.core.commands.common.EventManager- addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait- Methods inherited from interface com.iizigo.editor.complex.IComplexOperationSelection- getSelectionBefore, isDisposed, isReturningSelectionBeforeOperation- Methods inherited from interface org.eclipse.ui.IWorkbenchPart- addPropertyListener, getSite, getTitle, removePropertyListener- Methods inherited from interface com.iizigo.editor.IWorkbenchPartIZ- onComponentFocused
- Field Details- IDThe Part ID.
 
- Constructor Details- PanelEditorpublic PanelEditor()The Eclipse constructor.
 
- Method Details- clearInternalBrowserCachepublic static String clearInternalBrowserCache- (IPreferenceStore store, boolean force, Browser browser) Checks if clearing the browser cache is required due to a new iiziGo Build or a compression settings.- Parameters:
- store- The preference store.
- force- For clearing flag.
- browser- The browser component, null for Windows MSIE typically.
- Returns:
- Message for cache cleared, null for none.
 
- initEditorThe initialize editor method.- Subclasses may override this method. - Overrides:
- initEditorin class- PropEditorPart
- Parameters:
- cnr- The property container being edited. Note: the real name of the property is in the parent FilePropCnr Atom.
- Throws:
- PartInitException- For initialization failures.
 
- onClosepublic void onClose()Called when the part is being closed but is not yet disposed but hidden.- Specified by:
- onClosein interface- IActivationListener
- Overrides:
- onClosein class- PropEditorPart
 
- saveStateImplSaves the state.- Overrides:
- saveStateImplin class- PropEditorPart
- Parameters:
- memento- The storage area for object's state.
 
- getEditedPanelGets the edited panel.
- disposepublic void dispose()Disposes of the Panel Editor.- Specified by:
- disposein interface- IWorkbenchPart
- Overrides:
- disposein class- PropEditorPart
 
- onUpdateStatesprotected void onUpdateStates()Called just in the beginning of updateStates() before selections are processed. Override as required.- Overrides:
- onUpdateStatesin class- PropEditorPart
 
- onSetFocuspublic void onSetFocus()Asks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.- Overrides:
- onSetFocusin class- PropEditorPart
 
- usePasteBeforeAfterprotected boolean usePasteBeforeAfter()Processing of paste before/after is enabled.- Overrides:
- usePasteBeforeAfterin class- PropEditorPart
- Returns:
- true to handle before/after.
 
- updateStatesPasteBeforeAfterprotected void updateStatesPasteBeforeAfter()Initializes the paste before/after validity.- Overrides:
- updateStatesPasteBeforeAfterin class- PropEditorPart
 
- performPasteBeforepublic void performPasteBefore()Performs Paste Before.- Overrides:
- performPasteBeforein class- PropEditorPart
 
- performPasteAfterpublic void performPasteAfter()Performs Paste Before.- Overrides:
- performPasteAfterin class- PropEditorPart
 
- supportsCopyReferenceprotected boolean supportsCopyReference()Returns if the Copy reference should be present or not.- Overrides:
- supportsCopyReferencein class- PropEditorPart
- Returns:
- false indicates no such item should be present, true for maybe, depending on selection.
 
- supportsCopyFullPathprotected boolean supportsCopyFullPath()Returns if the Copy path should be present or not.- Overrides:
- supportsCopyFullPathin class- PropEditorPart
- Returns:
- false indicates no such item should be present, true for maybe, depending on selection.
 
- performCopyReferenceprotected boolean performCopyReference- (boolean doPerform) Copies the reference.- Overrides:
- performCopyReferencein class- PropEditorPart
- Parameters:
- doPerform- Flag to perform the action or just testing it.
- Returns:
- true for action enabled, false for disabled.
 
- performCopyFullPathprotected boolean performCopyFullPath- (boolean doPerform) Copies the full path.- Overrides:
- performCopyFullPathin class- PropEditorPart
- Parameters:
- doPerform- Flag to perform the action or just testing it.
- Returns:
- true for action enabled, false for disabled.
 
- onEditedPropertyChangedForVerifyCalled when verification listener gets called for verify, very commonly in a non-SWT thread. This method does nothing by default and can be overridden to process the edited property container changes events.- Overrides:
- onEditedPropertyChangedForVerifyin class- PropEditorPart
 
- onFolderSettingsChangedpublic void onFolderSettingsChanged()Called when the folder settings are changed. This may result in a change of themes.
- getThemesGets the theme information for the current editor used for the image preview. Currently this consists of the desktop and mobile themes separated by commas.- Specified by:
- getThemesin interface- IPreviewThemeProvider
- Returns:
- String consisting of the themes separated by commas, empty string means no theme (e.g. no mobile theme).
 
- setDeviceSets the device to use in the panel editor without undo functionality.- Parameters:
- dev- The device to use.
 
- waitForClientSideEditorpublic void waitForClientSideEditor()Checks if the browser is internal, and if so waits for the ClientSideEditor to start. This operation should be done outside of the main UI thread. If the panel editor is external, no waiting is done. The maximum time to wait is 20 seconds.
- setFitNowpublic void setFitNow()Sets the fit-now zoom level.
- getDropModepublic int getDropMode()Gets the current drop mode:- 0 = Horizontal insert,
- 1 = Vertical insert,
- 2 = Horizontal overwrite,
- 3 = Horizontal overwrite wrapping,
- 4 = Vertically overwrite.
 
- createEditorCompositeCreates the Editor Main Composite.- Specified by:
- createEditorCompositein class- PropEditorPart
- Parameters:
- parent- The empty parent composite without initialized layout, with the widget background color.
 
- setIncludeStylespublic void setIncludeStyles- (boolean on) Enables or disables viewing of styles.
- areStylesIncludedpublic boolean areStylesIncluded()Returns if styles are displayed or not.
- getTreeViewerReturns the tree viewer for the panel editor.
- selectionChangedExSelection changes in the tree.- Overrides:
- selectionChangedExin class- PropEditorPart
 
- getMarkedComponentsGets the selection of marks for drag-drop.
- doComplexOperationSelectionPerforms the selection of the components.- Specified by:
- doComplexOperationSelectionin interface- IComplexOperationSelection
 
- updateStatesExprotected void updateStatesEx()Called to update the states.- Overrides:
- updateStatesExin class- PropEditorPart
 
- doOpenOpens the property by selecting it in focus.- Overrides:
- doOpenin class- PropEditorPart
 
- doOpenOpens the property by selecting it in focus.- Overrides:
- doOpenin class- PropEditorPart
- Parameters:
- prop- The property to focus.
- index- The index in a multi-property.
- childName- Name of child property or null.
- Returns:
- true for success, false for failure.
 
- performPrintprotected void performPrint()Print the window.- Specified by:
- performPrintin class- PropEditorPart
 
- performInsertRowpublic boolean performInsertRow- (boolean isAfter, boolean useComponentSelection, boolean doit) Inserts a row before or after.
- performInsertColumnpublic boolean performInsertColumn- (boolean isAfter, boolean useComponentSelection, boolean doit) Inserts a column before or after.
- performDeleteRowpublic boolean performDeleteRow- (boolean useComponentSelection, boolean doit) Delete row.
- performDeleteColumnpublic boolean performDeleteColumn- (boolean useComponentSelection, boolean doit) Delete column.
- performClearCellspublic boolean performClearCells- (boolean useComponentSelection, boolean doit) Clears cells in a grid.
- doFlashPerforms flashing of a component in all open editors.
- setTreeSelectionSets the tree selection to the property in question. The first DesignerProp instance found is used.- Note that this must be called from the SWT thread. - Parameters:
- prop- The property to select.
- Returns:
- true For success, false for failure.
 
- getVirtualSpaceGets the VirtualSpace of the edited panel. If not yet assigned, a question will be asked to create a new VirtualSpace or assign an existing VirtualSpace.- Returns:
- The VirtualSpace, or null for none (user canceled operation).
 
- getCurrentLanguageCodeGets the current language code.- Returns:
- The language code, or null for default.