Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Nebula ColumnBrowser

< Back to Nebula Main Page

Introduction

ColumnBrowser.png

A widget that displays a tree structure a la mac in miller columns (look at http://en.wikipedia.org/wiki/Miller_Columns).

Usage

ColumnBrowserWidget

The widget itself contains the following method :


   public ColumnBrowserWidget(final Composite parent, final int style)

Constructor of the widget

   public void addSelectionListener(final SelectionListener listener)
  • Add a selection listener
   public void clear(final boolean needPacking)
  • Remove all data of the widget
   public ColumnItem getSelection()
  • Get the ColumnItem selected (or null if none)
   public void removeSelectionListener(final SelectionListener listener)
  • Remove a selection listener
   public void select(final ColumnItem item)
  • Select a given item

Column item

The elements displayed in the widget are called ColumnItem


   public ColumnItem(final ColumnBrowserWidget widget)
  • Create an item and associate it to a given widget
   public ColumnItem(final ColumnBrowserWidget widget, final int index)
  • Create an item is at a zero-based given position
   public ColumnItem(final ColumnItem parent)
  • Create a item that is a child of another ColumnItem
   public ColumnItem(final ColumnItem parent, final int index)
  • Create a item that is a child of another ColumnItem at a zero-based given position
   public void remove(final ColumnItem item)
  • Remove a child of the current item
   public void remove(final int index)
  • Remove a child of the current item
   public void removeAll()
  • Remove all children of the current item
   public ColumnItem getItem(final int index)
  • Get a children at a given position
   public int getItemCount()
  • Get the number of children of the current item
   public ColumnItem[] getItems()
  • Get all children of the current item
   public ColumnBrowserWidget getParent()
  • Get the widget that is the parent of the current item
   public ColumnItem getParentItem()
  • Get the parent of the current item, or null if there is not
   public int indexOf(final ColumnItem item)
  • Returns the position of a children

You can notice that the behaviour of this widget is very similar to the couple Tree/TreeItem.

Example

An example called ColumnsSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.columnbrowser.snippets.

This example is also available here : ColumnsSnippet.java

Back to the top