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

java.lang.Object
  extended by TopComponent
      extended by org.formaria.editor.netbeans.project.pages.ComponentPalette
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, ComponentSelectListener, EditorComponentListener, IComponentPalette

public class ComponentPalette
extends TopComponent
implements java.awt.event.ActionListener, ComponentSelectListener, EditorComponentListener, IComponentPalette


Field Summary
protected  EditorProject currentProject
          The owner project and the context in which this object operates.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 javax.swing.JToggleButton addToggleTool(javax.swing.ButtonGroup bg, javax.swing.JToolBar targetPanel, EditorComponentAdapter eca)
          Add an toggle button to the toolbar.
 javax.swing.JToggleButton addToggleTool(javax.swing.ButtonGroup bg, javax.swing.JToolBar targetPanel, java.lang.String imageName, java.lang.String tooltipText)
          Add an toggle button to the toolbar.
 void addToolbarListener(ToolbarSelectionListener l)
           
 java.util.List availableModes(java.util.List modes)
           
 boolean canClose()
           
 void componentAdded()
           
static ComponentPalette getDefault()
           
 int getPersistenceType()
           
 java.lang.String preferredID()
           
 java.lang.Object readResolve()
          Resolve to singleton instance
 void refresh()
          Refresh the list of components registered via extra component factories.
 void setBounds(int x, int y, int w, int h)
           
 void setNewComponent(java.awt.Component c)
           
 void setPageDesigner(PageDesigner pd)
           
 void setSelectedComponents(IPagePanel currentPagePanel, java.util.Vector selectedComponents, boolean contentsChanged)
          Called when a component has been selected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentProject

protected EditorProject currentProject
The owner project and the context in which this object operates.

Method Detail

getDefault

public static ComponentPalette getDefault()

availableModes

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

canClose

public boolean canClose()

refresh

public void refresh()
Refresh the list of components registered via extra component factories.

Specified by:
refresh in interface IComponentPalette

addToggleTool

public javax.swing.JToggleButton addToggleTool(javax.swing.ButtonGroup bg,
                                               javax.swing.JToolBar targetPanel,
                                               java.lang.String imageName,
                                               java.lang.String tooltipText)
Add an toggle button to the toolbar.

Parameters:
bg - the buttton group to which the new button belongs
targetPanel - the tab panel to which the new tool is added
imageName - the name of the image resource
compId - the ID of the component type
tooltipText - the text of the tooltip
Returns:
the new image component

addToggleTool

public javax.swing.JToggleButton addToggleTool(javax.swing.ButtonGroup bg,
                                               javax.swing.JToolBar targetPanel,
                                               EditorComponentAdapter eca)
Add an toggle button to the toolbar.

Parameters:
bg - the buttton group to which the new button belongs
targetPanel - the tab panel to which the new tool is added
imageName - the name of the image resource
compId - the ID of the component type
tooltipText - the text of the tooltip
Returns:
the new image component

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)

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
Parameters:
selectedComponents -

componentAdded

public void componentAdded()
Specified by:
componentAdded in interface EditorComponentListener

setNewComponent

public void setNewComponent(java.awt.Component c)
Specified by:
setNewComponent in interface EditorComponentListener

addToolbarListener

public void addToolbarListener(ToolbarSelectionListener l)
Specified by:
addToolbarListener in interface IComponentPalette

setPageDesigner

public void setPageDesigner(PageDesigner pd)
Specified by:
setPageDesigner in interface IComponentPalette