VostokSystem UIComponents collection
A collection of UIcomponents and helper classes, Toolbar, PushButton, SpinButton, ActionWindow and more
This library regroups several components and helpers classes, main ones are :
Toolbar is a widget for rendering an horizontal toolbar, filled with buttons, selectors, etc.
It aims to be simple and versatile. It also provide a set of scss variables.
PushButton is a on/off state button. It accepts 3 different modes, Single, Many to Many, One of many.
SpinButton is a multi purpose component, designed to display and browse over data with next/previous buttons. it uses a data model, therefore values aren't necessarily fixed neither linear and can be done at request.There's a set of default models but you can easily create your. value can also be edited by user.
Dialog window - which extend Dialog - is made of two parts, the inner, where you add your content, and the button bar. It uses a central listener for managing all actions at once (including close/cancel), no need for a listen on each button. To do so, It expects an unique "id" for each button (action). ActionWindow provides many helpers to create most common "modal" windows.
KeyPressAction allow you to register a specific listener for a component when using the same shortcut accross several others component. It acts as a proxy between components and the default vaadin Shortcut listener.
also,, i18nbutton, i18n integration, WindowManagement, SimpleColourWindow, HintField...
Check the sampler at http:/:vaadin.vostoksystem.eu for a full description and more samples code.
Licence : Creative commons, no restriction, free for any open source or commercial usages.
Thanks.
Sample code
new Toolbar() { Button.ClickListener listener = new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { NotificationExtension.showOk("Button clicked", "button : " + event.getButton().getCaption()); } }; { addButton("Home", "Go to home", "home").addClickListener(this.listener); addButton("New", "new document", "new").addClickListener(this.listener); addButton("Open", "open", "open").addClickListener(this.listener); addButton("Close", "close current", "close").addClickListener(this.listener); addSeparator(); addButton("Copy", "Copy", "copy").addClickListener(this.listener); addButton("Cut", "Cut", "cut").addClickListener(this.listener); addButton("Paste", "Paste", "paste").addClickListener(this.listener); addButton("About", "About this", "about", BANK.RIGHT).addClickListener(this.listener); addButton("Help", "Inline help", "help", BANK.RIGHT).addClickListener(this.listener); } };
addComponent(new Label("Simple integer, no limit")); addComponent(new SpinButton(new NumberModel(10))); /****************************/ addComponent(new Label("Currencies : 0 to 99.99€, 10€ increase")); addComponent(new SpinButton(new NumberModel(9.99, 10.0, 0, 99.99, false, NumberModel.FORMAT_CURRENCY_EURO))); /****************************/ addComponent(new Label("Geometry : 15° step")); addComponent(new SpinButton(new NumberModel(0, 15.0, -180, 180, true, "%.02f °")));
/* With property listener */ // add a data source and set initial button final ObjectProperty<Integer> value = new ObjectProperty<Integer>(-1); final PushButton buttons = new PushButton(null, new I18nButton("grid-large"), new I18nButton("grid-normal"), new I18nButton("grid-condensed"), new I18nButton("grid-list")) { { setPropertyDataSource(value); setMode(Mode.ONEMANY); addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { NotificationExtension.showOk("property changed : " + event.getProperty().getValue()); } }); } }; /* forcing state */ new Button("Click to switch button #4", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { buttons.setValue(3); } });
/** A "movie" list window with an inner preview window to **/ /* create the window */ dlg = new DialogWindow("Movie list", new DialogWindow.Item[]{ new Item("preview", 100), new Item("save", DialogWindow.OK), new Item("cancel", DialogWindow.CANCEL) }) { { setId("MovieListDemoDlg"); center(); setDialogClickListener(new DialogClickListener() { @Override public boolean buttonClick(Event event, int action) { switch (action) { case OK: NotificationExtension.showOk("Should submit change to db.<br/>Obviously here does nothing"); break; case 100: // let's create a simple preview window. //Note in this case (htm content), use of dialogWindow.createMessage should be used instead StringBuilder sb = new StringBuilder("<ul>"); for (Iterator i = contexteContainer.getItemIds().iterator(); i.hasNext();) { MovieBean m = contexteContainer.getItem(i.next()).getBean(); sb.append("<li>").append(m.getYear()).append(", ").append(m.getTitle()).append("</li>"); } sb.append("</ul>"); new DialogWindow("Preview", new Label(sb.toString()) { { setContentMode(ContentMode.HTML); } }, new Item[]{ new Item("close", DialogWindow.CLOSE),}) { { setModal(true); } }.show(); return false; case CLOSE: NotificationExtension.showOk("Window closed by icon"); break; default: // fake close / cancel, just reload data } return true; } }); } }; Table table = new Table("Movie list") { { setSizeFull(); setImmediate(true); setContainerDataSource(contexteContainer); setSortContainerPropertyId("year"); setSortAscending(false); setVisibleColumns("title", "year"); setColumnHeaders(new String[]{"Title", "Year"}); } }; dlg.getInnerContent().addComponent(table); dlg.getInnerContent().setSizeFull(); /* use it */ new Button("Open Dialog", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (WindowManagement.show("MovieListDemoDlg")) { return; } CreateDialogView.this.dlg.show(); } });
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
Library switches to scss and valo Minor bug fixes, Compatibility with vaddin 1.5 and up updated license to Apache 2.0
- Released
- 2016-05-30
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.5
- Vaadin 7.6
- Vaadin 7.2 in 1.1.2
- Vaadin 7.1 in 1.1.2
- Browser
- N/A
VostokSystem UIComponents collection - Vaadin Add-on Directory
A collection of UIcomponents and helper classes, Toolbar, PushButton, SpinButton, ActionWindow and moreIt aims to be simple and versatile. It also provide a set of scss variables. PushButton is a on/off state button. It accepts 3 different modes, Single, Many to Many, One of many. SpinButton is a multi purpose component, designed to display and browse over data with next/previous buttons. it uses a data model, therefore values aren't necessarily fixed neither linear and can be done at request.There's a set of default models but you can easily create your. value can also be edited by user. Dialog window - which extend Dialog - is made of two parts, the inner, where you add your content, and the button bar. It uses a central listener for managing all actions at once (including close/cancel), no need for a listen on each button. To do so, It expects an unique "id" for each button (action). ActionWindow provides many helpers to create most common "modal" windows. KeyPressAction allow you to register a specific listener for a component when using the same shortcut accross several others component. It acts as a proxy between components and the default vaadin Shortcut listener. also,, i18nbutton, i18n integration, WindowManagement, SimpleColourWindow, HintField... Check the sampler at http:/:vaadin.vostoksystem.eu for a full description and more samples code. Licence : Creative commons, no restriction, free for any open source or commercial usages. Thanks.
Online Demo
Issue Tracker
Source Code sample
Javadocs
VostokSystem UIComponents collection version 1.1.2
* i18n (update)
Forcing default language to English.
This correct a bug when the wrong resource bundle is used as default one ( on servers set to use French or German...)
1.1:
*SpinButton (update)
Spinbutton implement Editable interface, it's value is now editable by user.
Update for stock SpinButton's NumberModel and CalendarModel provide new converter too.
* Utility class KeyPressAction (new)
With KeyPressAction several widgets can listen for the same keyboard sequence. You don't need a central listener any more.
TextFieldActionRollback and SpinButton use it.
Still not clear ? check sample !
* Widget TextFieldActionRollback (new)
TextFieldActionRollback.is a TextField with shortcut for validation and rollback. It uses KeyPressAction.
* New German translation for i18n (new/update)
* minor corrections
VostokSystem UIComponents collection version 1.5
Library switches to scss and valo
Minor bug fixes,
Compatibility with vaddin 1.5 and up
updated license to Apache 2.0