Package com.iizigo.server
Class ServerConfigComposite
- java.lang.Object
- org.eclipse.swt.widgets.Widget
- org.eclipse.swt.widgets.Control
- org.eclipse.swt.widgets.Scrollable
- org.eclipse.swt.widgets.Composite
- com.iizigo.server.ServerConfigComposite
 
 
 
 
 
- All Implemented Interfaces:
- IDraggingFix,- IPropertyEditorController,- IServerConfigFileListener,- EventListener,- IPropUndoRedo,- org.eclipse.jface.viewers.ISelectionChangedListener,- org.eclipse.swt.graphics.Drawable
 - public class ServerConfigComposite extends org.eclipse.swt.widgets.Composite implements IPropUndoRedo, org.eclipse.jface.viewers.ISelectionChangedListener, IDraggingFix, IPropertyEditorController, IServerConfigFileListener, EventListener The Server Configuration composite displays a tree with the server configuration and a property editor for the properties.- Author:
- Christopher Mindus
 
- Nested Class Summary- Nested Classes - Modifier and Type - Class - Description - protected class- ServerConfigComposite.DragSourceDelegatorClass used to delegate DragSource events to the listener, making it possible to know when drag-drop is in effect.
 - Constructor Summary- Constructors - Constructor - Description - ServerConfigComposite(org.eclipse.ui.IWorkbenchPart part, org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.IMemento restoreMemento, java.lang.Runnable saveChangedCallback)Creates the Server configuration composite.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - void- addErrorComposite(org.eclipse.swt.widgets.Composite errorComposite)Adds an error composite for presentation of the errors.- void- createControls()Creates the view part.- void- dispose()Disposes of this composite.- void- doSave(org.eclipse.core.runtime.IProgressMonitor monitor)Saves the contents if required.- ModuleModel- getModuleModel()Gets the ModuleModel instance of the project.- MultiSelectionProvider- getMultiSelectionProvider()Gets the multi-property selection provider.- SelectionEnabler- getSelectionEnabler()Gets the selection enabler instance.- ServerConfigFile- getServerConfigFile()Gets the Server Configuration file instance.- EditorServerSettings- getSettings()Gets the settings.- java.lang.Object- getTargetViewer()Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).- java.lang.Object- getUndoContext()Gets the undo context.- IPropUndoRedo- getUndoRedo()Gets the undo/redo instance.- boolean- isDirty()Gets the dirty state.- boolean- isDragging()Flag for dragging to postpone selection events until drag completes.- protected void- onDragBegin()Drag started.- protected void- onDragEnd()Drag finished.- void- onEvent(GEvent event)Called to process an event.- void- onServerConfigFileUpdated(ServerConfigFile serverConfigFile)Called when a change has been made somehow and/or the property tree has been verified for errors.- void- removePropertyValue(GProp<?> property)Removes a property when undefined in the editors.- void- saveState(org.eclipse.ui.IMemento memento)Saves the state.- void- selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)Notifies that the selection has changed.- void- setBlockViewerFocus(boolean block)Blocks the target viewer from focus.- void- setPropertyAttrFlag(GProp<?> property, int attr, boolean flag)Sets a property attribute flag.- void- setPropertyError(GProp<?> property, java.lang.String errorID, IPropErrorItem item)Sets a property error.- void- setPropertyValue(PropCnr parent, GProp<?> property, java.lang.Object value)Sets a property value.- void- setServerConfigFile(ServerConfigFile config, java.lang.Exception loadException)Sets or clears the Server configuration file to edit.- void- setTargetViewer(java.lang.Object viewer)Sets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).- void- updateStates()Updates the states of menu items and tool bars.- Methods inherited from class org.eclipse.swt.widgets.Composite- changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 - Methods inherited from class org.eclipse.swt.widgets.Scrollable- computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
 - Methods inherited from class org.eclipse.swt.widgets.Control- addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
 - Methods inherited from class org.eclipse.swt.widgets.Widget- addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
 - Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - Methods inherited from interface com.iizigo.prop.IPropertyEditorController- isDisposed
 - Methods inherited from interface com.iizix.prop.IPropUndoRedo- getShell
 
 
- Constructor Detail- ServerConfigComposite- public ServerConfigComposite(org.eclipse.ui.IWorkbenchPart part, org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.IMemento restoreMemento, java.lang.Runnable saveChangedCallback)Creates the Server configuration composite.- Parameters:
- part- The workbench part, or null for none.
- parent- The parent composite.
- restoreMemento- The restore memento, or null for none.
- saveChangedCallback- Callback when dirty changed and save is required.
 
 
 - Method Detail- dispose- public void dispose() Disposes of this composite.- Overrides:
- disposein class- org.eclipse.swt.widgets.Widget
 
 - getServerConfigFile- public ServerConfigFile getServerConfigFile() Gets the Server Configuration file instance.- Returns:
