public abstract class AbstractConfigurationTree extends java.lang.Object implements IConfigurationTree
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MENU_ITEM_DATA_TREE |
protected TreeItem |
rootItem |
Constructor and Description |
---|
AbstractConfigurationTree(Composite parent,
int style,
SelectionListener listener)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addAllRenderConfigs()
Reads all render configurations and adds them to the tree's root item.
|
TreeItem |
addItem(OldRenderConfiguration renderConfig)
Creates a new
TreeItem displaying the given
RenderConfiguration and returns it. |
void |
expandFullTree()
Expands the full tree down to the leaves.
|
protected Menu |
generatePopupMenu(Shell shell,
SelectionListener listener)
Generates the common popup menu items:
New
Duplicate
Delete
|
TreeItem |
getItemByRenderConfiguration(OldRenderConfiguration renderConfig)
Gets the
TreeItem displaying the given RenderConfiguration . |
TreeItem |
getSelectedItem()
Gets the selected item.
|
boolean |
hasSelection() |
abstract boolean |
isTemplateTree() |
void |
reload()
Reloads the full tree content.
|
void |
removeItem(TreeItem item)
Removes a specific
TreeItem . |
void |
selectItem(OldRenderConfiguration renderConfig)
Selects the
TreeItem displaying the given
RenderConfiguration . |
void |
setItemColor(TreeItem item,
boolean isValid)
Sets the
TreeItem forground text color.If isValid is true black will
be used, otherwise red. |
void |
setPopupMenuConfigEnabled(boolean enabled)
Enables or disables menu entries depending on the selection state.
|
protected abstract void |
setTreeItemIcon(TreeItem treeItem)
Called to set an image icon to the
TreeItem . |
public static final java.lang.String MENU_ITEM_DATA_TREE
protected TreeItem rootItem
public AbstractConfigurationTree(Composite parent, int style, SelectionListener listener)
parent
- The parent Composite
.style
- The widget style bits.listener
- The lestner to receive the tree selection eventes.protected abstract void addAllRenderConfigs()
public abstract boolean isTemplateTree()
isTemplateTree
in interface IConfigurationTree
true
if the tree is used for managing render configuration templates,
false
if it manages regular render configurations.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#isTemplateTree()
protected abstract void setTreeItemIcon(TreeItem treeItem)
TreeItem
.treeItem
- protected Menu generatePopupMenu(Shell shell, SelectionListener listener)
shell
- The shell to be used for the produced Menu
object.listener
- The SelectionListener
to be used by the menu items.Menu
holding the MenuItem
object mentioned above.public void reload()
reload
in interface IConfigurationTree
com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#reload()
public boolean hasSelection()
true
if the tree has a selection,
false
otherwise.public TreeItem addItem(OldRenderConfiguration renderConfig)
TreeItem
displaying the given
RenderConfiguration
and returns it.addItem
in interface IConfigurationTree
renderConfig
- The RenderConfiguration
to be displayed.TreeItem
.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#addItem(com.OldRenderConfiguration.povclipse.actionsets.render.RenderConfiguration)
public void setPopupMenuConfigEnabled(boolean enabled)
IConfigurationTree
setPopupMenuConfigEnabled
in interface IConfigurationTree
enabled
- true
to enable the "Delete" and "Duplicate" menu items.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#setPopupMenuConfigEnabled(boolean)
public TreeItem getSelectedItem()
getSelectedItem
in interface IConfigurationTree
TreeItem
or NULL
if no item is selected.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#getSelectedItem()
public TreeItem getItemByRenderConfiguration(OldRenderConfiguration renderConfig)
TreeItem
displaying the given RenderConfiguration
.getItemByRenderConfiguration
in interface IConfigurationTree
renderConfig
- The RenderConfiguration
to be searched for.TreeItem
displaying the given RenderConfiguration
or null
if none can be found.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#getItemByRenderConfiguration(com.OldRenderConfiguration.povclipse.actionsets.render.RenderConfiguration)
public void selectItem(OldRenderConfiguration renderConfig)
IConfigurationTree
TreeItem
displaying the given
RenderConfiguration
.selectItem
in interface IConfigurationTree
renderConfig
- The RenderConfiguration
to be looked for.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#selectItem(com.OldRenderConfiguration.povclipse.actionsets.render.RenderConfiguration)
public void removeItem(TreeItem item)
IConfigurationTree
TreeItem
.removeItem
in interface IConfigurationTree
item
- The TreeItem
to be removed.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#removeItem(org.eclipse.swt.widgets.TreeItem)
public void setItemColor(TreeItem item, boolean isValid)
IConfigurationTree
TreeItem
forground text color.isValid
is true
black
will
be used, otherwise red.setItemColor
in interface IConfigurationTree
item
- The TreeItem
to be colored.isValid
- true
to use black, false
to use red.com.wm.povclipse.actionsets.render.settings.tree.IConfigurationTree#setItemColor(org.eclipse.swt.widgets.TreeItem, boolean)
public void expandFullTree()