List of usage examples for com.vaadin.ui VerticalLayout setDebugId
@Deprecated public void setDebugId(String id)
From source file:com.expressui.core.MainApplication.java
License:Open Source License
@Override public void init() { currentInstance.set(this); setTheme(getCustomTheme());/* w w w .j ava 2 s . co m*/ customizeConfirmDialogStyle(); Window mainWindow = new Window(); setMainWindow(mainWindow); mainWindow.addStyleName("e-main-window"); mainWindow.setCaption(getTypeCaption()); VerticalLayout mainLayout = new VerticalLayout(); String id = StringUtil.generateDebugId("e", this, mainLayout, "mainLayout"); mainLayout.setDebugId(id); mainWindow.setSizeFull(); mainLayout.setSizeFull(); mainWindow.setContent(mainLayout); setLogoutURL(getApplicationProperties().getRestartApplicationUrl()); configureLeftMenuBar(mainMenuBar.getLeftMenuBarRoot()); configureRightMenuBar(mainMenuBar.getRightMenuBarRoot()); mainLayout.addComponent(mainMenuBar); pageLayoutTabSheet = new TabSheet(); id = StringUtil.generateDebugId("e", this, pageLayoutTabSheet, "pageLayoutTabSheet"); pageLayoutTabSheet.setDebugId(id); pageLayoutTabSheet.addStyleName("e-main-page-layout"); pageLayoutTabSheet.setSizeFull(); mainLayout.addComponent(pageLayoutTabSheet); mainLayout.setExpandRatio(pageLayoutTabSheet, 1.0f); Link expressUILink = new Link(uiMessageSource.getMessage("mainApplication.footerMessage"), new ExternalResource(uiMessageSource.getMessage("mainApplication.footerLink"))); expressUILink.setTargetName("_blank"); expressUILink.setIcon(new ThemeResource("../expressui/favicon.png")); expressUILink.setSizeUndefined(); mainLayout.addComponent(expressUILink); mainLayout.setComponentAlignment(expressUILink, Alignment.TOP_CENTER); configureSessionTimeout(mainWindow); postWire(); onDisplay(); }
From source file:com.expressui.core.view.form.layout.TopLabelGridLayout.java
License:Open Source License
private void addFieldImpl(FormField formField) { VerticalLayout fieldLayout = new VerticalLayout(); fieldLayout.setWidth(SIZE_UNDEFINED, Sizeable.UNITS_PERCENTAGE); String id = StringUtil.generateDebugId("e", this, fieldLayout, "fieldLayout"); fieldLayout.setDebugId(id); fieldLayout.addComponent(formField.getFieldLabel()); fieldLayout.addComponent(formField.getField()); if (formField.getColumnEnd() != null && formField.getRowEnd() != null) { addComponent(fieldLayout, formField.getColumnStart() - 1, formField.getRowStart() - 1, formField.getColumnEnd() - 1, formField.getRowEnd() - 1); } else {//from w w w. j a va2s . c om addComponent(fieldLayout, formField.getColumnStart() - 1, formField.getRowStart() - 1); } }
From source file:com.expressui.core.view.form.ResultsConnectedEntityForm.java
License:Open Source License
private HorizontalLayout createNavigationFormLayout() { HorizontalLayout navigationFormLayout = new HorizontalLayout(); String id = StringUtil.generateDebugId("e", this, navigationFormLayout, "navigationFormLayout"); navigationFormLayout.setDebugId(id); navigationFormLayout.setSizeUndefined(); VerticalLayout previousButtonLayout = new VerticalLayout(); id = StringUtil.generateDebugId("e", this, previousButtonLayout, "previousButtonLayout"); previousButtonLayout.setDebugId(id); previousButtonLayout.setSizeUndefined(); previousButtonLayout.setMargin(false); previousButtonLayout.setSpacing(false); Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML); spaceLabel.setSizeUndefined();/*from ww w .j a v a2 s. c o m*/ previousButtonLayout.addComponent(spaceLabel); Button previousButton = new Button(null, this, "previousItem"); previousButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.previous.toolTip")); previousButton.setSizeUndefined(); previousButton.addStyleName("borderless"); previousButton.setIcon(new ThemeResource("../expressui/icons/16/previous.png")); if (entityForm.getViewableToManyRelationships().size() == 0) { HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout(); id = StringUtil.generateDebugId("e", this, previousButtonHorizontalLayout, "previousButtonHorizontalLayout"); previousButtonHorizontalLayout.setDebugId(id); previousButtonHorizontalLayout.setSizeUndefined(); Label horizontalSpaceLabel = new Label(" ", Label.CONTENT_XHTML); horizontalSpaceLabel.setSizeUndefined(); previousButtonHorizontalLayout.addComponent(previousButton); previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel); previousButtonLayout.addComponent(previousButtonHorizontalLayout); } else { previousButtonLayout.addComponent(previousButton); } navigationFormLayout.addComponent(previousButtonLayout); navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT); navigationFormLayout.addComponent(entityForm); VerticalLayout nextButtonLayout = new VerticalLayout(); id = StringUtil.generateDebugId("e", this, nextButtonLayout, "nextButtonLayout"); nextButtonLayout.setDebugId(id); nextButtonLayout.setSizeUndefined(); nextButtonLayout.setMargin(false); nextButtonLayout.setSpacing(false); spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML); spaceLabel.setSizeUndefined(); previousButtonLayout.addComponent(spaceLabel); nextButtonLayout.addComponent(spaceLabel); Button nextButton = new Button(null, this, "nextItem"); nextButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.next.toolTip")); nextButton.setSizeUndefined(); nextButton.addStyleName("borderless"); nextButton.setIcon(new ThemeResource("../expressui/icons/16/next.png")); HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout(); id = StringUtil.generateDebugId("e", this, nextButtonHorizontalLayout, "nextButtonHorizontalLayout"); nextButtonHorizontalLayout.setDebugId(id); nextButtonHorizontalLayout.setSizeUndefined(); Label horizontalSpaceLabel = new Label(" ", Label.CONTENT_XHTML); horizontalSpaceLabel.setSizeUndefined(); nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel); nextButtonHorizontalLayout.addComponent(nextButton); nextButtonLayout.addComponent(nextButtonHorizontalLayout); navigationFormLayout.addComponent(nextButtonLayout); navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT); navigationFormLayout.setSpacing(false); navigationFormLayout.setMargin(false); return navigationFormLayout; }
From source file:org.eclipse.skalli.view.internal.window.NewProjectPanel.java
License:Open Source License
/** * Renders the content of the panel./*from w w w.j a va 2 s . c o m*/ */ private void renderContent(VerticalLayout content) { CssLayout layout = new CssLayout(); layout.setWidth("600px"); //$NON-NLS-1$ content.addComponent(layout); content.setComponentAlignment(layout, Alignment.MIDDLE_CENTER); Label title = new Label("<h2>" + "Available Project Templates" + "</h2>", Label.CONTENT_XHTML); //$NON-NLS-1$//$NON-NLS-3$ layout.addComponent(title); TreeSet<RadioSelect.Entry> entries = new TreeSet<RadioSelect.Entry>(); for (ProjectTemplate projectTemplate : projectTemplates) { entries.add(new RadioSelect.Entry(projectTemplate.getId(), projectTemplate.getDisplayName(), projectTemplate.getDescription(), projectTemplate.getRank())); } select = new RadioSelect("", entries); //$NON-NLS-1$ layout.addComponent(select); renderButtons(content); // for ui debugging content.setDebugId(DEBUG_ID_CONTENT); }
From source file:rs.pupin.jpo.esta_ld.EstaLdComponent.java
private void refresh() { contentLayout.removeAllComponents(); // create left part where the map goes // first create a vertical layout for components geoLayout = new VerticalLayout(); geoLayout.setDebugId("l-geo"); geoLayout.setSizeUndefined();/*from w ww . java 2s. co m*/ // geoLayout.setWidth(GEO_PART_WIDTH); // geoLayout.setHeight("100%"); geoLayout.setSizeFull(); geoLayout.setSpacing(true); contentLayout.addComponent(geoLayout); getWindow().executeJavaScript("$('div#l-geo').append('<div id=\"esta-map-popup\"><p></p></div>')"); // contentLayout.setExpandRatio(geoLayout, 0.0f); // create Level and +- controls HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); final Label levelLabel = new Label(LEVEL_LABEL_CONTENT, Label.CONTENT_XHTML); hl.addComponent(levelLabel); hl.setComponentAlignment(levelLabel, Alignment.MIDDLE_LEFT); btnAggregColor = new Button("Aggregated Coloring"); btnAggregColor.addStyleName("dim-name"); btnAggregColor.addStyleName("btn-aggreg-coloring"); btnAggregColor.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { getWindow().executeJavaScript("toggleAggregatedColoring()"); } }); hl.addComponent(btnAggregColor); geoLayout.addComponent(hl); geoLayout.setExpandRatio(hl, 0.0f); // create a layout for the map // mapLayout = new VerticalLayout(); mapLayout = new VerticalLayout() { @Override public void attach() { getWindow().executeJavaScript("console.log('Attached the map')"); } }; mapLayout.addListener(new ComponentAttachListener() { public void componentAttachedToContainer(ComponentAttachEvent event) { getWindow().executeJavaScript("console.log('ComponentAttachedListener triggered')"); } }); mapLayout.setSizeUndefined(); mapLayout.setWidth("100%"); // mapLayout.setHeight("620px"); mapLayout.setHeight("100%"); mapLayout.setDebugId("map"); mapLayout.addStyleName("leaflet-container"); mapLayout.addStyleName("leaflet-fade-anim"); geoLayout.addComponent(mapLayout); geoLayout.setExpandRatio(mapLayout, 2.0f); rightLayout = new VerticalLayout(); rightLayout.setSizeUndefined(); rightLayout.setWidth("100%"); rightLayout.setSizeFull(); rightLayout.setSpacing(true); contentLayout.addComponent(rightLayout); // contentLayout.setExpandRatio(rightLayout, 2.0f); dimLayout = new GridLayout(6, 1); dimLayout.setColumnExpandRatio(0, 0.0f); dimLayout.setColumnExpandRatio(1, 0.0f); dimLayout.setColumnExpandRatio(2, 2.0f); dimLayout.setColumnExpandRatio(3, 0.0f); dimLayout.setColumnExpandRatio(4, 0.0f); dimLayout.setColumnExpandRatio(5, 2.0f); dimLayout.setDebugId("dim-layout"); // dimLayout.setSizeFull(); dimLayout.setWidth("100%"); dimLayout.setSpacing(true); // rightLayout.addComponent(dimLayout); settingsLayout.addComponent(dimLayout); dimLayout.addListener(new LayoutEvents.LayoutClickListener() { public void layoutClick(LayoutEvents.LayoutClickEvent event) { Component btnAggreg = event.getClickedComponent(); if (!(btnAggreg instanceof Label)) return; if (btnAggreg.getStyleName().contains("selected")) { btnAggreg.removeStyleName("selected"); } else { btnAggreg.addStyleName("selected"); } aggregDimensionsChanged(); } }); refreshDimensions(); HorizontalLayout chartControlsLayout = new HorizontalLayout(); chartControlsLayout.setDebugId("l-chart-controls"); chartControlsLayout.setWidth("100%"); chartControlsLayout.setSpacing(true); rightLayout.addComponent(chartControlsLayout); rightLayout.setExpandRatio(chartControlsLayout, 0.0f); btnCompare = new Button("Compare"); btnCompare.setDebugId("btn-compare"); btnCompare.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { getWindow().executeJavaScript("toggleCompare()"); } }); chartControlsLayout.addComponent(btnCompare); btnSwap = new Button("Swap"); btnSwap.setDebugId("btn-swap"); btnSwap.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { getWindow().executeJavaScript("toggleSwap()"); } }); chartControlsLayout.addComponent(btnSwap); btnInvert = new Button("Switch Axes"); btnInvert.setDebugId("btn-invert"); btnInvert.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { getWindow().executeJavaScript("toggleInvert()"); } }); chartControlsLayout.addComponent(btnInvert); btnStack = new Button("Stack"); btnStack.setDebugId("btn-stack"); btnStack.addListener(new Button.ClickListener() { public void buttonClick(Button.ClickEvent event) { getWindow().executeJavaScript("toggleStacking()"); } }); chartControlsLayout.addComponent(btnStack); Label lblEmpty = new Label(" "); chartControlsLayout.addComponentAsFirst(lblEmpty); chartControlsLayout.setExpandRatio(lblEmpty, 2.0f); chartLayout = new VerticalLayout(); chartLayout.setSizeFull(); chartLayout.setDebugId("highchartsbarsingle"); // rightLayout.addComponent(chartLayout); VerticalLayout chartLayout2 = new VerticalLayout(); chartLayout2.setSizeFull(); chartLayout2.setDebugId("highchartsbarmultiple"); rightLayout.addComponent(chartLayout2); rightLayout.setExpandRatio(chartLayout2, 2.0f); inspectLayout = new VerticalLayout(); inspectLayout.setVisible(false); inspectLayout.setWidth("100%"); inspectLayout.setDebugId("l-inspect"); // mainLayout.addComponent(inspectLayout); // mainLayout.setExpandRatio(inspectLayout, 2.0f); }