Directory

← Back

TagCloud

TagCloud Widget

Author

Rating

Popularity

<100

Server-side only Cloud Tag Vaadin component

Sample code

public class TagCloudDemoApplication extends Application {

	@Override
	public void init() {
		String[] stringTags = new String[] { "Simple", "Tag", "Vaadin", "Java", "JEE", "GWT", "Google", "RIA", "HTML", "Script", "HTML", "Spring", "Roo",
				"Hades", "Security", "Eclipse", "Scrum", "Agile", "Lean", "Kanban", "Link", "CSS" };

		Window window = new Window("My Vaadin Application");

		setMainWindow(window);
		TagCloud verticalTagCloud = new SimpleTagCloud();

		verticalTagCloud.setWidth("320px");

		for (int index = 0; index < stringTags.length; index++) {
			@SuppressWarnings("rawtypes")
			Weight weight = getWeight(new Random().nextInt(7));
			Tag simpleTag = new SimpleTag(stringTags[index], weight);
			simpleTag.setUrl("http://google.com");
			verticalTagCloud.addTag(simpleTag);
		}
		window.addComponent(verticalTagCloud);
	}

	@SuppressWarnings("rawtypes")
	private Weight getWeight(int random) {
		Weight[] weights = SimpleWeight.values();
		for (int i = 0; i < weights.length; i++) {
			if (weights[i].getValue() == random) {
				return weights[i];
			}
		}
		return SimpleWeight.NORMAL;
	}
}

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
2011-07-25
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 6.0+
Browser
Browser Independent

TagCloud - Vaadin Add-on Directory

TagCloud Widget TagCloud - Vaadin Add-on Directory
Server-side only Cloud Tag Vaadin component

TagCloud version 0.0.1
null

Online