List of usage examples for com.vaadin.ui VerticalLayout setSpacing
@Override public void setSpacing(boolean spacing)
From source file:de.catma.ui.tagger.MarkupPanel.java
License:Open Source License
private Component createInfoPanel() { VerticalLayout markupInfoPanel = new VerticalLayout(); markupInfoPanel.setSpacing(true); writableUserMarkupCollectionLabel = new Label(); writableUserMarkupCollectionLabel.addStyleName("bold-label-caption"); writableUserMarkupCollectionLabel.setCaption("Writable Markup Collection:"); markupInfoPanel.addComponent(writableUserMarkupCollectionLabel); tagInstancesTree = new TagInstanceTree(this); tagInstancesTree.setSizeFull();/*from ww w . j a va2 s .c o m*/ markupInfoPanel.addComponent(tagInstancesTree); return 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 www.j a va 2 s. c o m*/ 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.catma.ui.tagger.TaggerView.java
License:Open Source License
private void initComponents(Application application) { setSizeFull();/* w w w. j av a2 s .c om*/ VerticalLayout taggerPanel = new VerticalLayout(); taggerPanel.setSpacing(true); Label helpLabel = new Label(); helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", application)); helpLabel.setWidth("20px"); helpLabel.setDescription("<h3>Hints</h3>" + "<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.</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."); pager = new Pager(taggerID, 80, 30); tagger = new Tagger(taggerID, pager, this); tagger.addStyleName("tagger"); tagger.setWidth("550px"); taggerPanel.addComponent(tagger); // Panel actionPanel = new Panel(new HorizontalLayout()); // ((HorizontalLayout)actionPanel.getContent()).setSpacing(true); HorizontalLayout actionPanel = new HorizontalLayout(); actionPanel.setSpacing(true); taggerPanel.addComponent(actionPanel); pagerComponent = new PagerComponent(pager, new PageChangeListener() { public void pageChanged(int number) { tagger.setPage(number); } }); actionPanel.addComponent(helpLabel); actionPanel.addComponent(pagerComponent); btAnalyze = new Button("Analyze Document"); btAnalyze.setEnabled(repository instanceof IndexedRepository); actionPanel.addComponent(btAnalyze); linesPerPageSlider = new Slider("page size zoom", 1, 100, "%"); linesPerPageSlider.setImmediate(true); linesPerPageSlider.setWidth("150px"); actionPanel.addComponent(linesPerPageSlider); markupPanel = new MarkupPanel(repository, new ColorButtonListener() { private boolean enabled = false; public void colorButtonClicked(TagDefinition tagDefinition) { if (enabled) { tagger.addTagInstanceWith(tagDefinition); } else { getWindow().showNotification( "Information", "Please select a User Markup Collection " + " to store your markup first!<br>" + "See 'Active Markup Collections'.", Notification.TYPE_TRAY_NOTIFICATION); } } public void setEnabled(boolean enabled) { this.enabled = enabled; } }, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { boolean selected = evt.getNewValue() != null; @SuppressWarnings("unchecked") List<TagReference> tagReferences = (List<TagReference>) (selected ? evt.getNewValue() : evt.getOldValue()); tagger.setVisible(tagReferences, selected); } }, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { @SuppressWarnings("unchecked") Set<TagDefinition> removedTagDefinitions = (Set<TagDefinition>) evt.getOldValue(); pager.removeTagInstances(removedTagDefinitions); tagger.setPage(pager.getCurrentPageNumber()); } }); HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.addComponent(taggerPanel); splitPanel.addComponent(markupPanel); addComponent(splitPanel); }
From source file:de.decidr.ui.view.help.HelpDialogComponent.java
License:Apache License
public HelpDialogComponent() { super("DecidR Help"); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSpacing(true); horLayout = new HorizontalLayout(); horLayout.setSpacing(false);//from w w w . j a v a 2 s .c om layout.addComponent(horLayout); horLayout.setSizeFull(); closeButton = new Button("Close", new HideHelpDialogAction()); showMainScreenHelp = new Button("Show in main window", new HideHelpDialogAction()); showMainScreenHelp.addListener(new ShowHelpAction()); acc = new Accordion(); acc.setSizeFull(); acc.addTab(new AccountManagementHelpComponent(), "Account Management", null); acc.addTab(new WorkflowParticipationHelpComponent(), "Workflow Participation", null); acc.addTab(new WorkflowInstanceManagementHelpComponent(), "Workflow Instance Management", null); acc.addTab(new TenantSettingsHelpComponent(), "Tenant Settings", null); acc.addTab(new TenantUserManagementHelpComponent(), "Tenant User Management", null); acc.addTab(new WorkflowModelingHelpComponent(), "Workflow Modeling", null); acc.addTab(new WorkflowModelEditorHelpComponent(), "Workflow Model Editor", null); acc.addTab(new TenantMonitoringHelpComponent(), "Tenant Monitoring", null); acc.addTab(new SystemSettingsHelpComponent(), "System Settings", null); acc.addTab(new SystemStatusHelpComponent(), "System Status", null); acc.addTab(new UserManagementHelpComponent(), "User Management", null); acc.addTab(new TenantManagementHelpComponent(), "Tenant Management", null); acc.addTab(new GlossaryHelpComponent(), "Glossary", null); horLayout.addComponent(showMainScreenHelp); horLayout.setComponentAlignment(showMainScreenHelp, Alignment.TOP_LEFT); horLayout.addComponent(closeButton); horLayout.setComponentAlignment(closeButton, Alignment.TOP_RIGHT); layout.addComponent(acc); }
From source file:de.decidr.ui.view.windows.StartConfigurationWindow.java
License:Apache License
private void init() { VerticalLayout mainVerticalLayout = new VerticalLayout(); HorizontalLayout buttonHorizontalLayout = new HorizontalLayout(); checkBox = new CheckBox(); this.setContent(mainVerticalLayout); this.setCaption("Start configuration window"); this.setModal(true); this.setWidth("800px"); this.setHeight("500px"); this.setResizable(false); mainVerticalLayout.setSpacing(true); mainVerticalLayout.setMargin(true);// www . j a va2 s .co m if (workflow.getVariables() != null && workflow.getVariables().getVariable().size() > 0) { configVariableForm = new ConfigVariableForm(workflow.getVariables()); configVariableForm.setCaption("Configuration variables"); configVariableForm.setWriteThrough(false); configVariableForm.setInvalidCommitted(false); } if (workflow.getRoles() != null) { configRoles = new ConfigRoles(workflow.getRoles()); } if (configRoles != null && configVariableForm != null) { // Set up split panel. SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_HORIZONTAL); splitPanel.setSplitPosition(450, Sizeable.UNITS_PIXELS); splitPanel.setHeight("400px"); splitPanel.setLocked(true); splitPanel.setFirstComponent(configRoles); splitPanel.setSecondComponent(configVariableForm); mainVerticalLayout.addComponent(splitPanel); } else { // At least one of the components is unneeded, so no split panel this.setWidth("600px"); if (configRoles != null) { mainVerticalLayout.addComponent(configRoles); } else if (configVariableForm != null) { mainVerticalLayout.addComponent(configVariableForm); } } okButton = new Button("OK", new SaveStartConfigurationAction(configRoles, configVariableForm, tConfiguration, workflowModelId, checkBox.booleanValue())); cancelButton = new Button("Cancel", new HideDialogWindowAction()); mainVerticalLayout.addComponent(buttonHorizontalLayout); buttonHorizontalLayout.setSpacing(true); buttonHorizontalLayout.addComponent(checkBox); checkBox.setCaption("Start Immediately"); buttonHorizontalLayout.setComponentAlignment(checkBox, Alignment.MIDDLE_RIGHT); buttonHorizontalLayout.addComponent(okButton); buttonHorizontalLayout.addComponent(cancelButton); }
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));//ww w. j a va2 s .c o m 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.bookery.AppHeader.java
License:Open Source License
private MHorizontalLayout createSmallNavBar() { Button homeButton = new Button("Home", new Button.ClickListener() { @Override/*from w w w. ja va2 s. c o m*/ public void buttonClick(Button.ClickEvent event) { ((App) UI.getCurrent()).getNavigator().navigateTo(HomeView.id); //bookMenuLayout.setLayoutVisible(true); } }); homeButton.addStyleName(ValoTheme.BUTTON_TINY); Button plainSearchButton = new Button("einfach stbern", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { ((App) UI.getCurrent()).getNavigator().navigateTo(SearchView.id + "/author"); } }); plainSearchButton.addStyleName(ValoTheme.BUTTON_TINY); Button newBooks = new Button("neue Bcher", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { ((App) UI.getCurrent()).getNavigator().navigateTo(SearchView.id + "/author/true"); } }); newBooks.addStyleName(ValoTheme.BUTTON_TINY); Button bestBooks = new Button("Die besten Bcher", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { ((App) UI.getCurrent()).getNavigator().navigateTo(SearchView.id + "/likes"); } }); bestBooks.addStyleName(ValoTheme.BUTTON_TINY); logoutButton = new Button("Hallo", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { ((App) UI.getCurrent()).logout(); } }); logoutButton.addStyleName(ValoTheme.BUTTON_BORDERLESS); logoutButton.addStyleName(ValoTheme.BUTTON_SMALL); VerticalLayout buttonLayout = new VerticalLayout(logoutButton); buttonLayout.setMargin(false); buttonLayout.setSpacing(false); buttonLayout.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT); MHorizontalLayout layout = new MHorizontalLayout(homeButton, plainSearchButton, newBooks, bestBooks, buttonLayout); layout.expand(buttonLayout); return layout; }
From source file:de.fatalix.bookery.view.common.BookDetailLayout.java
License:Open Source License
@PostConstruct private void postInit() { addStyleName("product-form-wrapper"); addStyleName("product-form"); titleLabel = new Label("Title - Author"); titleLabel.addStyleName(ValoTheme.LABEL_COLORED); titleLabel.addStyleName(ValoTheme.LABEL_BOLD); descriptionLabel = new Label("Description", ContentMode.HTML); descriptionLabel.addStyleName(ValoTheme.LABEL_LIGHT); descriptionLabel.setValue("Keine Beschreibung vorhanden"); cancelButton = new Button("close", new Button.ClickListener() { @Override/* w ww . ja va 2 s .c om*/ public void buttonClick(Button.ClickEvent event) { setLayoutVisible(false); } }); cancelButton.setClickShortcut(ShortcutAction.KeyCode.ESCAPE); cancelButton.addStyleName(ValoTheme.BUTTON_DANGER); VerticalLayout rootLayout = new VerticalLayout(titleLabel, createImageLayout(), descriptionLabel, cancelButton); rootLayout.setSpacing(true); addComponent(rootLayout); }
From source file:de.fatalix.bookery.view.common.BookDetailLayout.java
License:Open Source License
private HorizontalLayout createImageLayout() { image = new Image(); image.setImmediate(true);/*from ww w. jav a2 s. c om*/ image.setHeight("200px"); image.setWidth("130px"); downloadButton = new Button("download", FontAwesome.DOWNLOAD); downloadButton.addStyleName(ValoTheme.BUTTON_FRIENDLY); downloadButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { loadData(presenter.updateShared(bookEntry, SecurityUtils.getSubject().getPrincipal().toString())); } catch (SolrServerException | IOException ex) { Notification.show("Unexpected Error!\n" + ex.getMessage(), Notification.Type.ERROR_MESSAGE); logger.error(ex, ex); } } }); fileDownloader = new FileDownloader(new StreamResource(new BookStreamSource(null), "blbla.epub")); fileDownloader.extend(downloadButton); sendToKindleButton = new Button("Kindle", FontAwesome.BOOK); sendToKindleButton.addStyleName(ValoTheme.BUTTON_FRIENDLY); sendToKindleButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { presenter.shareBookWithKindle(bookEntry, SecurityUtils.getSubject().getPrincipal().toString()); Notification.show("Book is sent to kindle", Notification.Type.HUMANIZED_MESSAGE); loadData(presenter.updateShared(bookEntry, SecurityUtils.getSubject().getPrincipal().toString())); } catch (SolrServerException | IOException | MessagingException ex) { Notification.show("Unexpected Error!\n" + ex.getMessage(), Notification.Type.ERROR_MESSAGE); logger.error(ex, ex); } } }); likeButton = new Button("0 likes", FontAwesome.THUMBS_O_UP); likeButton.addStyleName(ValoTheme.BUTTON_LINK); likeButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { BookEntry updatedEntry = presenter.updateLike(bookEntry, SecurityUtils.getSubject().getPrincipal().toString()); loadData(updatedEntry); } catch (SolrServerException | IOException ex) { Notification.show("Unexpected Error!\n" + ex.getMessage(), Notification.Type.ERROR_MESSAGE); logger.error(ex, ex); } } }); watchListButton = new Button("merken", FontAwesome.STAR_O); watchListButton.addStyleName(ValoTheme.BUTTON_LINK); watchListButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { presenter.addRemoveFromWatchList(bookEntry, SecurityUtils.getSubject().getPrincipal().toString()); loadData(bookEntry); } }); downloadCount = new Label("0 downloads"); VerticalLayout rightLayout = new VerticalLayout(sendToKindleButton, downloadButton, watchListButton, likeButton, downloadCount); rightLayout.setComponentAlignment(downloadCount, Alignment.MIDDLE_CENTER); rightLayout.setSpacing(true); HorizontalLayout layout = new HorizontalLayout(image, rightLayout); layout.setSpacing(true); return layout; }
From source file:de.fatalix.bookery.view.common.BookMenuLayout.java
@PostConstruct private void postInit() { addStyleName("bookery-menu-wrapper"); addStyleName("bookery-menu"); Label titleLabel = new Label("Bookery Menu"); titleLabel.addStyleName(ValoTheme.LABEL_COLORED); titleLabel.addStyleName(ValoTheme.LABEL_BOLD); Button cancelButton = new Button("close", new Button.ClickListener() { @Override//ww w. j a va2 s .c o m public void buttonClick(Button.ClickEvent event) { setLayoutVisible(false); } }); cancelButton.setClickShortcut(ShortcutAction.KeyCode.ESCAPE); cancelButton.addStyleName(ValoTheme.BUTTON_DANGER); VerticalLayout rootLayout = new VerticalLayout(titleLabel, cancelButton); rootLayout.setSpacing(true); addComponent(rootLayout); }