List of usage examples for com.vaadin.ui Alignment MIDDLE_LEFT
Alignment MIDDLE_LEFT
To view the source code for com.vaadin.ui Alignment MIDDLE_LEFT.
Click Source Link
From source file:com.etest.view.tq.reports.OnlineQueriesUI.java
public OnlineQueriesUI() { setWidth("100%"); setMargin(true);/*from w w w .j a v a 2 s. c o m*/ setSpacing(true); Label lineSeparator1 = new Label(); lineSeparator1.setContentMode(ContentMode.HTML); lineSeparator1.setStyleName("line-separator"); Label lineSeparator2 = new Label(); lineSeparator2.setContentMode(ContentMode.HTML); lineSeparator2.setStyleName("line-separator"); disableAllComponents(false); GridLayout topGrid = new GridLayout(3, 2); topGrid.setWidth("800px"); topGrid.setSpacing(true); VerticalLayout top = new VerticalLayout(); top.setWidth("166px"); graphicalInventory.addItem("Graphical Inventory"); graphicalInventory.setWidth("300px"); top.addComponent(graphicalInventory); graphicalInventory.addValueChangeListener(firstLevelOptionListener); graphicalInventory.setImmediate(true); graphicalInventoryGroup.addItem("All Subjects"); Label subjectProportionedCaption = new Label(); subjectProportionedCaption.setWidth("500px"); subjectProportionedCaption .setCaption("A Subject's No. of Items Proportioned " + "According to the Revised Bloom's Taxonomy"); subjectProportionedCaption.setContentMode(ContentMode.HTML); subjectProportionedCaption.setHeightUndefined(); graphicalInventoryGroup.addItem(subjectProportionedCaption.getCaption()); graphicalInventoryGroup.setWidth("400px"); graphicalInventoryGroup.addValueChangeListener(secondLevelTopOptionListener); graphicalInventoryGroup.setImmediate(true); topGrid.addComponent(top, 0, 0); topGrid.addComponent(graphicalInventoryGroup, 1, 0, 2, 0); addComponent(topGrid); searchSubject1.setInputPrompt("Search Subject"); searchSubject1.setWidth("225px"); searchSubject1.addValueChangeListener(dropDownChangeListener); searchSubject1.setEnabled(false); topGrid.addComponent(searchSubject1, 1, 1); addComponent(lineSeparator1); GridLayout bottomGrid = new GridLayout(3, 3); bottomGrid.setWidth("800px"); bottomGrid.setSpacing(true); VerticalLayout bottom = new VerticalLayout(); bottom.setWidth("235px"); itemAnalysis.addItem("Item Analysis"); itemAnalysis.setWidth("310px"); bottom.addComponent(itemAnalysis); itemAnalysis.addValueChangeListener(firstLevelOptionListener); itemAnalysis.setImmediate(true); graphicalView.addItem("Graphical View"); graphicalView.setWidth("210px"); graphicalView.addValueChangeListener(secondLevelBottomOptionListener); graphicalView.setImmediate(true); tabularView.addItem("Tabular View"); tabularView.addValueChangeListener(secondLevelBottomOptionListener); tabularView.setImmediate(true); graphicalViewGroup.addItem("Summary: All Tests of a Subject"); graphicalViewGroup.addItem("Difficulty Index of a Subject's Test"); graphicalViewGroup.addItem("Discrimination Index of a Subject's Test"); graphicalViewGroup.setWidth("300px"); graphicalViewGroup.addValueChangeListener(thirdLevelBottomOptionListener); graphicalViewGroup.setImmediate(true); tabularViewGroup.addItem("Summary: All Tests of a Subject"); tabularViewGroup.addItem("Critical values of a test"); tabularViewGroup.addValueChangeListener(thirdLevelBottomOptionListener); tabularViewGroup.setImmediate(true); searchSubject2.setInputPrompt("Search Subject"); searchSubject2.setWidth("225px"); searchSubject2.addValueChangeListener(dropDownChangeListener); searchSubject2.setEnabled(false); searchTest.setWidth("225px"); searchTest.setInputPrompt("Search Test"); searchTest.setEnabled(false); searchTest.addStyleName(ValoTheme.COMBOBOX_SMALL); bottomGrid.addComponent(bottom, 0, 0); bottomGrid.addComponent(graphicalView, 1, 0); bottomGrid.addComponent(tabularView, 1, 1); bottomGrid.addComponent(graphicalViewGroup, 2, 0); bottomGrid.addComponent(tabularViewGroup, 2, 1); bottomGrid.addComponent(searchSubject2, 1, 2); bottomGrid.addComponent(searchTest, 2, 2); addComponent(bottomGrid); addComponent(lineSeparator2); HorizontalLayout h = new HorizontalLayout(); h.setWidth("100%"); h.setMargin(true); Button calculateAndViewBtn = new Button("Calculate & View"); calculateAndViewBtn.setWidth("300px"); calculateAndViewBtn.addClickListener(buttonClickListener); h.addComponent(calculateAndViewBtn); h.setComponentAlignment(calculateAndViewBtn, Alignment.MIDDLE_LEFT); addComponent(calculateAndViewBtn); }
From source file:com.etest.view.tq.reports.ReportGeneratorUI.java
public ReportGeneratorUI() { setWidth("100%"); setMargin(true);/*from w w w . j a v a 2 s.c om*/ setSpacing(true); Label lineSeparator1 = new Label(); lineSeparator1.setContentMode(ContentMode.HTML); lineSeparator1.setStyleName("line-separator"); Label lineSeparator2 = new Label(); lineSeparator2.setContentMode(ContentMode.HTML); lineSeparator2.setStyleName("line-separator"); Label lineSeparator3 = new Label(); lineSeparator3.setContentMode(ContentMode.HTML); lineSeparator3.setStyleName("line-separator"); searchSubject1.addValueChangeListener(dropDownChangeListener); searchSubject1.setEnabled(false); searchApproveTq1.setWidth("100%"); searchApproveTq1.setInputPrompt("Search Approved TQ"); searchApproveTq1.setEnabled(false); searchApproveTq1.addStyleName(ValoTheme.COMBOBOX_SMALL); searchSubject2.addValueChangeListener(dropDownChangeListener); searchSubject2.setEnabled(false); searchApproveTq2.setWidth("100%"); searchApproveTq2.setInputPrompt("Search TQ Ticket No."); searchApproveTq2.setEnabled(false); searchApproveTq2.addStyleName(ValoTheme.COMBOBOX_SMALL); GridLayout g1 = new GridLayout(3, 1); g1.setWidth("70%"); g1.setSpacing(true); VerticalLayout v1 = new VerticalLayout(); v1.setWidth("5px"); reportType1.addItem("Test Questionnaire"); reportType1.setWidth("200px"); reportType1.addValueChangeListener(optionChangeListener); reportType1.setImmediate(true); v1.addComponent(reportType1); v1.setExpandRatio(reportType1, 1); g1.addComponent(v1, 0, 0); g1.addComponent(searchSubject1, 1, 0); g1.addComponent(searchApproveTq1, 2, 0); addComponent(g1); addComponent(lineSeparator1); GridLayout g2 = new GridLayout(3, 1); g2.setWidth("70%"); g2.setSpacing(true); VerticalLayout v2 = new VerticalLayout(); v2.setWidth("5px"); reportType2.addItem("Item Analysis"); reportType2.setWidth("200px"); reportType2.addValueChangeListener(optionChangeListener); reportType2.setImmediate(true); v2.addComponent(reportType2); v2.setExpandRatio(reportType2, 1); g2.addComponent(v2, 0, 0); g2.addComponent(searchSubject2, 1, 0); g2.addComponent(searchApproveTq2, 2, 0); addComponent(g2); addComponent(lineSeparator2); GridLayout g3 = new GridLayout(3, 1); g3.setWidth("70%"); g3.setSpacing(true); VerticalLayout v3 = new VerticalLayout(); v3.setWidth("5px"); reportType3.addItem("Test Bank Inventory"); reportType3.setWidth("200px"); reportType3.addValueChangeListener(optionChangeListener); reportType3.setImmediate(true); VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setSpacing(true); testBankInventory.addItem("Summary: Case vs Items"); testBankInventory.addItem("Summary: Items Group according to the Revised Blooms Taxonomy"); testBankInventory.setImmediate(true); testBankInventory.select("Summary: Case vs Items"); testBankInventory.setEnabled(false); v.addComponent(testBankInventory); v3.addComponent(reportType3); v3.setExpandRatio(reportType3, 1); g3.addComponent(v3, 0, 0); g3.setComponentAlignment(v3, Alignment.TOP_LEFT); g3.addComponent(v, 1, 0); addComponent(g3); // addComponent(new Label("<HR>", ContentMode.HTML)); addComponent(lineSeparator3); Button button = new Button("Calculate & Generate"); button.addClickListener(reportBtnClickListener); button.setWidth("300px"); addComponent(button); setComponentAlignment(button, Alignment.MIDDLE_LEFT); }
From source file:com.etest.view.tq.TQListUI.java
public Table populateDataTable() { removeAllItems();//from w w w. j av a 2 s .c o m int i = 0; for (TQCoverage t : tq.getAllTQCoverage()) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button view = new Button("view"); view.setSizeFull(); view.setData(t.getTqCoverageId()); view.setIcon(FontAwesome.VIDEO_CAMERA); view.addStyleName(ValoTheme.BUTTON_LINK); view.addStyleName(ValoTheme.BUTTON_TINY); view.addStyleName(ValoTheme.BUTTON_QUIET); view.addStyleName("button-container"); view.addClickListener(remarksBtnClickListener); v.addComponent(view); v.setComponentAlignment(view, Alignment.MIDDLE_LEFT); Button approve = new Button("status"); approve.setSizeFull(); approve.setData(t.getTqCoverageId()); approve.addStyleName(ValoTheme.BUTTON_LINK); approve.addStyleName(ValoTheme.BUTTON_TINY); approve.addStyleName(ValoTheme.BUTTON_QUIET); approve.addStyleName("button-container"); v.addComponent(approve); v.setComponentAlignment(approve, Alignment.MIDDLE_LEFT); // Button print = new Button("print"); // print.setSizeFull(); // print.setData(t.getTqCoverageId()); // print.setIcon(FontAwesome.PRINT); // print.addStyleName(ValoTheme.BUTTON_LINK); // print.addStyleName(ValoTheme.BUTTON_TINY); // print.addStyleName(ValoTheme.BUTTON_QUIET); // print.addStyleName("button-container"); // print.addClickListener(remarksBtnClickListener); // v.addComponent(print); // v.setComponentAlignment(print, Alignment.MIDDLE_LEFT); if (t.getStatus() == 0) { approve.setIcon(FontAwesome.THUMBS_DOWN); // print.setVisible(false); } else { approve.setIcon(FontAwesome.THUMBS_UP); // print.setVisible(true); } addItem(new Object[] { t.getExamTitle(), cs.getCurriculumById(t.getCurriculumId()).getSubject(), t.getDateCreated(), t.getTotalHoursCoverage(), t.getTotalItems(), v }, i); i++; } setPageLength(size()); return this; }
From source file:com.expressui.core.view.entityselect.EntitySelectResults.java
License:Open Source License
@PostConstruct @Override/*from w w w . ja v a 2 s . com*/ public void postConstruct() { super.postConstruct(); addSelectionChangedListener(this, "selectionChanged"); HorizontalLayout crudButtons = new HorizontalLayout(); setDebugId(crudButtons, "crudButtons"); crudButtons.setMargin(false); crudButtons.setSpacing(true); selectButton = new Button(uiMessageSource.getMessage("results.select")); selectButton.setDescription(uiMessageSource.getToolTip("results.select.toolTip")); selectButton.setEnabled(false); selectButton.addStyleName("small default"); crudButtons.addComponent(selectButton); getCrudButtons().addComponent(crudButtons, 0); getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT); getEntityQuery().setPageSize(applicationProperties.getDefaultSelectPageSize()); addCodePopupButtonIfEnabled(EntitySelectResults.class); }
From source file:com.expressui.core.view.results.CrudResults.java
License:Open Source License
@PostConstruct @Override// w w w .j a v a2s . c om public void postConstruct() { super.postConstruct(); getResultsTable().setMultiSelect(true); HorizontalLayout crudButtons = new HorizontalLayout(); setDebugId(crudButtons, "crudButtons"); crudButtons.setMargin(false); crudButtons.setSpacing(true); newButton = new Button(uiMessageSource.getMessage("crudResults.new"), this, "create"); newButton.setDescription(uiMessageSource.getToolTip("crudResults.new.toolTip")); newButton.setIcon(new ThemeResource("../expressui/icons/16/add.png")); newButton.addStyleName("small default"); crudButtons.addComponent(newButton); viewButton = new Button(uiMessageSource.getMessage("crudResults.view"), this, "view"); viewButton.setDescription(uiMessageSource.getToolTip("crudResults.view.toolTip")); viewButton.setIcon(new ThemeResource("../expressui/icons/16/view.png")); viewButton.addStyleName("small default"); crudButtons.addComponent(viewButton); editButton = new Button(uiMessageSource.getMessage("crudResults.edit"), this, "edit"); editButton.setDescription(uiMessageSource.getToolTip("crudResults.edit.toolTip")); editButton.setIcon(new ThemeResource("../expressui/icons/16/edit.png")); editButton.addStyleName("small default"); crudButtons.addComponent(editButton); deleteButton = new Button(uiMessageSource.getMessage("crudResults.delete"), this, "delete"); deleteButton.setDescription(uiMessageSource.getToolTip("crudResults.delete.toolTip")); deleteButton.setIcon(new ThemeResource("../expressui/icons/16/delete.png")); deleteButton.addStyleName("small default"); crudButtons.addComponent(deleteButton); actionContextMenu.addAction("crudResults.view", this, "view"); actionContextMenu.addAction("crudResults.edit", this, "edit"); actionContextMenu.addAction("crudResults.delete", this, "delete"); addSelectionChangedListener(this, "selectionChanged"); getCrudButtons().addComponent(crudButtons, 0); getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT); getResultsTable().addListener(new DoubleClickListener()); addCodePopupButtonIfEnabledForCrudResults(); }
From source file:com.expressui.core.view.RootComponent.java
License:Open Source License
/** * Adds code popup button next to this component to the right. * * @param classes classes for displaying related source code and Javadoc. If * class is within com.expressui.core or com.expressui.domain, * then Javadoc is displayed, otherwise source code. *//*from w w w .j a v a2 s. c o m*/ protected void addCodePopupButtonIfEnabled(Class... classes) { addCodePopupButtonIfEnabled(Alignment.MIDDLE_LEFT, classes); }
From source file:com.expressui.core.view.tomanyrelationship.AggregationRelationship.java
License:Open Source License
@PostConstruct @Override//from w w w . j a va2 s .c o m public void postConstruct() { super.postConstruct(); crudButtons = new HorizontalLayout(); setDebugId(crudButtons, "crudButtons"); crudButtons.setMargin(false, true, false, false); crudButtons.setSpacing(true); addButton = new Button(uiMessageSource.getMessage("aggregationRelationship.add"), this, "add"); addButton.setDescription(uiMessageSource.getToolTip("aggregationRelationship.add.toolTip")); addButton.setIcon(new ThemeResource("../expressui/icons/16/add.png")); addButton.addStyleName("small default"); crudButtons.addComponent(addButton); removeButton = new Button(uiMessageSource.getMessage("aggregationRelationship.remove"), this, "remove"); removeButton.setDescription(uiMessageSource.getToolTip("aggregationRelationship.remove.toolTip")); removeButton.setIcon(new ThemeResource("../expressui/icons/16/delete.png")); removeButton.addStyleName("small default"); crudButtons.addComponent(removeButton); getCrudButtons().addComponent(crudButtons, 0); getCrudButtons().setComponentAlignment(crudButtons, Alignment.MIDDLE_LEFT); actionContextMenu.addAction("aggregationRelationship.remove", this, "remove"); }
From source file:com.fnc.view.ui.AlphaListMainUI.java
public AlphaListMainUI() { setSizeFull();// w w w. java2s.c o m setMargin(true); addComponent(buildForms()); HorizontalLayout h = new HorizontalLayout(); h.setWidthUndefined(); h.setSpacing(true); progress.setWidth("150px"); h.addComponent(progress); h.setComponentAlignment(progress, Alignment.MIDDLE_LEFT); status.setValue("0%"); h.addComponent(status); addComponent(h); addComponent(grid); }
From source file:com.fnc.view.ui.thirteenth.ThirteenthMonthUI.java
public ThirteenthMonthUI() { setSizeFull();/*www . j a va 2 s .co m*/ setMargin(true); addComponent(buildForms()); HorizontalLayout h = new HorizontalLayout(); h.setWidthUndefined(); h.setSpacing(true); progress.setWidth("150px"); h.addComponent(progress); h.setComponentAlignment(progress, Alignment.MIDDLE_LEFT); status.setValue("0%"); h.addComponent(status); addComponent(h); }
From source file:com.foc.vaadin.gui.FocXMLGuiComponentStatic.java
License:Apache License
public static void applyAlignment(AbstractOrderedLayout layout, Component component, String alignment) { alignment = alignment.toLowerCase(); if (alignment.equals("right") || alignment.equals("middle_right")) { layout.setComponentAlignment(component, Alignment.MIDDLE_RIGHT); } else if (alignment.equals("left") || alignment.equals("middle_left")) { layout.setComponentAlignment(component, Alignment.MIDDLE_LEFT); } else if (alignment.equals("center") || alignment.equals("middle_center")) { layout.setComponentAlignment(component, Alignment.MIDDLE_CENTER); } else if (alignment.equals("top_right")) { layout.setComponentAlignment(component, Alignment.TOP_RIGHT); } else if (alignment.equals("top_left")) { layout.setComponentAlignment(component, Alignment.TOP_LEFT); } else if (alignment.equals("top_center")) { layout.setComponentAlignment(component, Alignment.TOP_CENTER); } else if (alignment.equals("bottom_right")) { layout.setComponentAlignment(component, Alignment.BOTTOM_RIGHT); } else if (alignment.equals("bottom_left")) { layout.setComponentAlignment(component, Alignment.BOTTOM_LEFT); } else if (alignment.equals("bottom_center")) { layout.setComponentAlignment(component, Alignment.BOTTOM_CENTER); }/* w ww . j a va 2 s.c o m*/ }