com.sysord.mad.ui.swt.dialog
Class LayerDialog

java.lang.Object
  extended by org.eclipse.swt.widgets.Dialog
      extended by com.sysord.mad.ui.swt.dialog.LayerDialog

public class LayerDialog
extends org.eclipse.swt.widgets.Dialog

Dialog with a tree view of the MAD configuration layers.

Author:
Fabien Vignal

Field Summary
protected  com.sysord.mad.evaluator.FormatExpressionEvaluationService formatExprEvaluationService
          Format expression evaluation service.
protected  org.eclipse.jface.viewers.TreeViewer viewer
           
 
Constructor Summary
LayerDialog(org.eclipse.swt.widgets.Shell parent, com.sysord.mad.core.preferences.MADProjectPreferenceProvider projectPreferenceProvider)
          Create a new LayerDialog with its parent Shell.
 
Method Summary
protected  void closing()
          Called when this dialog is closing.
protected  void createDialogControl(org.eclipse.swt.widgets.Shell parent)
          Create the dialog widgets.
protected  void deselect(org.eclipse.jface.viewers.TreeNode selectedNode, org.eclipse.swt.widgets.TreeItem selectedItem, java.util.List<com.sysord.mad.configuration.Layer> selectedLayers)
          Deselect the given selected node and its children.
protected  org.eclipse.jface.viewers.ITreeContentProvider getContentProvider()
          Returns an ITreeContentProvider used by the tree viewer of this dialog.
protected  com.sysord.mad.evaluator.FormatExpressionEvaluationService getFormatExprEvaluationService()
          retrieves and returns the FormatExpressionEvaluationService using injector
protected  org.eclipse.jface.viewers.IStructuredSelection getInitialSelection()
          Returns the initial selection.
protected  java.lang.Object getInput()
          Returns the input for the tree viewer of this dialog.
protected  org.eclipse.jface.viewers.ILabelProvider getLabelProvider()
          Returns the label provider for the tree viewer of this dialog.
protected  org.eclipse.swt.events.SelectionListener getSelectionListener()
          Creates a SelectionListener for the TreeViewer.
 org.eclipse.jface.viewers.TreeViewer getViewer()
           
 java.lang.Object open()
          Open this dialog.
 void refresh()
          Reload the layers configurations and clear the selection.
protected  void select(org.eclipse.jface.viewers.TreeNode selectedNode, org.eclipse.swt.widgets.TreeItem selectedItem, java.util.List<com.sysord.mad.configuration.Layer> selectedLayers)
          Select the given selected node and its children.
 
Methods inherited from class org.eclipse.swt.widgets.Dialog
checkSubclass, getParent, getStyle, getText, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewer

protected org.eclipse.jface.viewers.TreeViewer viewer

formatExprEvaluationService

protected com.sysord.mad.evaluator.FormatExpressionEvaluationService formatExprEvaluationService
Format expression evaluation service.

Constructor Detail

LayerDialog

public LayerDialog(org.eclipse.swt.widgets.Shell parent,
                   com.sysord.mad.core.preferences.MADProjectPreferenceProvider projectPreferenceProvider)
Create a new LayerDialog with its parent Shell.

Parameters:
parent - A Shell which will be the parent of this dialog.
projectPreferenceProvider - Preference provider for the current project.
Throws:
java.lang.IllegalArgumentException -
  • ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException -
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
Method Detail

refresh

public void refresh()
Reload the layers configurations and clear the selection.


open

public java.lang.Object open()
Open this dialog.

Returns:

closing

protected void closing()
Called when this dialog is closing.


createDialogControl

protected void createDialogControl(org.eclipse.swt.widgets.Shell parent)
Create the dialog widgets.

Parameters:
shell -

getViewer

public org.eclipse.jface.viewers.TreeViewer getViewer()

getSelectionListener

protected org.eclipse.swt.events.SelectionListener getSelectionListener()
Creates a SelectionListener for the TreeViewer.

Returns:
the created listener.

getInitialSelection

protected org.eclipse.jface.viewers.IStructuredSelection getInitialSelection()
Returns the initial selection.

Returns:
the initial selection.

getContentProvider

protected org.eclipse.jface.viewers.ITreeContentProvider getContentProvider()
Returns an ITreeContentProvider used by the tree viewer of this dialog.

By default, a TreeNodeContentProvider.

Returns:
an ITreeContentProvider used by the tree viewer of this dialog.

getInput

protected java.lang.Object getInput()
Returns the input for the tree viewer of this dialog.

By default, the viewer uses a TreeNodeContentProvider so this method should return a TreeNode.
Subclass the getContentProvider method for changing the content provider type and using an other type of input.

Returns:
the input for the tree viewer of this dialog.

getLabelProvider

protected org.eclipse.jface.viewers.ILabelProvider getLabelProvider()
Returns the label provider for the tree viewer of this dialog.

Returns:
the label provider for the tree viewer of this dialog.

select

protected void select(org.eclipse.jface.viewers.TreeNode selectedNode,
                      org.eclipse.swt.widgets.TreeItem selectedItem,
                      java.util.List<com.sysord.mad.configuration.Layer> selectedLayers)
Select the given selected node and its children.

Parameters:
selectedNode -
selectedItem -
selectedLayers -

deselect

protected void deselect(org.eclipse.jface.viewers.TreeNode selectedNode,
                        org.eclipse.swt.widgets.TreeItem selectedItem,
                        java.util.List<com.sysord.mad.configuration.Layer> selectedLayers)
Deselect the given selected node and its children.

Parameters:
selectedNode -
selectedItem -
selectedLayers -

getFormatExprEvaluationService

protected com.sysord.mad.evaluator.FormatExpressionEvaluationService getFormatExprEvaluationService()
retrieves and returns the FormatExpressionEvaluationService using injector

Returns: