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.
Difference between revisions of "Nebula ColumnBrowser"
(Created page with "=Introduction= File: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=...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Nebula|< Back to Nebula Main Page]] | ||
+ | |||
=Introduction= | =Introduction= | ||
[[File:ColumnBrowser.png]] | [[File:ColumnBrowser.png]] | ||
− | A widget that displays a tree structure a la mac in miller columns (look at http://en.wikipedia.org/wiki/Miller_Columns). | + | A widget that displays a tree structure ''a la mac in miller'' columns (look at http://en.wikipedia.org/wiki/Miller_Columns). |
+ | |||
+ | __TOC__ | ||
=Usage= | =Usage= | ||
Line 16: | Line 20: | ||
public void addSelectionListener(final SelectionListener listener) | public void addSelectionListener(final SelectionListener listener) | ||
− | Add a selection listener | + | * Add a selection listener |
public void clear(final boolean needPacking) | public void clear(final boolean needPacking) | ||
− | Remove all data of the widget | + | * Remove all data of the widget |
public ColumnItem getSelection() | public ColumnItem getSelection() | ||
− | Get the ColumnItem selected (or null if none) | + | * Get the ColumnItem selected (or null if none) |
public void removeSelectionListener(final SelectionListener listener) | public void removeSelectionListener(final SelectionListener listener) | ||
− | Remove a selection listener | + | * Remove a selection listener |
public void select(final ColumnItem item) | public void select(final ColumnItem item) | ||
− | Select a given item | + | * Select a given item |
==Column item== | ==Column item== | ||
Line 32: | Line 36: | ||
public ColumnItem(final ColumnBrowserWidget widget) | public ColumnItem(final ColumnBrowserWidget widget) | ||
− | Create an item and associate it to a given widget | + | * Create an item and associate it to a given widget |
public ColumnItem(final ColumnBrowserWidget widget, final int index) | public ColumnItem(final ColumnBrowserWidget widget, final int index) | ||
− | Create an item is at a zero-based given position | + | * Create an item is at a zero-based given position |
public ColumnItem(final ColumnItem parent) | public ColumnItem(final ColumnItem parent) | ||
− | Create a item that is a child of another ColumnItem | + | * Create a item that is a child of another ColumnItem |
public ColumnItem(final ColumnItem parent, final int index) | public ColumnItem(final ColumnItem parent, final int index) | ||
− | Create a item that is a child of another ColumnItem at a zero-based given position | + | * Create a item that is a child of another ColumnItem at a zero-based given position |
public void remove(final ColumnItem item) | public void remove(final ColumnItem item) | ||
− | Remove a child of the current item | + | * Remove a child of the current item |
public void remove(final int index) | public void remove(final int index) | ||
− | Remove a child of the current item | + | * Remove a child of the current item |
public void removeAll() | public void removeAll() | ||
− | Remove all children of the current item | + | * Remove all children of the current item |
public ColumnItem getItem(final int index) | public ColumnItem getItem(final int index) | ||
− | Get a children at a given position | + | * Get a children at a given position |
public int getItemCount() | public int getItemCount() | ||
− | Get the number of children of the current item | + | * Get the number of children of the current item |
public ColumnItem[] getItems() | public ColumnItem[] getItems() | ||
− | Get all children of the current item | + | * Get all children of the current item |
public ColumnBrowserWidget getParent() | public ColumnBrowserWidget getParent() | ||
− | Get the widget that is the parent of the current item | + | * Get the widget that is the parent of the current item |
public ColumnItem getParentItem() | public ColumnItem getParentItem() | ||
− | Get the parent of the current item, or null if there is not | + | * Get the parent of the current item, or null if there is not |
public int indexOf(final ColumnItem item) | public int indexOf(final ColumnItem item) | ||
− | Returns the position of a children | + | * Returns the position of a children |
− | You can notice that the behaviour of this widget is very similar to the couple Tree/TreeItem. | + | You can notice that the behaviour of this widget is very similar to the couple <code>Tree/TreeItem</code>. |
=Example= | =Example= | ||
Line 64: | Line 68: | ||
An example called ColumnsSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.columnbrowser.snippets. | An example called ColumnsSnippet.java is located in the plugin org.eclipse.nebula.widgets.opal.columnbrowser.snippets. | ||
− | This example is also available here : https:// | + | This example is also available here : [https://github.com/eclipse/nebula/blob/master/widgets/opal/columnbrowser/org.eclipse.nebula.widgets.opal.columnbrowser.snippets/src/org/eclipse/nebula/opal/columnbrowser/snippets/ColumnsSnippet.java ColumnsSnippet.java] |
Latest revision as of 06:17, 19 March 2020
Introduction
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