net.refractions.udig.style.ui
Class StyleView

java.lang.Object
  extended by ViewPart
      extended by net.refractions.udig.style.ui.StyleView

public class StyleView
extends ViewPart

Style Editing View.

StyleView is responsible for allowing the user to choose between applicable StyleConfigurators for the current blackboard.

What does this mean?

TODO: Clone the blackboard and give that to the configurator

Since:
0.5
Author:
jdeolive

Field Summary
static java.lang.String VIEW_ID
          ID used in the extention point to identify this view
 
Constructor Summary
StyleView()
          Construct StyleView.
 
Method Summary
 void createPartControl(Composite parent)
          Creates the style editor layout, and uses a PageBook placeholder for ui widgets to be placed into as Styles are selected.
 void dispose()
          Note: createPartControl may not even of been called
 Layer getCurrentLayer()
           
 IStyleConfigurator getStyleConfigurator()
          This *is* the current styleConfigurator used by this style view.
 java.util.Set<IStyleConfigurator> getStyleConfigurators()
          Acquire configurators for the current layer.
 void init(IViewSite site, IMemento memento)
          Called before createPartControl to give us chance to organize ourselves.
 void refresh()
          Refresh all the viewsites, aka force stylecon figurators to reset.
 void setCurrentLayer(Layer layer)
          New layer, or null if there is no selected layer.
 void setFocus()
          Set focus to the chooser if available.
 void setStyleConfigurator(IStyleConfigurator config)
          Set the current StyleConfigurator used by this StyleView to the provided config.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_ID

public static final java.lang.String VIEW_ID
ID used in the extention point to identify this view

See Also:
Constant Field Values
Constructor Detail

StyleView

public StyleView()
Construct StyleView.

Note since we are a view - nothing much happens here.

Method Detail

init

public void init(IViewSite site,
                 IMemento memento)
          throws PartInitException
Called before createPartControl to give us chance to organize ourselves.

We used this to latch onto the defined StyleConfigurators.

Throws:
PartInitException
See Also:
org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)

createPartControl

public void createPartControl(Composite parent)
Creates the style editor layout, and uses a PageBook placeholder for ui widgets to be placed into as Styles are selected.

Parameters:
parent -
See Also:
org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)

setCurrentLayer

public void setCurrentLayer(Layer layer)
New layer, or null if there is no selected layer.


getCurrentLayer

public Layer getCurrentLayer()

getStyleConfigurators

public java.util.Set<IStyleConfigurator> getStyleConfigurators()
Acquire configurators for the current layer.

This means you should *not* assume these IStyleConfigurators are totally happy and ready to work. They will only listen to events when they are the current page for example.

Returns:
Set of configurators for the current layer, may be empty

setFocus

public void setFocus()
Set focus to the chooser if available.

TODO: Should set the focus to the current StyleView being displayed.


setStyleConfigurator

public void setStyleConfigurator(IStyleConfigurator config)
Set the current StyleConfigurator used by this StyleView to the provided config.

Note if there is only one chooser, we should set the focus to the styleConfigurator.

Responsibilities:

Parameters:
config - IStyleConfigurator to be displayed by StyleView
See Also:
org.eclipse.ui.IWorkbenchPart#setFocus()

getStyleConfigurator

public IStyleConfigurator getStyleConfigurator()
This *is* the current styleConfigurator used by this style view.

The following controls need to be kept in sync:

Returns:
IStyleConfigurator currently being displayed

refresh

public void refresh()
Refresh all the viewsites, aka force stylecon figurators to reset.


dispose

public void dispose()
Note: createPartControl may not even of been called

See Also:
org.eclipse.ui.part.WorkbenchPart#dispose()