net.refractions.udig.style.sld.editor
Class StyleEditorDialog

java.lang.Object
  extended by FilteredEditorDialog
      extended by net.refractions.udig.style.sld.editor.StyleEditorDialog
All Implemented Interfaces:
IEditorPageContainer, IStyleEditorPageContainer

public class StyleEditorDialog
extends FilteredEditorDialog
implements IStyleEditorPageContainer

Prefence dialog for the workbench including the ability to load/save preferences.


Field Summary
static int APPLY_ID
           
static int CLOSE_ID
           
static int EXPORT_ID
           
static int IMPORT_ID
           
static int REVERT_ID
           
 
Constructor Summary
StyleEditorDialog(Shell parentShell, EditorPageManager manager)
          Creates a new dialog under the control of the given manager manager.
 
Method Summary
 void addListener(GTListener listener)
           
 boolean close()
           
protected  Button createButton(Composite parent, int id, java.lang.String label, boolean defaultButton)
           
protected  Control createButtonBar(Composite parent)
           
protected  void createButtonsForButtonBar(Composite parent)
           
static StyleEditorDialog createDialogOn(Shell shell, java.lang.String pageId, Layer selectedLayer, EditorPageManager manager)
          Creates an style editor dialog open to a particular page.
 IAction getApplyAction()
          Action for applying the current changes.
 ProgressListener getProgressListener()
           
 StyleLayer getSelectedLayer()
           
 StyledLayerDescriptor getSLD()
           
 Style getStyle()
           
 void removeListener(GTListener listener)
           
 void setCancelMode(boolean showCancel)
           
 void setExitButtonState(boolean dirty)
           
 void setSelectedLayer(Layer layer)
           
 void setStyle(Style newStyle)
           
 boolean showPage(IEditorNode node)
           
 void updateButtons()
          Adjusts the enable state of the OK button to reflect the state of the currently active page in this container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.style.sld.IEditorPageContainer
updateMessage, updateTitle
 

Field Detail

IMPORT_ID

public static final int IMPORT_ID
See Also:
Constant Field Values

EXPORT_ID

public static final int EXPORT_ID
See Also:
Constant Field Values

APPLY_ID

public static final int APPLY_ID
See Also:
Constant Field Values

REVERT_ID

public static final int REVERT_ID
See Also:
Constant Field Values

CLOSE_ID

public static final int CLOSE_ID
See Also:
Constant Field Values
Constructor Detail

StyleEditorDialog

public StyleEditorDialog(Shell parentShell,
                         EditorPageManager manager)
Creates a new dialog under the control of the given manager manager.

Parameters:
parentShell - the parent shell
manager - the preference manager
Method Detail

getProgressListener

public ProgressListener getProgressListener()

setCancelMode

public void setCancelMode(boolean showCancel)

createDialogOn

public static final StyleEditorDialog createDialogOn(Shell shell,
                                                     java.lang.String pageId,
                                                     Layer selectedLayer,
                                                     EditorPageManager manager)
Creates an style editor dialog open to a particular page. It is the responsibility of the caller to then call open(). The call to open() will not return until the dialog closes, so this is the last chance to manipulate the dialog.

Parameters:
shell - The Shell to parent the dialog off of if it is not already created. May be null in which case the active workbench window will be used if available.
pageId - The identifier of the page to open; may be null.
Returns:
The dialog

close

public boolean close()

setSelectedLayer

public void setSelectedLayer(Layer layer)

getSelectedLayer

public StyleLayer getSelectedLayer()
Specified by:
getSelectedLayer in interface IStyleEditorPageContainer

getStyle

public Style getStyle()
Specified by:
getStyle in interface IStyleEditorPageContainer

setStyle

public void setStyle(Style newStyle)
Specified by:
setStyle in interface IStyleEditorPageContainer

getSLD

public StyledLayerDescriptor getSLD()
Specified by:
getSLD in interface IStyleEditorPageContainer

showPage

public boolean showPage(IEditorNode node)

createButton

protected Button createButton(Composite parent,
                              int id,
                              java.lang.String label,
                              boolean defaultButton)

createButtonBar

protected Control createButtonBar(Composite parent)

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)

updateButtons

public void updateButtons()
Description copied from interface: IEditorPageContainer
Adjusts the enable state of the OK button to reflect the state of the currently active page in this container.

This method is called by the container itself when its preference page changes and may be called by the page at other times to force a button state update.

Specified by:
updateButtons in interface IEditorPageContainer

setExitButtonState

public void setExitButtonState(boolean dirty)
Specified by:
setExitButtonState in interface IStyleEditorPageContainer

getApplyAction

public IAction getApplyAction()
Description copied from interface: IStyleEditorPageContainer
Action for applying the current changes. Can be used to enable or disable the button. Also to execute the action.

Specified by:
getApplyAction in interface IStyleEditorPageContainer
Returns:
apply action

addListener

public void addListener(GTListener listener)

removeListener

public void removeListener(GTListener listener)