Class ColumnItem

java.lang.Object
org.eclipse.nebula.widgets.opal.commons.OpalItem
org.eclipse.nebula.widgets.opal.columnbrowser.ColumnItem

public class ColumnItem
extends OpalItem
Instances of this object are items manipulated by the ColumnBrowser widget. ColumnItems are part of a tree structure .
See Also:
OpalItem
  • Constructor Details

    • 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 Details

    • 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 class java.lang.Object
      See Also:
      Object.hashCode()
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
      See Also:
      Object.equals(java.lang.Object)