org.eclipse.rse.ui.dialogs
Class SystemSimpleContentElement
java.lang.Object
org.eclipse.rse.ui.dialogs.SystemSimpleContentElement
-
public class SystemSimpleContentElement
- extends
Object
When we populate a TreeViewer in a dialog, we need a simple
representation of the objects to populate the tree.
Works in concert with
SystemSimpleContentProvider
-
See Also:
-
SystemSimpleContentElement
,
SystemSimpleSelectDialog
SystemSimpleContentElement
public SystemSimpleContentElement(
String name,
Object data,
SystemSimpleContentElement parent,
SystemSimpleContentElement[] children)
- Constructor when given children as an array.
-
Parameters:
-
name
- - the display name to show for this element -
data
- - the real object which is to be contained by this element -
parent
- - the parent element of this element. Pass null for the root. -
children
- - an array of SystemSimpleContentElement objects that are to be the children of this element. Can be null.
SystemSimpleContentElement
public SystemSimpleContentElement(
String name,
Object data,
SystemSimpleContentElement parent,
Vector children)
- Constructor when given children as a vector.
-
Parameters:
-
name
- - the display name to show for this element -
data
- - the real object which is to be contained by this element -
parent
- - the parent element of this element. Pass null for the root. -
children
- - a vector of SystemSimpleContentElement objects that are to be the children of this element. Can be null.
getName
public
String getName()
- Return the display name for this element
-
setName
public void setName(
String name)
- Set the display name for this element
-
getData
public
Object getData()
- Return the real object which this element wraps or represents
-
setData
public void setData(
Object data)
- Set the real object which this element wraps or represents
-
getParent
public
SystemSimpleContentElement getParent()
- Get the parent element
-
setParent
public void setParent(
SystemSimpleContentElement parent)
- Set the parent element
-
getRoot
public
SystemSimpleContentElement getRoot()
- Walk up the parent tree until we find the root
-
getChildren
public
SystemSimpleContentElement[] getChildren()
- Return the child elements, or null if no children
-
hasChildren
public boolean hasChildren()
- Return true if this element has children
-
setChildren
public void setChildren(
SystemSimpleContentElement[] children)
- Set the child elements of this element, as an array of SystemSimpleContentElement elements
-
setChildren
public void setChildren(
Vector childrenVector)
- Set the child elements of this element, as a vector of SystemSimpleContentElement elements
-
setSelected
public void setSelected(boolean selected)
- Set selected state.
Used in SimpleSimpleSelectDialog to pre-check item in CheckboxTreeViewer
-
isSelected
public boolean isSelected()
- Return true if this element has been flagged as selected.
-
setRenamable
public void setRenamable(boolean renamable)
- Set whether this item is renamable or not. Default is true.
Used to enable/disable rename action.
-
isRenamable
public boolean isRenamable()
- Return true if this item is renamable or not. Default is true.
-
setDeletable
public void setDeletable(boolean deletable)
- Set whether this item is deletable or not. Default is true.
Used to enable/disable rename action.
-
isDeletable
public boolean isDeletable()
- Return true if this item is deletable. Will be true unless setDeletable(false) has been called.
-
setReadOnly
public void setReadOnly(boolean readonly)
- Set whether this node is readonly or not. If readonly, users cannot change its selected state.
-
isReadOnly
public boolean isReadOnly()
- Return whether this node is readonly or not. Readonly nodes cannot be selected/deselected by the user.
-
setImageDescriptor
public void setImageDescriptor(
ImageDescriptor imageDescriptor)
- Set the image to display for this element, in the tree viewer
-
getImageDescriptor
public
ImageDescriptor getImageDescriptor()
- Get the image to display for this element, in the tree viewer
-
deleteChild
public void deleteChild(
SystemSimpleContentElement child)
- Delete the given child element.
-
addChild
public void addChild(
SystemSimpleContentElement child,
int pos)
- Add the given child element at the given zero-based position
-
toString
public
String toString()
- Maps to getName()
-
-
Overrides:
-
toString
in class
Object
-
getDataElement
public static
SystemSimpleContentElement getDataElement(
SystemSimpleContentElement root,
Object data)
- Find element corresponding to given data
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.