Class ColumnItem
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.commons.OpalItem
-
- org.eclipse.nebula.widgets.opal.columnbrowser.ColumnItem
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ColumnItem>
children
private ColumnItem
parent
private ColumnBrowserWidget
widget
-
Constructor Summary
Constructors Constructor Description ColumnItem(ColumnBrowserWidget widget)
Constructs a new instance of this class given its parent.ColumnItem(ColumnBrowserWidget widget, int index)
Constructs a new instance of this class given its parent.ColumnItem(ColumnItem parent)
Constructs a new instance of this class given its parent.ColumnItem(ColumnItem parent, int index)
Constructs a new instance of this class given its parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
ColumnItem
getItem(int index)
Returns an item located at a given positionint
getItemCount()
ColumnItem[]
getItems()
ColumnBrowserWidget
getParent()
ColumnItem
getParentItem()
int
hashCode()
int
indexOf(ColumnItem item)
Return the position of a given item in children's listvoid
remove(int index)
Remove a children in a given position of this objectvoid
remove(ColumnItem item)
Remove a given children of this objectvoid
removeAll()
Remove all children of this object-
Methods inherited from class org.eclipse.nebula.widgets.opal.commons.OpalItem
getBackground, getData, getData, getFont, getForeground, getHeight, getImage, getText, setBackground, setData, setData, setFont, setForeground, setHeight, setImage, setText
-
-
-
-
Field Detail
-
widget
private final ColumnBrowserWidget widget
-
parent
private final ColumnItem parent
-
children
private final java.util.List<ColumnItem> children
-
-
Constructor Detail
-
ColumnItem
public ColumnItem(ColumnBrowserWidget widget)
Constructs a new instance of this class given its parent. The item is added to the end of the items maintained by its parent.- Parameters:
widget
- the widget that will contain this item (can not be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
ColumnItem
public ColumnItem(ColumnBrowserWidget widget, int index)
Constructs a new instance of this class given its parent. The item is added at a given position in the items'list maintained by its parent.- Parameters:
widget
- the widget that will contain this item (can not be null)index
- the position- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
ColumnItem
public ColumnItem(ColumnItem parent)
Constructs a new instance of this class given its parent. The item is added to the end of the items maintained by its parent.- Parameters:
widget
- the widget that will contain this item (can not be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
ColumnItem
public ColumnItem(ColumnItem parent, int index)
Constructs a new instance of this class given its parent. The item is added at a given position in the items'list maintained by its parent.- Parameters:
widget
- the widget that will contain this item (can not be null)index
- the position- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
-
Method Detail
-
remove
public void remove(ColumnItem item)
Remove a given children of this object- Parameters:
item
- the item to remove (can not be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
remove
public void remove(int index)
Remove a children in a given position of this object- Parameters:
index
- position of the children in the items'list- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
removeAll
public void removeAll()
Remove all children of this object- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
getItem
public ColumnItem getItem(int index)
Returns an item located at a given position- Parameters:
index
- position- Returns:
- the item located at the index position
- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
getItemCount
public int getItemCount()
- Returns:
- the number of children
- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
getItems
public ColumnItem[] getItems()
- Returns:
- all children of this item
- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
getParent
public ColumnBrowserWidget getParent()
- Returns:
- the widget that holds this item
- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
getParentItem
public ColumnItem getParentItem()
- Returns:
- the parent item, of
null
if this item is the root node - Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
indexOf
public int indexOf(ColumnItem item)
Return the position of a given item in children's list- Parameters:
item
- item to find- Returns:
- the position of the children, or -1 if
item
is a not a children of this object - Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
-