DefaultDataPaletteDriver Class
- public abstract class DefaultDataPaletteDriver
extends Object
implements IDataPaletteViewDriver
Default implementation of a data palette driver. Classes which extend this
class will need to implement the populate(IActionContainer)
method.
-
Hierarchy
-
Object
DefaultDataPaletteDriver
-
All Implemented Interfaces
-
IDataPaletteViewDriver
-
Direct Known Subclasses
-
ControlDataPaletteViewDriver
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_controlIcon
protected static final Icon
_controlIcon
- Default icon for controls
_res
protected static ResourceSvc.IResourcePkg
_res
- Localizable resources.
PROP_ControlInterface
public static final String
PROP_ControlInterface
- Property used on actions to specify a control interface
PROP_ControlLocator
public static final String
PROP_ControlLocator
- Property used on actions to specify the IControlLocator interface
DefaultDataPaletteDriver
public DefaultDataPaletteDriver()
canDelete(IAction) Method
public boolean canDelete(IAction
element)
Determines whether the specified action can be deleted from the
data palette. Typically called as a result of user interaction through
the data palette view.
Parameters
-
element
- the object that is being deleted.
Returns
- true if the object can be deleted.
createControlPopup(List) Method
protected JPopupMenu
createControlPopup(List
controls)
Constructs the popup menu for new control instances given a list
of controls. The list of controls may contain either instances of
IControlLocator objects or DefaultAction objects.
Returns
- A JPopupMenu instance representing the list of controls.
createMenuItem(Object) Method
protected JMenuItem
createMenuItem(Object
ctrl)
Create a JMenuItem instance from an instance of either an IControlLocator or
a DefaultAction. This method exists as a convenience for creating a popup menu
for data palette control items.
Parameters
-
ctrl
- the object instance to create the menu item from.
createMenuItem(DefaultAction) Method
protected JMenuItem
createMenuItem(DefaultAction
action)
Create a JMenuItem instance from an instance of a DefaultAction.
This method exists as a convenience for creating a popup menu
for data palette control items.
Parameters
-
action
- the object instance to create the menu item from.
delete(IAction) Method
public void delete(IAction
element)
Deletes the specified action and document elements
associated with it.
Parameters
-
element
- the object that is being deleted.
getContext() Method
public IDataPaletteViewDriver.IDataPaletteViewContext
getContext()
Get the view context for this driver. The view context allows driver
implementations to interact with the data palette view.
Related Topics
IDataPaletteViewDriver.IDataPaletteViewContext
getControlListPopupMenu() Method
protected JPopupMenu
getControlListPopupMenu()
Returns the data palette popup menu for the current project.
The popup menu contains items for all controls that can be
created for the project specified.
Returns
- The popup menu for the control list
getControlMenuActions() Method
protected List
getControlMenuActions()
Returns the list of ControlMenuActions that will populate
the popup menu.
Returns
- A list of DefaultAction instances, may be empty but
will not be null. The proxy object will have the standard property
values set on it (label, icon) in addition to the following, where appropriate:
PROP_ControlLocator - the control locator interface for this action.
PROP_ControlInterface - the interface name if this is a jcx control action.
getPopupMenu(IAction) Method
public JPopupMenu
getPopupMenu(IAction
el)
Requests the menu to display for this action on a
right click event.
Parameters
-
el
- the action to associate with the right click.
Returns
- JPopupMenu to display for the specified action,
null if none is available.
getPropertyInfo(IAction) Method
public List
getPropertyInfo(IAction
element)
Returns a list of IPropertyNodes, for display in the
property view upon selection of an item in the data palette.
Parameters
-
element
- the object that properties are being requested on.
Returns
- List of IPropertyNode. May not be null, may be empty.
populateControlContainer(IActionContainer) Method
protected IActionContainer
populateControlContainer(IActionContainer
palette)
Creates a container for available controls and adds a popup menu to the
container's new button.
Parameters
-
palette
- the root container that the control container will be nested in.
Returns
- the IActionContainer that was created.
populateControlContainer(IActionContainer, List) Method
protected IActionContainer
populateControlContainer(IActionContainer
palette,
List
controls)
Creates a container for available controls and adds a popup menu to the
container's new button.
Parameters
-
palette
- the root container that the control container will be nested in.
-
controls
- the collection of controls that will be placed in the popup menu, objects
in the list can be instances of IControlLocator or ControlAction.
Returns
- the IActionContainer that was created.
setContext(IDataPaletteViewDriver.IDataPaletteViewContext) Method
public void setContext(IDataPaletteViewDriver.IDataPaletteViewContext
context)
Set the view context for this driver. The view context allows driver
implementations to interact with the data palette view.
Related Topics
IDataPaletteViewDriver.IDataPaletteViewContext