本文整理汇总了Java中com.vaadin.ui.ListSelect.setNullSelectionAllowed方法的典型用法代码示例。如果您正苦于以下问题:Java ListSelect.setNullSelectionAllowed方法的具体用法?Java ListSelect.setNullSelectionAllowed怎么用?Java ListSelect.setNullSelectionAllowed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.ListSelect
的用法示例。
在下文中一共展示了ListSelect.setNullSelectionAllowed方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: initListSelect
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
/** Initialise les listes
* @param listSelect
* @param container
*/
private void initListSelect(ListSelect listSelect, BeanItemContainer<DroitFonctionnalite> container){
listSelect.setWidth(100, Unit.PERCENTAGE);
listSelect.setMultiSelect(true);
listSelect.setNullSelectionAllowed(false);
listSelect.setContainerDataSource(container);
listSelect.setImmediate(true);
listSelect.setRows(17);
listSelect.setItemCaptionPropertyId(DroitFonctionnalite_.libFonc.getName());
}
示例4: initListSelectPj
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
/**
* Initialise les listes de PJ
*
* @param listSelect
* @param container
*/
private void initListSelectPj(ListSelect listSelect, BeanItemContainer<PieceJustif> container) {
listSelect.setWidth(100, Unit.PERCENTAGE);
listSelect.setMultiSelect(true);
listSelect.setNullSelectionAllowed(false);
listSelect.setContainerDataSource(container);
listSelect.setImmediate(true);
listSelect.setItemCaptionPropertyId(PieceJustif_.libPj.getName());
}
示例5: initListSelectFormulaire
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
/**
* Initialise les listes de PJ
*
* @param listSelect
* @param container
*/
private void initListSelectFormulaire(ListSelect listSelect, BeanItemContainer<Formulaire> container) {
listSelect.setWidth(100, Unit.PERCENTAGE);
listSelect.setMultiSelect(true);
listSelect.setNullSelectionAllowed(false);
listSelect.setContainerDataSource(container);
listSelect.setImmediate(true);
listSelect.setItemCaptionPropertyId(Formulaire_.libFormulaire.getName());
}
示例6: buildDialogLayout
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
@Override
public void buildDialogLayout() {
Map<String, String> env = this.getContext().getEnvironment();
pathToShellScripts = env.get(ExecuteShellScript.SHELL_SCRIPT_PATH);
final VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
lstScriptName = new ListSelect(ctx.tr("ExecuteShellScript.dialog.scriptName"));
lstScriptName.setRows(5);
lstScriptName.setNullSelectionAllowed(true);
lstScriptName.setWidth("100%");
mainLayout.addComponent(lstScriptName);
txtConfiguration = new TextArea(ctx.tr("ExecuteShellScript.dialog.configuration"));
txtConfiguration.setSizeFull();
mainLayout.addComponent(txtConfiguration);
errorLabel = new Label();
errorLabel.setVisible(false);
errorLabel.setStyleName("dpu-error-label");
mainLayout.addComponent(errorLabel);
fillListValues();
setCompositionRoot(mainLayout);
}
示例7: 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();
}
}
}
});
}
示例8: 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;
}
示例9: initSelectComponent
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
protected void initSelectComponent() {
select = new ListSelect();
select.setMultiSelect(true);
select.setNullSelectionAllowed(true);
}
示例10: CanvasImport
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
public CanvasImport(){
VerticalLayout canvasImportLayout = new VerticalLayout();
canvasImportLayout.setMargin(true);
setContent(canvasImportLayout);
uploader=new NavigatorFileUpload("Upload"){
@Override
public void uploadFailed(FailedEvent failedEvent){
reportMessage("Upload failed");
}
@Override
public void uploadSucceeded(SucceededEvent succeededEvent){
File file=getUploadedFile();
String format=theCanvas.getImportFormatShortFormat((String)importTypes.getValue());
try{
theCanvas.theDoc.importFrom(file.getPath(), format);
}catch(Exception ex){
reportMessage("Wrong format or invalid content");
}
if(LogUtils.hasLastError()){
reportMessage("Wrong format or invalid content");
}
LogUtils.clearLastError();
if(file.delete()==false){
reportException(new Exception("Unable to delete file: "+file.getPath()));
}
removeLocalResource(file);
}
@Override
public void uploadFailed(Message msg){
reportMessage(msg.getMessage());
}
};
uploader.setLocalResourceWatchers(localResourceWatchers);
List<String> importTypeList=theCanvas.getImportFormats();
importTypes=new ListSelect("Format", importTypeList);
importTypes.setNullSelectionAllowed(false);
importTypes.setValue(importTypeList.get(0));
canvasImportLayout.addComponent(importTypes);
canvasImportLayout.addComponent(uploader.getUploadComponent());
}
示例11: RUpload
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
/**
* Contruct an upload element for R (implemented as Vaadin CustomComponent).
*
* @param caption
* String caption or null
* @param R
* the corresponding RSession to upload the files to
*/
public RUpload(String caption, RContainer R) {
/* Create the RUpload custom component */
super.setSizeUndefined();
root = new Panel(caption);
root.setWidth("90ex");
setCompositionRoot(root);
HorizontalLayout hbox = new HorizontalLayout();
hbox.setWidth("100%");
/* Create the Upload component */
final Upload upload = new Upload("Choose file", this);
upload.setButtonCaption("Submit");
/* Listen for events regarding the success of upload. */
upload.addSucceededListener(this);
upload.addFailedListener(this);
hbox.addComponent(upload);
Label hfill = new Label();
hbox.addComponent(hfill);
hbox.setExpandRatio(hfill, 1.0f);
remove = new Button("Remove", new Button.ClickListener() {
private static final long serialVersionUID = 1L;
public void buttonClick(ClickEvent event) {
String current = getSelection();
if (current != null) {
/* Delete the file */
delete(current);
/* Update the lists and the notification area */
int i = fileNames.indexOf(current);
fileNames.remove(i);
mimeTypes.remove(i);
uploadedFiles.removeItem(current);
/* Gray out the button, if this was the last item */
if (fileNames.isEmpty()) {
remove.setEnabled(false);
}
}
}
});
hbox.addComponent(remove);
remove.setEnabled(false);
hbox.setComponentAlignment(remove, Alignment.BOTTOM_RIGHT);
/* Notification area for already uploaded files */
uploadedFiles = new ListSelect("Already submitted files");
uploadedFiles.setMultiSelect(false);
uploadedFiles.setNullSelectionAllowed(false);
uploadedFiles.setHeight("4em");
uploadedFiles.setWidth("100%");
// Changed for Vaadin 7, not tested!!
VerticalLayout vbox = new VerticalLayout();
vbox.addComponent(hbox);
vbox.addComponent(uploadedFiles);
root.setContent(vbox);
/* Bind the component to the given R session */
this.R = R;
}
示例12: getListSelect
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
/**
* <p>
* Returns a Vaadin ListSelect object with an implicit ValueChangeListener
* that writes the selected options directly to the R workspace. See also
* {@link RContainer#getOptionGroup}.
* </p>
*
* <p>
* For example, if R workspace contains the variable
* {@code classes <- c("A", "B", "C")"}, then
* {@code getListSelect("classes", "selected")} returns a ListSelect element
* which automatically updates the variable {@code "selected"} in R. The
* value can be e.g. {@code "A"}, or {@code c("A", "C")}, if we have in
* addition chosen {@code setMultiSelect(true)} for the element.
* </p>
*
* <p>
* The input options can be (re)set any time with
* {@link RContainer#buildSelectOptions}
* </p>
*
* <p>
* Observe that the separate element can be constructed step by step:<br>
* {@code R.eval("classes <- c('A', 'B', 'C')");} <br>
* {@code ListSelect chooseGroups = new ListSelect();} <br>
* {@code R.buildSelectOptions(chooseGroups, "classes");}<br>
* {@code R.buildSelectListener(chooseGroups, "selected");}
* </p>
*
*
* @param optionsInName
* The R character vector name to contain the different choices.
* Repeated elements will be ignored.
* @param selectedOutName
* The R character vector to immediately write the selection to.
* @return Vaadin ListSelect object
*/
public ListSelect getListSelect(String optionsInName,
final String selectedOutName) {
final ListSelect listselect = new ListSelect();
listselect.setNullSelectionAllowed(false);
buildSelectOptions(listselect, optionsInName);
buildSelectListener(listselect, selectedOutName);
return listselect;
}