本文整理汇总了Java中com.vaadin.ui.ListSelect.addValueChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java ListSelect.addValueChangeListener方法的具体用法?Java ListSelect.addValueChangeListener怎么用?Java ListSelect.addValueChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.ListSelect
的用法示例。
在下文中一共展示了ListSelect.addValueChangeListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildAndBindList
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
protected Component buildAndBindList(String key, String caption) {
ListSelect field = new ListSelect();
field.setCaption(caption);
field.setNullSelectionAllowed(false);
field.addValueChangeListener((ValueChangeEvent event) -> {
String path = (String) event.getProperty().getValue();
if (path != null) {
// open app (subapp)
Location location = new RerootBrowserLocation("neatconfiguration", "helperBrowser", path, false);
adminEventBus.fireEvent(new LocationChangedEvent(location));
}
});
dataBindings.put(key, field);
return field;
}
示例2: addList
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
private void addList( AbsoluteLayout mainLayout ) {
ListSelect list = new ListSelect();
list.setWidth( "100%" );
list.setHeight( "420px" );
list.setNullSelectionAllowed( false );
list.setImmediate( true );
list.addValueChangeListener( new Property.ValueChangeListener() {
@Override
public void valueChange( Property.ValueChangeEvent event ) {
Object value = event.getProperty().getValue();
if ( value != null ) {
close();
selectedUser = ( String ) value;
showUser( ( String ) value );
}
}
});
loadData( list );
mainLayout.addComponent( list, "left: 0px; top: 0px;" );
}
示例3: getScheduleComponent
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
protected ListSelect getScheduleComponent(String caption) {
ListSelect listSelect = new ListSelect(caption);
listSelect.setWidth(90, Unit.PIXELS);
listSelect.setMultiSelect(true);
listSelect.setRows(10);
listSelect.setImmediate(true);
listSelect.addItem("*");
listSelect.setItemCaption("*", "<All>");
if (caption.equals("Second") || caption.equals("Minute")) {
for (int i = 0; i <= 59; i++) {
listSelect.addItem(String.valueOf(i));
}
} else if (caption.equals("Hour")) {
for (int i = 0; i <= 23; i++) {
listSelect.addItem(String.valueOf(i));
}
} else if (caption.equals("Day")) {
for (int i = 1; i <= 31; i++) {
listSelect.addItem(String.valueOf(i));
}
} else if (caption.equals("Month")) {
listSelect.addItems("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC");
} else if (caption.equals("Day of Week")) {
listSelect.addItems("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT");
} else if (caption.equals("Year")) {
for (int i = Calendar.getInstance().get(Calendar.YEAR); i <= 2099; i++) {
listSelect.addItem(String.valueOf(i));
}
}
listSelect.select(listSelect.getItemIds().iterator().next());
listSelect.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
updateScheduleExpression();
}
});
return listSelect;
}
示例4: createDashboardSelector
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
private void createDashboardSelector()
{
dashBoardSelector = new ListSelect();
dashBoardSelector.setHeight("100%");
dashBoardSelector.setWidth("300");
// dashBoardSelector.setItemCaptionPropertyId(Tblportallayout_.name.getName());
// dashBoardSelector.setItemCaptionMode(ItemCaptionMode.PROPERTY);
container = new BeanItemContainer<>(Tblportallayout.class);
loadDashboardList();
dashBoardSelector.setContainerDataSource(container);
dashBoardSelector.setNullSelectionAllowed(false);
dashBoardSelector.addValueChangeListener(new ValueChangeListener()
{
private static final long serialVersionUID = 2850017605363067882L;
@Override
public void valueChange(ValueChangeEvent event)
{
if (!loading)
{
Tblportallayout portalLayout = (Tblportallayout) event.getProperty().getValue();
if (portalLayout != null)
{
portalLayout = JpaBaseDao.getGenericDao(Tblportallayout.class).findByEntityId(portalLayout);
createDashboard(portalLayout);
closeToolBar();
}
}
}
});
}
示例5: buildSearchLayout
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
protected AbstractLayout buildSearchLayout() {
FormLayout layout = new FormLayout();
layout.setMargin(true);
List<Plugin> existingPlugins = context.getPluginService().findPlugins();
Set<String> groups = new HashSet<>();
Set<String> names = new HashSet<>();
for (Plugin plugin : existingPlugins) {
groups.add(plugin.getArtifactGroup());
names.add(plugin.getArtifactName());
}
versionSelect = new ListSelect("Versions");
groupCombo = new ComboBox("Group");
nameCombo = new ComboBox("Name");
versionSelect.setRows(4);
versionSelect.setMultiSelect(false);
versionSelect.setNullSelectionAllowed(false);
versionSelect.setWidth(100, Unit.PERCENTAGE);
versionSelect.addValueChangeListener(e -> versionSelected());
groupCombo.setWidth(100, Unit.PERCENTAGE);
groupCombo.setNewItemsAllowed(true);
groupCombo.addItems(groups);
groupCombo.addValueChangeListener(e -> {
populateNameField(nameCombo);
setSearchButtonEnabled();
});
groupCombo.setNewItemHandler((newItemCaption) -> {
groupCombo.removeItem(handEnteredGroup);
handEnteredGroup = newItemCaption;
groupCombo.addItem(handEnteredGroup);
groupCombo.setValue(handEnteredGroup);
setSearchButtonEnabled();
});
layout.addComponent(groupCombo);
nameCombo.setWidth(100, Unit.PERCENTAGE);
nameCombo.setNewItemsAllowed(true);
nameCombo.addItems(names);
nameCombo.addValueChangeListener(e -> {
setSearchButtonEnabled();
});
nameCombo.setNewItemHandler((newItemCaption) -> {
nameCombo.removeItem(handEnteredName);
handEnteredName = newItemCaption;
nameCombo.addItem(handEnteredName);
nameCombo.setValue(handEnteredName);
setSearchButtonEnabled();
});
layout.addComponent(nameCombo);
layout.addComponent(versionSelect);
return layout;
}