List of usage examples for com.vaadin.ui NativeSelect NativeSelect
public NativeSelect()
From source file:org.vaadin.johannes.VaadingraphApplication.java
License:LGPL
private Component getLayoutSelect() { layoutSelect = new NativeSelect(); layoutSelect.setCaption("Layout algorithm"); layoutSelect.addContainerProperty("alg", CyLayoutAlgorithm.class, null); Item i = layoutSelect.addItem("Force Directed"); i.getItemProperty("alg").setValue(new ForceDirectedLayout()); i = layoutSelect.addItem("Hierarchical"); i.getItemProperty("alg").setValue(new HierarchicalLayoutAlgorithm()); i = layoutSelect.addItem("Grid"); i.getItemProperty("alg").setValue(new GridNodeLayout()); i = layoutSelect.addItem("Circular"); i.getItemProperty("alg").setValue(new CircularLayoutAlgorithm()); layoutSelect.setNullSelectionAllowed(false); layoutSelect.setImmediate(true);// w w w . j a v a 2s . c om layoutSelect.select("Force Directed"); layoutSelect.addListener(new Property.ValueChangeListener() { private static final long serialVersionUID = 3668584778868323776L; public void valueChange(final ValueChangeEvent event) { reLayout = true; loAlgorithm = (CyLayoutAlgorithm) layoutSelect.getItem(layoutSelect.getValue()) .getItemProperty("alg").getValue(); final VaadinGraph g = getNetworkGraph(WIDTH, HEIGHT); hl2.replaceComponent(graph, g); graph = g; } }); return layoutSelect; }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.PopupRecombineDiseaseGroups.java
public PopupRecombineDiseaseGroups(QuantCentralManager Quant_Central_Manager) { // super(" "); this.diseaseStyleMap = Quant_Central_Manager.getDiseaseStyleMap(); default_DiseaseCat_DiseaseGroupMap = new LinkedHashMap<String, Map<String, String>>( Quant_Central_Manager.getDefault_DiseaseCat_DiseaseGroupMap()); this.setStyleName("merge"); this.setDescription("Recombine disease groups"); this.Quant_Central_Manager = Quant_Central_Manager; captionAstrMap = new HashMap<String, Integer>(); this.addLayoutClickListener(PopupRecombineDiseaseGroups.this); this.popupBodyLayout = new VerticalLayout(); VerticalLayout windowLayout = new VerticalLayout(); popupWindow = new Window() { @Override/* w ww . ja v a 2s .com*/ public void close() { popupWindow.setVisible(false); } }; popupWindow.setContent(windowLayout); windowLayout.addComponent(popupBodyLayout); windowLayout.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(true); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(false); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Recombine Disease Groups</font>"); popupWindow.setCaptionAsHtml(true); popupBodyLayout.setStyleName(Reindeer.LAYOUT_WHITE); popupBodyLayout.setHeightUndefined();//(h - 50) + "px"); popupWindow.setWindowMode(WindowMode.NORMAL); diseaseTypeSelectionList = new NativeSelect(); this.initPopupLayout(); UI.getCurrent().addWindow(popupWindow); popupWindow.center(); }
From source file:qbic.vaadincomponents.GroupSpecificParameterComponent.java
License:Open Source License
private FormLayout initParameters() { // select the type FormLayout parameterLayout = new FormLayout(); labelfreequant = new CheckBox(); labelfreequant.setCaption("Label-Free Quantification"); parameterLayout.addComponent(labelfreequant); typeSelect = new NativeSelect(); typeSelect.setCaption("Type"); typeSelect.addItem("Standard"); typeSelect.addItem("Reporter Ion"); // add it//from ww w . jav a2s . com parameterLayout.addComponent(typeSelect); // select multiplicity. multiplicitySelect = new NativeSelect(); multiplicitySelect.setCaption("Multiplicity"); multiplicitySelect.addItem("1 - label-free quantification"); multiplicitySelect.addItem("2 - light and heavy labels"); multiplicitySelect.addItem("3 - light, medium, and heavy lables"); multiplicitySelect.setNullSelectionAllowed(false); parameterLayout.addComponent(multiplicitySelect); // add labels labels = new QuantificationLabelComponent(); parameterLayout.addComponent(labels); multiplicitySelect.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 2788813707970284834L; @Override public void valueChange(ValueChangeEvent event) { String multiplicity = (String) event.getProperty().getValue(); if (multiplicity.startsWith("1")) { labels.noLables(); } else if (multiplicity.startsWith("2")) { labels.lightAndHeavyLabels(); } else if (multiplicity.startsWith("3")) { labels.lightMediumAndHeavyLabels(); } } }); parameterLayout.addComponent(labels); // variable modifications variableModifications = new TwinColSelect("Variable Modifications"); variableModifications.addItems("Acetyl (Protein N-term)", "Acetyl (K)", "Oxidation (M)", "Ala->Arg"); parameterLayout.addComponent(variableModifications); // digestion mode digestionMode = new NativeSelect("Digestion mode"); digestionMode.addItem("Specific"); parameterLayout.addComponent(digestionMode); // enzyme enzyme = new TwinColSelect("Enzyme"); enzyme.addItems("Trypsin/P", "ArgC", "Trypsin", "GluN"); parameterLayout.addComponent(enzyme); // missed cleavage missedcleavage = new TextField("Max Missed Cleavage"); parameterLayout.addComponent(missedcleavage); matchType = new NativeSelect("Match type"); matchType.addItem("MatchFromAndTo"); parameterLayout.addComponent(matchType); return parameterLayout; }