- The current configuration file, or null for none.
 
 - getSettings- public EditorServerSettings getSettings() Gets the settings.- Returns:
- The current Server settings, or null for none.
 
 - setServerConfigFile- public void setServerConfigFile(ServerConfigFile config, java.lang.Exception loadException) Sets or clears the Server configuration file to edit.- Parameters:
- config- The configuration, or null for none (- loadExceptionmay indicate the error).
- loadException- The load exception that occurred, null when- configis non-null.
 
 - onServerConfigFileUpdated- public void onServerConfigFileUpdated(ServerConfigFile serverConfigFile) Called when a change has been made somehow and/or the property tree has been verified for errors.- Specified by:
- onServerConfigFileUpdatedin interface- IServerConfigFileListener
- Parameters:
- serverConfigFile- The configuration file that was updated, changed or verified.
 
 - isDirty- public boolean isDirty() Gets the dirty state.- Returns:
- true if file needs saving, false if not dirty.
 
 - saveState- public void saveState(org.eclipse.ui.IMemento memento) Saves the state.
 - createControls- public void createControls() Creates the view part.
 - updateStates- public void updateStates() Updates the states of menu items and tool bars.- Specified by:
- updateStatesin interface- IPropUndoRedo
 
 - selectionChanged- public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event) Notifies that the selection has changed.- Specified by:
- selectionChangedin interface- org.eclipse.jface.viewers.ISelectionChangedListener
- Parameters:
- event- event object describing the change
 
 - getSelectionEnabler- public SelectionEnabler getSelectionEnabler() Gets the selection enabler instance.
 - getUndoContext- public java.lang.Object getUndoContext() Gets the undo context.- Specified by:
- getUndoContextin interface- IPropertyEditorController
- Specified by:
- getUndoContextin interface- IPropUndoRedo
- Returns:
- An object castable to org.eclipse.core.commands.operations.IUndoContext.
 
 - setTargetViewer- public void setTargetViewer(java.lang.Object viewer) Sets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).- Specified by:
- setTargetViewerin interface- IPropUndoRedo
- Parameters:
- viewer- The CommonViewer, TreeViewer or TableViewer, or null for none.
 
 - getUndoRedo- public IPropUndoRedo getUndoRedo() Gets the undo/redo instance.- Specified by:
- getUndoRedoin interface- IPropertyEditorController
 
 - onDragBegin- protected void onDragBegin() Drag started.
 - onDragEnd- protected void onDragEnd() Drag finished.
 - isDragging- public boolean isDragging() Flag for dragging to postpone selection events until drag completes.- Specified by:
- isDraggingin interface- IDraggingFix
 
 - getModuleModel- public ModuleModel getModuleModel() Gets the ModuleModel instance of the project.- Specified by:
- getModuleModelin interface- IPropertyEditorController
 
 - getMultiSelectionProvider- public MultiSelectionProvider getMultiSelectionProvider() Gets the multi-property selection provider.- Specified by:
- getMultiSelectionProviderin interface- IPropertyEditorController
 
 - getTargetViewer- public java.lang.Object getTargetViewer() Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).- Specified by:
- getTargetViewerin interface- IPropUndoRedo
- Returns:
- The CommonViewer, TreeViewer or TableViewer, or null for none.
 
 - setBlockViewerFocus- public void setBlockViewerFocus(boolean block) Blocks the target viewer from focus.- Specified by:
- setBlockViewerFocusin interface- IPropertyEditorController
 
 - setPropertyError- public void setPropertyError(GProp<?> property, java.lang.String errorID, IPropErrorItem item) Sets a property error. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
- setPropertyErrorin interface- IPropertyEditorController
 
 - removePropertyValue- public void removePropertyValue(GProp<?> property) Removes a property when undefined in the editors. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
- removePropertyValuein interface- IPropertyEditorController
 
 - setPropertyAttrFlag- public void setPropertyAttrFlag(GProp<?> property, int attr, boolean flag) Sets a property attribute flag. The undo/redo functionality will wrap an undo/redo action for this function.- Specified by:
- setPropertyAttrFlagin interface- IPropertyEditorController
 
 - setPropertyValue- public void setPropertyValue(PropCnr parent, GProp<?> property, java.lang.Object value) Sets a property value. The undo/redo functionality will wrap an undo/redo action for this function. This method handles setting a property value that is extended in the parent and the new property is to replace it in the parent.- Specified by:
- setPropertyValuein interface- IPropertyEditorController
 
 - doSave- public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor) Saves the contents if required.- Parameters:
- monitor- the progress monitor
 
 - addErrorComposite- public void addErrorComposite(org.eclipse.swt.widgets.Composite errorComposite) Adds an error composite for presentation of the errors. The layout is added to the composite. It is also assumed that the error composite has the GridData layout data.
 - onEvent- public void onEvent(GEvent event) Called to process an event.- Specified by:
- onEventin interface- EventListener
- Parameters:
- event- The event.