Class TreeViewerRow

java.lang.Object
org.eclipse.jface.viewers.ViewerRow
org.eclipse.jface.viewers.TreeViewerRow
All Implemented Interfaces:
Cloneable

public class TreeViewerRow extends ViewerRow
TreeViewerRow is the Tree implementation of ViewerRow.
Since:
3.3
  • Method Details

    • getBounds

      public Rectangle getBounds(int columnIndex)
      Description copied from class: ViewerRow
      Get the bounds of the entry at the columnIndex,
      Specified by:
      getBounds in class ViewerRow
      Parameters:
      columnIndex - column index of interest
      Returns:
      Rectangle
    • getBounds

      public Rectangle getBounds()
      Description copied from class: ViewerRow
      Return the bounds for the whole item.
      Specified by:
      getBounds in class ViewerRow
      Returns:
      Rectangle
    • getColumnCount

      public int getColumnCount()
      Description copied from class: ViewerRow
      Return the number of columns for the receiver.
      Specified by:
      getColumnCount in class ViewerRow
      Returns:
      the number of columns
    • getItem

      public Widget getItem()
      Description copied from class: ViewerRow
      Return the item for the receiver.
      Specified by:
      getItem in class ViewerRow
      Returns:
      Widget
    • getBackground

      public Color getBackground(int columnIndex)
      Description copied from class: ViewerRow
      Get the background at the columnIndex,
      Specified by:
      getBackground in class ViewerRow
      Parameters:
      columnIndex - column index of interest
      Returns:
      Color or null
    • getFont

      public Font getFont(int columnIndex)
      Description copied from class: ViewerRow
      Get the font at the columnIndex.
      Specified by:
      getFont in class ViewerRow
      Parameters:
      columnIndex - column index of interest
      Returns:
      Font or null
    • getForeground

      public Color getForeground(int columnIndex)
      Description copied from class: ViewerRow
      Get the foreground at the columnIndex.
      Specified by:
      getForeground in class ViewerRow
      Parameters:
      columnIndex - column index of interest
      Returns:
      Color or null
    • getImage

      public Image getImage(int columnIndex)
      Description copied from class: ViewerRow
      Return the image at the columnIndex.
      Specified by:
      getImage in class ViewerRow
      Parameters:
      columnIndex - column index of interest
      Returns:
      Image or null
    • getText

      public String getText(int columnIndex)
      Description copied from class: ViewerRow
      Get the text at the columnIndex.
      Specified by:
      getText in class ViewerRow
      Parameters:
      columnIndex - column index of interest
      Returns:
      String
    • setBackground

      public void setBackground(int columnIndex, Color color)
      Description copied from class: ViewerRow
      Set the background at the columnIndex.
      Specified by:
      setBackground in class ViewerRow
      Parameters:
      columnIndex - column index to set color for
      color - color to set
    • setFont

      public void setFont(int columnIndex, Font font)
      Description copied from class: ViewerRow
      Set the Font at the columnIndex.
      Specified by:
      setFont in class ViewerRow
      Parameters:
      columnIndex - column index to set font for
      font - font to set
    • setForeground

      public void setForeground(int columnIndex, Color color)
      Description copied from class: ViewerRow
      Set the foreground at the columnIndex.
      Specified by:
      setForeground in class ViewerRow
      Parameters:
      columnIndex - column index to set color for
      color - color to set
    • setImage

      public void setImage(int columnIndex, Image image)
      Description copied from class: ViewerRow
      Set the image at the columnIndex
      Specified by:
      setImage in class ViewerRow
      Parameters:
      columnIndex - column index to set image for
      image - image to set
    • setText

      public void setText(int columnIndex, String text)
      Description copied from class: ViewerRow
      Set the text at the columnIndex
      Specified by:
      setText in class ViewerRow
      Parameters:
      columnIndex - column index to set text for
      text - text to set
    • getControl

      public Control getControl()
      Description copied from class: ViewerRow
      Get the Control for the receiver.
      Specified by:
      getControl in class ViewerRow
      Returns:
      Control
    • getNeighbor

      public ViewerRow getNeighbor(int direction, boolean sameLevel)
      Description copied from class: ViewerRow
      Returns a neighboring row, or null if no neighbor exists in the given direction. If sameLevel is true, only sibling rows (under the same parent) will be considered.
      Specified by:
      getNeighbor in class ViewerRow
      Parameters:
      direction - the direction ViewerRow.BELOW or ViewerRow.ABOVE
      sameLevel - if true, search only within sibling rows
      Returns:
      the row above/below, or null if not found
    • getTreePath

      public TreePath getTreePath()
      Description copied from class: ViewerRow
      The tree path used to identify an element by the unique path
      Specified by:
      getTreePath in class ViewerRow
      Returns:
      the path
    • clone

      public Object clone()
      Specified by:
      clone in class ViewerRow
    • getElement

      public Object getElement()
      Specified by:
      getElement in class ViewerRow
      Returns:
      the model element
    • getVisualIndex

      public int getVisualIndex(int creationIndex)
      Description copied from class: ViewerRow
      Translate the original column index to the actual one.

      Because of backwards API compatibility the default implementation returns the original index. Implementators of ColumnViewer should overwrite this method if their widget supports reordered columns

      Overrides:
      getVisualIndex in class ViewerRow
      Parameters:
      creationIndex - the original index
      Returns:
      the current index (as shown in the UI)
    • getCreationIndex

      public int getCreationIndex(int visualIndex)
      Description copied from class: ViewerRow
      Translate the current column index (as shown in the UI) to the original one.

      Because of backwards API compatibility the default implementation returns the original index. Implementators of ColumnViewer should overwrite this method if their widget supports reordered columns

      Overrides:
      getCreationIndex in class ViewerRow
      Parameters:
      visualIndex - the current index (as shown in the UI)
      Returns:
      the original index
    • getTextBounds

      public Rectangle getTextBounds(int index)
      Description copied from class: ViewerRow
      The location and bounds of the area where the text is drawn depends on various things (image displayed, control with SWT.CHECK)
      Overrides:
      getTextBounds in class ViewerRow
      Parameters:
      index - the column index
      Returns:
      the bounds of the of the text area. May return null if the underlying widget implementation doesn't provide this information
    • getImageBounds

      public Rectangle getImageBounds(int index)
      Description copied from class: ViewerRow
      Returns the location and bounds of the area where the image is drawn.
      Overrides:
      getImageBounds in class ViewerRow
      Parameters:
      index - the column index
      Returns:
      the bounds of the of the image area. May return null if the underlying widget implementation doesn't provide this information
    • scrollCellIntoView

      protected boolean scrollCellIntoView(int columnIndex)
      Description copied from class: ViewerRow
      Scrolls the cell at this index into view

      Because of backwards API compatibility the default implementation is a no-op. Implementators of ColumnViewer should overwrite this method if their widget supports reordered columns

      Overrides:
      scrollCellIntoView in class ViewerRow
      Parameters:
      columnIndex - the column index
      Returns:
      return true when the cell is scrolled into view