Class ServerConfigComposite

All Implemented Interfaces:
IDraggingFix, IPropertyEditorController, IServerConfigFileListener, EventListener, IDisposedPart, IPropUndoRedo, ISelectionChangedListener, Drawable

The Server Configuration composite displays a tree with the server configuration and a property editor for the properties.
Author:
Christopher Mindus
  • Constructor Details Link icon

    • ServerConfigComposite Link icon

      public ServerConfigComposite(IWorkbenchPart part, Composite parent, IMemento restoreMemento, 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 Details Link icon

    • dispose Link icon

      public void dispose()
      Disposes of this composite.
      Overrides:
      dispose in class Widget
    • getServerConfigFile Link icon

      public ServerConfigFile getServerConfigFile()
      Gets the Server Configuration file instance.
      Returns:
      The current configuration file, or null for none.
    • getSettings Link icon

      public EditorServerSettings getSettings()
      Gets the settings.
      Returns:
      The current Server settings, or null for none.
    • setServerConfigFile Link icon

      public void setServerConfigFile(ServerConfigFile config, Exception loadException)
      Sets or clears the Server configuration file to edit.
      Parameters:
      config - The configuration, or null for none (loadException may indicate the error).
      loadException - The load exception that occurred, null when config is non-null.
    • onServerConfigFileUpdated Link icon

      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:
      onServerConfigFileUpdated in interface IServerConfigFileListener
      Parameters:
      serverConfigFile - The configuration file that was updated, changed or verified.
    • isDirty Link icon

      public boolean isDirty()
      Gets the dirty state.
      Returns:
      true if file needs saving, false if not dirty.
    • saveState Link icon

      public void saveState(IMemento memento)
      Saves the state.
    • createControls Link icon

      public void createControls()
      Creates the view part.
    • updateStates Link icon

      public void updateStates()
      Updates the states of menu items and tool bars.
      Specified by:
      updateStates in interface IPropUndoRedo
    • selectionChanged Link icon

      public void selectionChanged(SelectionChangedEvent event)
      Notifies that the selection has changed.
      Specified by:
      selectionChanged in interface ISelectionChangedListener
      Parameters:
      event - event object describing the change
    • getSelectionEnabler Link icon

      public SelectionEnabler getSelectionEnabler()
      Gets the selection enabler instance.
    • getUndoContext Link icon

      public Object getUndoContext()
      Gets the undo context.
      Specified by:
      getUndoContext in interface IPropertyEditorController
      Specified by:
      getUndoContext in interface IPropUndoRedo
      Returns:
      An object castable to org.eclipse.core.commands.operations.IUndoContext.
    • setTargetViewer Link icon

      public void setTargetViewer(Object viewer)
      Sets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
      Specified by:
      setTargetViewer in interface IPropUndoRedo
      Parameters:
      viewer - The CommonViewer, TreeViewer or TableViewer, or null for none.
    • getUndoRedo Link icon

      public IPropUndoRedo getUndoRedo()
      Gets the undo/redo instance.
      Specified by:
      getUndoRedo in interface IPropertyEditorController
    • onDragBegin Link icon

      protected void onDragBegin()
      Drag started.
    • onDragEnd Link icon

      protected void onDragEnd()
      Drag finished.
    • isDragging Link icon

      public boolean isDragging()
      Flag for dragging to postpone selection events until drag completes.
      Specified by:
      isDragging in interface IDraggingFix
    • getModuleModel Link icon

      public ModuleModel getModuleModel()
      Gets the ModuleModel instance of the project.
      Specified by:
      getModuleModel in interface IPropertyEditorController
    • getMultiSelectionProvider Link icon

      public MultiSelectionProvider getMultiSelectionProvider()
      Gets the multi-property selection provider.
      Specified by:
      getMultiSelectionProvider in interface IPropertyEditorController
    • getTargetViewer Link icon

      public Object getTargetViewer()
      Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
      Specified by:
      getTargetViewer in interface IPropUndoRedo
      Returns:
      The CommonViewer, TreeViewer or TableViewer, or null for none.
    • setBlockViewerFocus Link icon

      public void setBlockViewerFocus(boolean block)
      Blocks the target viewer from focus.
      Specified by:
      setBlockViewerFocus in interface IPropertyEditorController
    • setPropertyError Link icon

      public void setPropertyError(GProp<?> property, String errorID, IPropErrorItem item)
      Sets a property error. The undo/redo functionality will wrap an undo/redo action for this function.
      Specified by:
      setPropertyError in interface IPropertyEditorController
    • removePropertyValue Link icon

      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:
      removePropertyValue in interface IPropertyEditorController
    • setPropertyAttrFlag Link icon

      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:
      setPropertyAttrFlag in interface IPropertyEditorController
    • setPropertyValue Link icon

      public void setPropertyValue(PropCnr parent, GProp<?> property, 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:
      setPropertyValue in interface IPropertyEditorController
    • doSave Link icon

      public void doSave(IProgressMonitor monitor)
      Saves the contents if required.
      Parameters:
      monitor - the progress monitor
    • addErrorComposite Link icon

      public void addErrorComposite(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 Link icon

      public void onEvent(GEvent event)
      Called to process an event.
      Specified by:
      onEvent in interface EventListener
      Parameters:
      event - The event.