/** * Add component to detail-container. */ public void addDetailComponent(Component c) { mainPanel.addComponent(c); }
@Override public void addComponent(Component c) { mainPanel.addComponent(c); }
@Override public void addChild(ProcessToolWidget child) { if (!(child instanceof ProcessToolVaadinRenderable)) { throw new IllegalArgumentException("child is not instance of " + ProcessToolVaadinRenderable.class.getName()); } ProcessToolVaadinRenderable vChild = (ProcessToolVaadinRenderable) child; Component component = vChild.render(); panel.addComponent(component); }
protected void setContent(AbstractComponent c) { content.removeAllComponents(); content.addComponent(c); }
public void buttonClick(ClickEvent event) { // Remove button addSubTaskPanel.removeAllComponents(); // And add textfield Label createSubTaskLabel = new Label("Create new subtask:"); createSubTaskLabel.addStyleName(Reindeer.LABEL_SMALL); addSubTaskPanel.addComponent(createSubTaskLabel); newTaskTextField = new TextField(); newTaskTextField.focus(); addSubTaskPanel.addComponent(newTaskTextField); } });
public static Panel panel(String title, com.vaadin.ui.Component... components) { Panel p = new Panel(); p.setWidth(100, Sizeable.UNITS_PERCENTAGE); p.setCaption(title); for (com.vaadin.ui.Component c : components) { p.addComponent(c); } return p; }
protected void initAddButton() { addSubTaskButton = new Button(); addSubTaskButton.addStyleName(ExplorerLayout.STYLE_ADD); addSubTaskPanel.addComponent(addSubTaskButton); addSubTaskButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { // Remove button addSubTaskPanel.removeAllComponents(); // And add textfield Label createSubTaskLabel = new Label("Create new subtask:"); createSubTaskLabel.addStyleName(Reindeer.LABEL_SMALL); addSubTaskPanel.addComponent(createSubTaskLabel); newTaskTextField = new TextField(); newTaskTextField.focus(); addSubTaskPanel.addComponent(newTaskTextField); } }); }
public OrganisaatioSearchPopup(OrganisaatioSearchTree orgSearch,List<String> oids) { orgSearchTree = orgSearch; orgSearchTree.init(); orgSearchTree.reloadWithOids(oids); root = new Panel(); root.setWidth(popupWidth); root.setHeight(popupHeight); root.addComponent(orgSearchTree); }
public OrganisaatioSearchPopup(OrganisaatioSearchTree orgSearch) { orgSearchTree = orgSearch; orgSearchTree.init(); orgSearchTree.reload(); root = new Panel(); root.setWidth(popupWidth); root.setHeight(popupHeight); root.addComponent(orgSearchTree); }
public void afterPropertiesSet() throws Exception { setSizeFull(); Panel panel = new Panel(); panel.setWidth("50%"); panel.addComponent(new Label(getI18nHTML(), Label.CONTENT_XHTML)); addComponent(panel); setComponentAlignment(panel, Alignment.MIDDLE_CENTER); m_OKButton = new Button("OK"); panel.addComponent(m_OKButton); m_OKButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 1904763239654990140L; public void buttonClick(ClickEvent event) { getViewManager().popScreen(); getViewManager().getMainWindow().requestRepaint(); } }); }
protected void addHtmlContent(String html) { Panel panel = new Panel(); panel.setWidth(800, UNITS_PIXELS); panel.setHeight(300, UNITS_PIXELS); content = new Label(html, Label.CONTENT_XHTML); content.setHeight(100, UNITS_PERCENTAGE); panel.addComponent(content); addComponent(panel); }
@Override public void addChild(ProcessToolWidget child) { if (!(child instanceof ProcessToolVaadinWidget)) { throw new IllegalArgumentException("child is not instance of " + ProcessToolVaadinWidget.class.getName()); } Component component; ProcessToolVaadinWidget vChild = (ProcessToolVaadinWidget) child; try { component = vChild.render(); } catch (Throwable e) { logger.log(Level.SEVERE, e.getMessage(), e); Panel p = new Panel(); VerticalLayout vl = new VerticalLayout(); vl.addComponent(new Label(getMessage("process.data.widget.exception-occurred"))); vl.addComponent(new Label(e.getMessage())); ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintWriter(baos)); vl.addComponent(new Label("<pre>" + baos.toString() + "</pre>", CONTENT_XHTML)); vl.addStyleName("error"); p.addComponent(vl); p.setHeight("150px"); component = p; } ts.addTab(component, getMessage(child.getAttributeValue("caption")), null); if (ts.getSelectedTab() == null) ts.setSelectedTab(component); }
private void wrapWithModalWindow(Form form) { Panel panel = new Panel(); panel.setWidth("800px"); panel.setScrollable(true); panel.addComponent(form); setDetailsWindow(modalWindow(getMessage("dict.item"), panel)); }
private void initializeComponents() { root = new Panel(); Layout horizontalLayout = new HorizontalLayout(); searchField = new TextField(); horizontalLayout.addComponent(searchField); searchField.setImmediate(true); searchField.addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { searchTextChanged((String) searchField.getValue()); } }); root.addComponent(horizontalLayout); root.addComponent(organizationTree); organizationTree.setItemCaptionPropertyId("caption"); organizationTree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY); organizationTree.setImmediate(true); addComponent(root); }
private void displaySelectedDictionary() { String dictionaryId = getCurrentDictionaryId(); String languageCode = getCurrentLanguageCode(); dictionaryLayout.removeAllComponents(); if (dictionaryId != null && languageCode != null) { HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); hl.addComponent(dictionaryNameField); hl.addComponent(dictionaryDescriptionField); HorizontalLayout hl2 = new HorizontalLayout(); hl2.setSpacing(true); hl2.addComponent(editPermissionField); container = new BeanItemContainer<XmlDictionaryItemWrapper>(XmlDictionaryItemWrapper.class, processDictionaries.getItems(dictionaryId, languageCode)); bindProperty(dictionaryNameField, getCurrentDictionary(), _DICTIONARY_NAME); bindProperty(dictionaryDescriptionField, getCurrentDictionary(), _DESCRIPTION); bindProperty(editPermissionField, getCurrentDictionary(), _EDIT_PERMISSION); dictionaryLayout.addComponent(hl); dictionaryLayout.addComponent(hl2); dictionaryLayout.addComponent(getAddEntryButton()); dictionaryLayout.addComponent(builder.createTable(container)); } }
protected void addDropPanel() { Panel dropPanel = new Panel(); DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(dropPanel); dragAndDropWrapper.setDropHandler(this); dragAndDropWrapper.setWidth("80%"); addComponent(dragAndDropWrapper); setComponentAlignment(dragAndDropWrapper, Alignment.MIDDLE_CENTER); Label dropLabel = new Label(i18nManager.getMessage(Messages.UPLOAD_DROP)); dropLabel.setSizeUndefined(); dropPanel.addComponent(dropLabel); ((VerticalLayout)dropPanel.getContent()).setComponentAlignment(dropLabel, Alignment.MIDDLE_CENTER); }
private Panel getInitedWidgetTreePanel() { widgetTree.setContainerDataSource(hierarchicalContainer); widgetTree.setDragMode(Tree.TreeDragMode.NODE); widgetTree.setItemCaptionPropertyId("name"); widgetTree.setDropHandler(new TreeSortDropHandler(widgetTree, hierarchicalContainer)); widgetTree.setWidth("100%"); widgetTree.addShortcutListener(getDeleteShortcutListener()); Panel panel = new Panel(getLocalizedMessage("widget-hierarchy")); panel.setHeight("340px"); panel.setWidth("250px"); panel.addComponent(widgetTree); return panel; }
panelLayout.setSizeUndefined(); imagePanel.setContent(panelLayout); imagePanel.addComponent(diagram);
textFieldPanel.addComponent(commentInputField);
private VerticalLayout buildWidgetEditorTabContent() { I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource(); VerticalLayout availableWidgetsLayout = new VerticalLayout(); availableWidgetsLayout.setSpacing(true); availableWidgetsLayout.setWidth("100%"); availableWidgetsLayout.addComponent(availableWidgetsPane); VerticalLayout stepLayout = new VerticalLayout(); stepLayout.setWidth("100%"); stepLayout.setSpacing(true); stepLayout.setMargin(true); stepLayout.addComponent(new Label(messages.getMessage("userstep.editor.widgets.instructions"), Label.CONTENT_XHTML)); stepLayout.addComponent(availableWidgetsLayout); Panel treePanel = new Panel(); treePanel.setStyleName(Reindeer.PANEL_LIGHT); treePanel.addComponent(stepTree); treePanel.setWidth("245px"); HorizontalLayout treeAndParamLayout = new HorizontalLayout(); treeAndParamLayout.setWidth("100%"); treeAndParamLayout.setSpacing(true); treeAndParamLayout.addComponent(treePanel); treeAndParamLayout.addComponent(paramPanel); treeAndParamLayout.setExpandRatio(paramPanel, 1.0f); stepLayout.addComponent(treeAndParamLayout); stepLayout.setExpandRatio(treeAndParamLayout, 1.0f); return stepLayout; }