Class DefaultPaletteItemGroup
- java.lang.Object
-
- javax.swing.AbstractListModel
-
- com.inductiveautomation.factorypmi.designer.palette.model.DefaultPaletteItemGroup
-
- All Implemented Interfaces:
PaletteItemGroup
,java.io.Serializable
,javax.swing.ListModel
- Direct Known Subclasses:
CustomPaletteItemGroup
public class DefaultPaletteItemGroup extends javax.swing.AbstractListModel implements PaletteItemGroup
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.beans.PropertyChangeSupport
changeSupport
protected boolean
enabled
protected javax.swing.Icon
icon
protected java.beans.PropertyChangeListener
itemListener
protected java.util.List<PaletteItem>
items
protected java.lang.String
name
-
Constructor Summary
Constructors Constructor Description DefaultPaletteItemGroup(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPaletteItem(PaletteItem item)
Adds a new palette item into the groupvoid
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
java.lang.Object
getElementAt(int index)
javax.swing.Icon
getIcon()
Get the icon for this palette item group.java.lang.String
getName()
Returns the name of this palette item groupPaletteItem
getPaletteItem(int index)
Return the palette item contained at positionindex
int
getSize()
void
insertPaletteItem(int index, PaletteItem item)
Inserts the item at the given position, moving what is currently at that position to the rightboolean
isEnabled()
boolean
isMutable()
Default implementation returns false.protected void
itemUpdated(PaletteItem item)
void
removePaletteItem(PaletteItem item)
Removes the palette item at the given index.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
void
setEnabled(boolean enabled)
void
setIcon(javax.swing.Icon icon)
void
setName(java.lang.String name)
Sets the name of this palette item groupvoid
setPaletteItem(int index, PaletteItem item)
Sets the palette item at the index.java.lang.String
toString()
-
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
-
-
-
Field Detail
-
changeSupport
protected java.beans.PropertyChangeSupport changeSupport
-
name
protected java.lang.String name
-
items
protected java.util.List<PaletteItem> items
-
enabled
protected boolean enabled
-
icon
protected javax.swing.Icon icon
-
itemListener
protected java.beans.PropertyChangeListener itemListener
-
-
Method Detail
-
getElementAt
public java.lang.Object getElementAt(int index)
- Specified by:
getElementAt
in interfacejavax.swing.ListModel
-
getSize
public int getSize()
- Specified by:
getSize
in interfacejavax.swing.ListModel
-
getName
public java.lang.String getName()
Description copied from interface:PaletteItemGroup
Returns the name of this palette item group- Specified by:
getName
in interfacePaletteItemGroup
-
addPaletteItem
public void addPaletteItem(PaletteItem item)
Description copied from interface:PaletteItemGroup
Adds a new palette item into the group- Specified by:
addPaletteItem
in interfacePaletteItemGroup
-
setPaletteItem
public void setPaletteItem(int index, PaletteItem item)
Description copied from interface:PaletteItemGroup
Sets the palette item at the index. (Overwrites the item, not insert)- Specified by:
setPaletteItem
in interfacePaletteItemGroup
-
insertPaletteItem
public void insertPaletteItem(int index, PaletteItem item)
Description copied from interface:PaletteItemGroup
Inserts the item at the given position, moving what is currently at that position to the right- Specified by:
insertPaletteItem
in interfacePaletteItemGroup
-
getPaletteItem
public PaletteItem getPaletteItem(int index)
Description copied from interface:PaletteItemGroup
Return the palette item contained at positionindex
- Specified by:
getPaletteItem
in interfacePaletteItemGroup
-
removePaletteItem
public void removePaletteItem(PaletteItem item)
Description copied from interface:PaletteItemGroup
Removes the palette item at the given index.- Specified by:
removePaletteItem
in interfacePaletteItemGroup
-
itemUpdated
protected void itemUpdated(PaletteItem item)
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfacePaletteItemGroup
-
isMutable
public boolean isMutable()
Default implementation returns false.- Specified by:
isMutable
in interfacePaletteItemGroup
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled
in interfacePaletteItemGroup
-
setName
public void setName(java.lang.String name)
Description copied from interface:PaletteItemGroup
Sets the name of this palette item group- Specified by:
setName
in interfacePaletteItemGroup
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfacePaletteItemGroup
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfacePaletteItemGroup
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfacePaletteItemGroup
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfacePaletteItemGroup
-
getIcon
public javax.swing.Icon getIcon()
Description copied from interface:PaletteItemGroup
Get the icon for this palette item group. null is allowed.- Specified by:
getIcon
in interfacePaletteItemGroup
-
setIcon
public void setIcon(javax.swing.Icon icon)
-
-