MillerColumns
A Miller Columns widget for displaying hierarchial data
The MillerColumns component provides an alternative for displaying hierarchial data, which is usually displayed by using a Tree component. This component extends Tree on the server-side. Client-side uses a different implementation. The component supports the same features as Tree.
Sample code
package com.example.millercolumns; import org.vaadin.hene.millercolumns.MillerColumns; import com.vaadin.Application; import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.event.Action; import com.vaadin.ui.Window; public class MillerColumnsApplication extends Application implements Action.Handler { private static final long serialVersionUID = 1L; private static Action DELETE_ACTION = new Action("Delete"); private static Action RENAME_ACTION = new Action("Rename"); private MillerColumns millerColumns; @Override public void init() { Window mainWindow = new Window("MillerColumns Application"); setMainWindow(mainWindow); millerColumns = new MillerColumns(); millerColumns.setContainerDataSource(createFakeFileSystemContainer()); millerColumns.addActionHandler(this); mainWindow.addComponent(millerColumns); } private static HierarchicalContainer createFakeFileSystemContainer() { HierarchicalContainer cont = new HierarchicalContainer(); cont.addItem("Applications"); cont.addItem("Firefox.app"); cont.setParent("Firefox.app", "Applications"); cont.setChildrenAllowed("Firefox.app", false); cont.addItem("Opera.app"); cont.setParent("Opera.app", "Applications"); cont.setChildrenAllowed("Opera.app", false); cont.addItem("Safari.app"); cont.setParent("Safari.app", "Applications"); cont.setChildrenAllowed("Safari.app", false); cont.addItem("Library"); cont.addItem("Users"); cont.addItem("lisa"); cont.setParent("lisa", "Users"); cont.addItem("tim"); cont.setParent("tim", "Users"); return cont; } public Action[] getActions(Object target, Object sender) { return new Action[] { RENAME_ACTION, DELETE_ACTION }; } public void handleAction(Action action, Object sender, Object target) { if (RENAME_ACTION == action) { } else if (DELETE_ACTION == action) { millerColumns.removeItem(target); } } }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- Released
- 2010-01-22
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 6.2+
- Browser
- Internet Explorer
- Internet Explorer
- Internet Explorer
- Firefox
- Opera
- Safari
MillerColumns - Vaadin Add-on Directory
A Miller Columns widget for displaying hierarchial dataThe MillerColumns component provides an alternative for displaying hierarchial data, which is usually displayed by using a Tree component. This component
extends Tree on the server-side. Client-side uses a different implementation. The component supports the same features as Tree.