Directory

← Back

ComponentTree

A Simple server-side tree component that accepts components

Author

Rating

Popularity

<100

ComponentTree is a simple server-side component that makes it possible to display any kind of components in a tree-like structure.

Sample code

	public void init() {
		Window mainWindow = new Window("Components Application");
		setMainWindow(mainWindow);
		
		ComponentTree ct = new ComponentTree();
		ComponentTreeItem i1 = ct.addChild(createDummyComponent("1"));
		ComponentTreeItem i11 = i1.addChild(createDummyComponent("1.1"));
		ComponentTreeItem i12 = i1.addChild(createDummyComponent("1.2"));
		ComponentTreeItem i121 = i12.addChild(createDummyComponent("1.2.1"));
		ComponentTreeItem i122 = i12.addChild(createDummyComponent("1.2.2"));
		ComponentTreeItem i13 = i1.addChild(createDummyComponent("1.3"));
		mainWindow.addComponent(ct);
		setTheme("componenttree");
	}
	
	private Component createDummyComponent (String header) {
		CssLayout l = new CssLayout();
		l.setWidth("200px");
		Label l1 = new Label("This is a component (" + header + ")");
		Label l2 = new Label("Lore ipsum dolor sit amet");
		l2.setStyleName("light");
		l.addComponent(l1);
		l.addComponent(l2);
		return l;
	}

Compatibility

(Loading compatibility data...)

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
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.2+
Browser
Firefox
Safari

ComponentTree - Vaadin Add-on Directory

A Simple server-side tree component that accepts components ComponentTree - Vaadin Add-on Directory
ComponentTree is a simple server-side component that makes it possible to display any kind of components in a tree-like structure.
Online