List of usage examples for com.vaadin.ui VerticalLayout setSizeFull
@Override public void setSizeFull()
From source file:de.catma.ui.tagger.MarkupPanel.java
License:Open Source License
private void initComponents(PropertyChangeListener tagDefinitionSelectionListener, PropertyChangeListener tagDefinitionsRemovedListener) { tabSheet = new TabSheet(); tabSheet.setSizeFull();/*from w w w . j a va 2 s . c o m*/ VerticalLayout tabContent = new VerticalLayout(); tabContent.setSpacing(true); tabContent.setSizeFull(); Label helpLabel = new Label(); helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", application)); helpLabel.setWidth("20px"); helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Creating Tags</h4>" + "<ol><li>First you have to tell CATMA which Tagset you want to use. " + "Open a Tag Library from the Repository Manager and drag a Tagset to the \"Active Tagsets\" section." + " If you already have an active Tagset you want to use, you can skip this step.</li>" + "<li>Now you can select the Tagset and click the \"Create Tag\"-Button.</li></ol>" + "<h4>Tag this Source Document</h4>" + "<ol><li>First you have to tell CATMA which Tagset you want to use. " + "Open a Tag Library from the Repository Manager and drag a Tagset to the \"Active Tagsets\" section." + " If you already have an active Tagset you want to use, you can skip this step.</li>" + "<li>Now you can mark the text sequence you want to tag.</li><li>Click the colored button of the desired Tag to apply it to the marked sequence.</li></ol> " + "When you click on a tagged text, i. e. a text that is underlined with colored bars you should see " + "the available Tag Instances in the section on the lower right of this view."); tabContent.addComponent(helpLabel); tabContent.setComponentAlignment(helpLabel, Alignment.MIDDLE_RIGHT); tagsetTree = new TagsetTree(repository.getTagManager(), null, false, colorButtonListener); tabContent.addComponent(tagsetTree); tabContent.setExpandRatio(tagsetTree, 1.0f); tabSheet.addTab(tabContent, "Active Tagsets"); markupCollectionsPanel = new MarkupCollectionsPanel(repository); markupCollectionsPanel.addPropertyChangeListener(MarkupCollectionPanelEvent.tagDefinitionSelected, tagDefinitionSelectionListener); markupCollectionsPanel.addPropertyChangeListener(MarkupCollectionPanelEvent.tagDefinitionsRemoved, tagDefinitionsRemovedListener); markupCollectionsPanel.addPropertyChangeListener(MarkupCollectionPanelEvent.userMarkupCollectionSelected, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValue() != null) { writableUserMarkupCollectionLabel.setValue(evt.getNewValue()); } else { writableUserMarkupCollectionLabel.setValue(""); } colorButtonListener.setEnabled(evt.getNewValue() != null); } }); tabSheet.addTab(markupCollectionsPanel, "Active Markup Collections"); addComponent(tabSheet); Component markupInfoPanel = createInfoPanel(); addComponent(markupInfoPanel); }
From source file:de.catma.ui.tagger.PropertyEditDialog.java
License:Open Source License
private void initComponents() { VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setMargin(true);//from w ww. j a v a 2 s . c om mainLayout.setSpacing(true); mainLayout.setSizeFull(); hintText = new Label("Please use the check boxes to set or unset values."); mainLayout.addComponent(hintText); propertyTree = new TreeTable(); propertyTree.setSelectable(true); propertyTree.setSizeFull(); propertyTree.setPageLength(10); propertyTree.setImmediate(true); propertyTree.focus(); propertyTree.addShortcutListener( new AbstractField.FocusShortcut(propertyTree, KeyCode.ARROW_UP, ModifierKey.CTRL)); propertyTree.addContainerProperty(TreePropertyName.property, String.class, ""); propertyTree.setColumnHeader(TreePropertyName.property, "Property"); propertyTree.addContainerProperty(TreePropertyName.icon, Resource.class, ""); propertyTree.addContainerProperty(TreePropertyName.value, String.class, ""); propertyTree.setColumnHeader(TreePropertyName.value, "Value"); propertyTree.addContainerProperty(TreePropertyName.assigned, CheckBox.class, ""); propertyTree.setColumnHeader(TreePropertyName.assigned, "Assigned"); propertyTree.setItemCaptionPropertyId(TreePropertyName.property); propertyTree.setItemIconPropertyId(TreePropertyName.icon); propertyTree.setVisibleColumns( new Object[] { TreePropertyName.property, TreePropertyName.value, TreePropertyName.assigned }); mainLayout.addComponent(propertyTree); mainLayout.setExpandRatio(propertyTree, 1.0f); HorizontalLayout comboBox = new HorizontalLayout(); comboBox.setSpacing(true); newValueInput = new FilterExposingComboBox("Add ad hoc value"); newValueInput.setTextInputAllowed(true); newValueInput.setNewItemsAllowed(true); newValueInput.setImmediate(true); newValueInput.addShortcutListener( new AbstractField.FocusShortcut(newValueInput, KeyCode.ARROW_DOWN, ModifierKey.CTRL)); comboBox.addComponent(newValueInput); btAdd = new Button("+"); btAdd.setClickShortcut(KeyCode.INSERT); comboBox.addComponent(btAdd); comboBox.setComponentAlignment(btAdd, Alignment.BOTTOM_RIGHT); mainLayout.addComponent(comboBox); hintText = new Label("New property values, that are created ad hoc, exist only for this tag instance! " + "For the creation of new systematic values use the Tag Type Manager."); mainLayout.addComponent(hintText); HorizontalLayout buttonPanel = new HorizontalLayout(); buttonPanel.setSpacing(true); btSave = new Button("Save"); btSave.setClickShortcut(KeyCode.ENTER, ModifierKey.ALT); buttonPanel.addComponent(btSave); buttonPanel.setComponentAlignment(btSave, Alignment.MIDDLE_RIGHT); btCancel = new Button("Cancel"); btCancel.setClickShortcut(KeyCode.ESCAPE); buttonPanel.addComponent(btCancel); buttonPanel.setComponentAlignment(btCancel, Alignment.MIDDLE_RIGHT); mainLayout.addComponent(buttonPanel); mainLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_RIGHT); setContent(mainLayout); setWidth("40%"); setHeight("80%"); setModal(true); center(); }
From source file:de.dimm.vsm.vaadin.VSMCMain.java
public <T> void SelectObject(Class<T> t, String caption, String buttonCaption, List<T> list, final SelectObjectCallback cb) { if (list.size() == 1) { cb.SelectedAction(list.get(0));/*from ww w . ja va 2s. c om*/ return; } final NativeSelect sel = new NativeSelect(caption); sel.setNewItemsAllowed(false); sel.setInvalidAllowed(false); sel.setNullSelectionAllowed(false); for (int i = 0; i < list.size(); i++) { Object object = list.get(i); sel.addItem(object); } if (!list.isEmpty()) sel.setValue(list.get(0)); VerticalLayout vl = new VerticalLayout(); vl.setSpacing(true); NativeButton ok = new NativeButton(buttonCaption); final Window win = new Window(Txt("Auswahl") + " " + caption); win.setWidth("350px"); win.center(); ok.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { getRootWin().removeWindow(win); cb.SelectedAction(sel.getValue()); } }); vl.addComponent(sel); sel.setWidth("80%"); vl.addComponent(ok); vl.setComponentAlignment(ok, Alignment.BOTTOM_RIGHT); vl.setSizeFull(); win.addComponent(vl); getRootWin().addWindow(win); }
From source file:de.fatalix.lighty.web.LightyApp.java
@Override protected void init(VaadinRequest request) { setSizeFull();//from w w w . ja v a 2 s . c o m VerticalLayout navigatorLayout = new VerticalLayout(); navigatorLayout.setSizeFull(); navigatorLayout.setSpacing(true); Panel contentPanel = new Panel(navigatorLayout); contentPanel.setSizeFull(); contentPanel.addStyleName(LightyTheme.BACKGROUND); Navigator navigator = new Navigator(LightyApp.this, contentPanel); navigator.addProvider(viewProvider); VerticalLayout rootLayout = new VerticalLayout(); rootLayout.addComponent(new LightyHeader()); rootLayout.addComponent(new LightyNavigation()); rootLayout.addComponent(notificationBar); rootLayout.addComponent(contentPanel); rootLayout.setExpandRatio(contentPanel, 1.0f); rootLayout.setSizeFull(); setContent(rootLayout); }
From source file:de.fatalix.lighty.web.ui.configuration.ConfigurationViewImpl.java
@Override public void enter(ViewChangeListener.ViewChangeEvent event) { VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSizeFull(); mainLayout.setMargin(new MarginInfo(true, true, true, true)); final InlineEditField lightBridgeURL = new InlineEditField("LightBridge URL", "", true); lightBridgeURL.setId(SettingKey.SVNURL.getKey()); lightBridgeURL.addValueChangeListener(new Property.ValueChangeListener() { @Override/* w w w.jav a 2 s.c o m*/ public void valueChange(Property.ValueChangeEvent event) { saveEvent.select(new AnnotationLiteral<ConfigurationPresenter.Save>() { }).fire(new ConfigurationPresenter.SaveConfiguration() { @Override public String getValue() { return lightBridgeURL.getValue(); } @Override public String getKey() { return SettingKey.SVNURL.getKey(); } @Override public void showStatus(String message) { notificationEvent.select(new AnnotationLiteral<LightyNotificationBar.ShowNotification>() { }).fire(message); } }); } }); final InlineEditField lightBridgeUser = new InlineEditField("User", "", true); lightBridgeUser.setId(SettingKey.SVNUSER.getKey()); lightBridgeUser.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { saveEvent.select(new AnnotationLiteral<ConfigurationPresenter.Save>() { }).fire(new ConfigurationPresenter.SaveConfiguration() { @Override public String getValue() { return lightBridgeUser.getValue(); } @Override public String getKey() { return SettingKey.SVNUSER.getKey(); } @Override public void showStatus(String message) { notificationEvent.select(new AnnotationLiteral<LightyNotificationBar.ShowNotification>() { }).fire(message); } }); } }); Button checkConfiguration = new Button("check", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { testConnectEvent.select(new AnnotationLiteral<ConfigurationPresenter.TestConfig>() { }).fire(new ConfigurationPresenter.TestConfiguration() { @Override public void showStatus(String message) { notificationEvent.select(new AnnotationLiteral<LightyNotificationBar.ShowNotification>() { }).fire(message); } }); } }); configurationFields.put(SettingKey.SVNURL.getKey(), lightBridgeURL); configurationFields.put(SettingKey.SVNUSER.getKey(), lightBridgeUser); mainLayout.addComponents(lightBridgeURL, lightBridgeUser, checkConfiguration); setCompositionRoot(mainLayout); loadEvent.select(new AnnotationLiteral<ConfigurationPresenter.Load>() { }).fire(new ConfigurationPresenter.LoadConfiguration() { @Override public void loadConfiguration(List<LightyConfiguration> configuration) { for (LightyConfiguration configurationEntry : configuration) { configurationFields.get(configurationEntry.getConfigurationKey()) .setFieldValue(configurationEntry.getConfigurationValue()); } } }); }
From source file:de.fatalix.timeline.web.VaadinWebProjectApp.java
@Override protected void init(VaadinRequest request) { setSizeFull();/*from w w w . ja v a 2 s .c o m*/ VerticalLayout navigatorLayout = new VerticalLayout(); navigatorLayout.setSizeFull(); navigatorLayout.setSpacing(true); Panel contentPanel = new Panel(navigatorLayout); contentPanel.setSizeFull(); Navigator navigator = new Navigator(VaadinWebProjectApp.this, contentPanel); navigator.addProvider(viewProvider); VerticalLayout rootLayout = new VerticalLayout(); //rootLayout.addComponent(header); rootLayout.addComponent(contentPanel); rootLayout.setExpandRatio(contentPanel, 1.0f); rootLayout.setSizeFull(); setContent(rootLayout); }
From source file:de.gedoplan.webclients.vaadin.LoginUi.java
@Override protected void init(VaadinRequest request) { TextField name = new TextField(Messages.login_name.value()); name.focus();/* w ww . ja va2s. c o m*/ PasswordField password = new PasswordField(Messages.login_password.value()); Button login = new Button(Messages.login_submit.value(), e -> { try { JaasAccessControl.login(name.getValue(), password.getValue()); Page.getCurrent().setLocation(Konstanten.VAADIN_UI_PATH); } catch (ServletException ex) { Notification.show(Messages.login_invalid.value(), Notification.Type.ERROR_MESSAGE); } }); login.setClickShortcut(ShortcutAction.KeyCode.ENTER); FormLayout fieldLayout = new FormLayout(name, password, login); fieldLayout.setMargin(true); fieldLayout.setSpacing(true); Panel loginPanel = new Panel(Messages.login_title.value(), fieldLayout); loginPanel.setSizeUndefined(); VerticalLayout page = new VerticalLayout(); page.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); page.addComponent(loginPanel); page.setSizeFull(); setContent(page); }
From source file:de.gedoplan.webclients.vaadin.VaadinDemoUi.java
@Override protected void init(VaadinRequest request) { if (!accessControl.isUserSignedIn()) { close();/*from w w w .j a v a 2s .com*/ Page.getCurrent().setLocation(Konstanten.VAADIN_LOGIN_PATH); return; } VerticalLayout page = new VerticalLayout(); setContent(page); VerticalLayout content = new VerticalLayout(); content.setSizeFull(); page.addComponents(createMenu(), content, createFooter()); page.setExpandRatio(content, 1); page.setSizeFull(); navigator = new Navigator(this, content); navigator.addProvider(cDIViewProvider); navigator.setErrorView(ErrorView.class); }
From source file:de.gedoplan.webclients.vaadin.VaadinDemoUi.java
public Panel createFooter() { Panel footer = new Panel(); footer.setStyleName(ValoTheme.PANEL_WELL); footer.setHeight(75, Unit.PIXELS);// w w w. j ava2s .com Label footerText = new Label(" 2016 gedoplan.de"); footerText.setSizeUndefined(); VerticalLayout footerLayout = new VerticalLayout(); footerLayout.setSizeFull(); footerLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); footerLayout.addComponent(footerText); footer.setContent(footerLayout); return footer; }
From source file:de.kaiserpfalzEdv.vaadin.about.AboutViewImpl.java
License:Apache License
private VerticalLayout createVerticalLayout(final String caption, final String description, Resource icon) { VerticalLayout result = new VerticalLayout(); result.setSizeFull(); result.setSpacing(true);/*from w ww .j av a 2s. com*/ result.setResponsive(true); if (caption != null) result.setCaption(presenter.translate(caption)); if (description != null) result.setDescription(presenter.translate(description)); if (icon != null) result.setIcon(icon); return result; }