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

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


Field Summary
static int APPLY_ID
           
static int CANCEL_ID
           
static int DEFAULTS_ID
           
static int EXPORT_ID
           
static int IMPORT_ID
           
static int OK_ID
           
static int REVERT_ID
           
 
Constructor Summary
protected StyleEditorDialog(Shell parentShell, EditorPageManager manager)
          Creates a new dialog under the control of the given manager manager.
 
Method Summary
protected  Control createButtonBar(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()
          Get the action used to apply changes.
 ProgressListener getProgressListener()
           
 StyleLayer getSelectedLayer()
          StyleLayer wraps around the origional layer and has a copy of the StyleBlackboard for you to work on.
 StyledLayerDescriptor getSLD()
          Retrieve the root StyleLayerDescriptor for editing.
 Style getStyle()
          Retrieve the Style being worked on.
 void setExitButtonState()
          Used to enable the Apply button.
 void setSelectedLayer(Layer layer)
           
protected  void setShellStyle(int newShellStyle)
           
 void setStyle(Style newStyle)
          Replace the style being worked on, this can be called by a StylePage that is *completely* generating its own thing.
 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

DEFAULTS_ID

public static final int DEFAULTS_ID
See Also:
Constant Field Values

OK_ID

public static final int OK_ID
See Also:
Constant Field Values

CANCEL_ID

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

StyleEditorDialog

protected 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()

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

setShellStyle

protected void setShellStyle(int newShellStyle)

setSelectedLayer

public void setSelectedLayer(Layer layer)

getSelectedLayer

public StyleLayer getSelectedLayer()
Description copied from interface: IStyleEditorPageContainer
StyleLayer wraps around the origional layer and has a copy of the StyleBlackboard for you to work on.

StyleLayer has apply and revert actions for interacting with the actual Map.

Specified by:
getSelectedLayer in interface IStyleEditorPageContainer
Returns:
StyleLayer for interacting with the actual Map

getStyle

public Style getStyle()
Description copied from interface: IStyleEditorPageContainer
Retrieve the Style being worked on.

In general a StylePage will modify the style in place.

Specified by:
getStyle in interface IStyleEditorPageContainer
Returns:
Style being worked on (often a layer will only be using one)

setStyle

public void setStyle(Style newStyle)
Description copied from interface: IStyleEditorPageContainer
Replace the style being worked on, this can be called by a StylePage that is *completely* generating its own thing.

Specified by:
setStyle in interface IStyleEditorPageContainer

getSLD

public StyledLayerDescriptor getSLD()
Description copied from interface: IStyleEditorPageContainer
Retrieve the root StyleLayerDescriptor for editing.

Specified by:
getSLD in interface IStyleEditorPageContainer
Returns:

showPage

public boolean showPage(IEditorNode node)

createButtonBar

protected Control createButtonBar(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()
Used to enable the Apply button.

Specified by:
setExitButtonState in interface IStyleEditorPageContainer

getApplyAction

public IAction getApplyAction()
Get the action used to apply changes.

Specified by:
getApplyAction in interface IStyleEditorPageContainer
Returns:
apply action