org.formaria.editor.netbeans.project.pages
Class StylePalette

java.lang.Object
  extended by TopComponent
      extended by org.formaria.editor.netbeans.project.pages.StylePalette
All Implemented Interfaces:
ComponentSelectListener, IStylePalette, StyleListener

public class StylePalette
extends TopComponent
implements ComponentSelectListener, StyleListener, IStylePalette

A TopComponent wrapper for the style editor

Copyright (c) Formaria Ltd., 1998-2008

License: see license.txt


Method Summary
 void addStyleListener(StyleListener l)
          Set a listener for style changes
 java.util.List availableModes(java.util.List modes)
           
 boolean canClose()
           
 void dispose()
           
static StylePalette getDefault()
           
 int getPersistenceType()
           
 java.lang.String preferredID()
           
 java.lang.Object readResolve()
          Resolve to singleton instance
 void setFocus()
           
 void setSelectedComponents(IPagePanel currentPagePanel, java.util.Vector selectedComponents, boolean contentsChanged)
          Called when a component has been selected
 void styleChanged(java.lang.String styleName, Style newStyle)
          Called when a style is changed.
 void update()
          Force the editor to refresh itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefault

public static StylePalette getDefault()

availableModes

public java.util.List availableModes(java.util.List modes)

canClose

public boolean canClose()

readResolve

public java.lang.Object readResolve()
                             throws java.io.ObjectStreamException
Resolve to singleton instance

Throws:
java.io.ObjectStreamException

preferredID

public java.lang.String preferredID()

getPersistenceType

public int getPersistenceType()

setSelectedComponents

public void setSelectedComponents(IPagePanel currentPagePanel,
                                  java.util.Vector selectedComponents,
                                  boolean contentsChanged)
Called when a component has been selected

Specified by:
setSelectedComponents in interface ComponentSelectListener
Specified by:
setSelectedComponents in interface IStylePalette
Parameters:
selectedComponents -

addStyleListener

public void addStyleListener(StyleListener l)
Set a listener for style changes

Specified by:
addStyleListener in interface IStylePalette
Parameters:
listener - the new listener

styleChanged

public void styleChanged(java.lang.String styleName,
                         Style newStyle)
Called when a style is changed. This allows the editor to reset the components visually.

Specified by:
styleChanged in interface IStylePalette
Specified by:
styleChanged in interface StyleListener
Parameters:
styleName - the name of the style which has been changed
newStyle - The new Style

update

public void update()
Force the editor to refresh itself.

Specified by:
update in interface IStylePalette

setFocus

public void setFocus()
Specified by:
setFocus in interface IStylePalette

dispose

public void dispose()
Specified by:
dispose in interface IStylePalette