Class PaletteImpl
java.lang.Object
javax.swing.AbstractListModel
com.inductiveautomation.factorypmi.designer.palette.model.PaletteImpl
- All Implemented Interfaces:
ProjectResourceListener
,Palette
,Serializable
,ListModel
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Implementation copied (and simplified) from DefaultSingleSelectionModel and modified to handle objects, not ints. -
Field Summary
FieldsFields inherited from class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuxiliaryAction
(Action action) An action that may be added to the palette.void
addGroup
(PaletteItemGroup group) Adds a plugin palette tabvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
Clears the selection so that nothing is pending a drop.Retrieves a list of custom palette item groupsgetElementAt
(int index) Returns thePaletteItemGroup
at the given locationReturns the PaletteItemGroup with the given name, or null if no such group existsgetGroupAt
(int index) com.inductiveautomation.factorypmi.designer.palette.model.PaletteImpl.PaletteHandler
Get theResourceFilter
used to filter resources this listener cares about.Get the selected, or "hot" item that is waiting to be dropped.int
getSize()
The number of palette item groups.protected void
Loads the static components from palette.xmlboolean
Returns true if an item is selected.void
removeGroup
(PaletteItemGroup group) void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
rename
(PaletteItemGroup paletteItemGroup, String newName) void
resourcesCreated
(String projectName, List<ChangeOperation.CreateResourceOperation> resources) void
resourcesDeleted
(String projectName, List<ChangeOperation.DeleteResourceOperation> signatures) void
resourcesModified
(String projectName, List<ChangeOperation.ModifyResourceOperation> resources) void
sanitizeName
(PaletteItemGroup group) void
setEnabled
(boolean b) Enables/disables all palette item groups en-masse.toString()
void
update
(List<ProjectResource> changed) Updates the custom palettes as according to the given diffMethods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.common.project.ProjectResourceListener
manifestChanged, onAfterChanges, onBeforeChanges
-
Field Details
-
PALETTE_RESOURCE_TYPE
-
PALETTEITEM_DATAFLAVOR
-
-
Constructor Details
-
PaletteImpl
- Throws:
SerializationException
-
-
Method Details
-
initializeStaticPaletteGroups
protected void initializeStaticPaletteGroups()Loads the static components from palette.xml -
addAuxiliaryAction
Description copied from interface:Palette
An action that may be added to the palette. Only supported by the collapsible palette- Specified by:
addAuxiliaryAction
in interfacePalette
-
getAuxiliaryActions
-
getElementAt
Returns thePaletteItemGroup
at the given location- Specified by:
getElementAt
in interfaceListModel
-
getSize
public int getSize()The number of palette item groups. -
isItemSelected
public boolean isItemSelected()Returns true if an item is selected. This means that the item is "hot" - waiting to be dropped onto a window. -
getSelectedItem
Get the selected, or "hot" item that is waiting to be dropped. -
clearSelection
public void clearSelection()Clears the selection so that nothing is pending a drop.- Specified by:
clearSelection
in interfacePalette
-
setEnabled
public void setEnabled(boolean b) Enables/disables all palette item groups en-masse. -
getGroup
Description copied from interface:Palette
Returns the PaletteItemGroup with the given name, or null if no such group exists -
getGroupAt
-
addGroup
Description copied from interface:Palette
Adds a plugin palette tab -
addGroup
-
sanitizeName
-
getCustomPalettes
Retrieves a list of custom palette item groups -
removeGroup
-
rename
-
getResourceFilter
Description copied from interface:ProjectResourceListener
Get theResourceFilter
used to filter resources this listener cares about. Default is to care about all resources.- Specified by:
getResourceFilter
in interfaceProjectResourceListener
- Returns:
- the
ResourceFilter
used to filter resources this listener cares about.
-
resourcesDeleted
public void resourcesDeleted(String projectName, List<ChangeOperation.DeleteResourceOperation> signatures) - Specified by:
resourcesDeleted
in interfaceProjectResourceListener
-
resourcesCreated
public void resourcesCreated(String projectName, List<ChangeOperation.CreateResourceOperation> resources) - Specified by:
resourcesCreated
in interfaceProjectResourceListener
-
resourcesModified
public void resourcesModified(String projectName, List<ChangeOperation.ModifyResourceOperation> resources) - Specified by:
resourcesModified
in interfaceProjectResourceListener
-
update
Updates the custom palettes as according to the given diff -
toString
-
getSelectionModel
-
getImportExportHandler
public com.inductiveautomation.factorypmi.designer.palette.model.PaletteImpl.PaletteHandler getImportExportHandler() -
addPropertyChangeListener
-
removePropertyChangeListener
-