Java Code Examples for com.vaadin.ui.VerticalLayout#setExpandRatio()
The following examples show how to use
com.vaadin.ui.VerticalLayout#setExpandRatio() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PolicyWorkspace.java From XACML with MIT License | 6 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); mainLayout.setMargin(false); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // horizontalSplitPanel horizontalSplitPanel = buildHorizontalSplitPanel(); mainLayout.addComponent(horizontalSplitPanel); mainLayout.setExpandRatio(horizontalSplitPanel, 1.0f); return mainLayout; }
Example 2
Source File: MultipleTargetFilter.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private Component getSimpleFilterTab() { simpleFilterTab = new VerticalLayout(); targetTagTableLayout = new VerticalLayout(); targetTagTableLayout.setSizeFull(); if (menu != null) { targetTagTableLayout.addComponent(menu); targetTagTableLayout.setComponentAlignment(menu, Alignment.TOP_RIGHT); } targetTagTableLayout.addComponent(filterByButtons); targetTagTableLayout.setComponentAlignment(filterByButtons, Alignment.MIDDLE_CENTER); targetTagTableLayout.setId(UIComponentIdProvider.TARGET_TAG_DROP_AREA_ID); targetTagTableLayout.setExpandRatio(filterByButtons, 1.0F); simpleFilterTab.setCaption(i18n.getMessage("caption.filter.simple")); simpleFilterTab.addComponent(targetTagTableLayout); simpleFilterTab.setExpandRatio(targetTagTableLayout, 1.0F); simpleFilterTab.addComponent(filterByStatusFooter); simpleFilterTab.setComponentAlignment(filterByStatusFooter, Alignment.MIDDLE_CENTER); simpleFilterTab.setSizeFull(); simpleFilterTab.addStyleName(SPUIStyleDefinitions.SIMPLE_FILTER_HEADER); return simpleFilterTab; }
Example 3
Source File: EnumerationEditorComponent.java From XACML with MIT License | 5 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // tableEnumerations tableEnumerations = new Table(); tableEnumerations.setCaption("Enumeration Values"); tableEnumerations.setImmediate(true); tableEnumerations .setDescription("Enter possible values for the attribute."); tableEnumerations.setWidth("100.0%"); tableEnumerations.setHeight("-1px"); tableEnumerations.setInvalidAllowed(false); mainLayout.addComponent(tableEnumerations); mainLayout.setExpandRatio(tableEnumerations, 1.0f); // horizontalLayout_1 horizontalLayout_1 = buildHorizontalLayout_1(); mainLayout.addComponent(horizontalLayout_1); mainLayout.setExpandRatio(horizontalLayout_1, 1.0f); return mainLayout; }
Example 4
Source File: ParliamentDecisionFlowPageModContentFactoryImpl.java From cia with Apache License 2.0 | 5 votes |
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); String selectedYear = "2018/19"; if (parameters != null && parameters.contains("[") && parameters.contains("]")) { selectedYear = parameters.substring(parameters.indexOf('[') + 1, parameters.lastIndexOf(']')); } final DataContainer<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommittee.class); final List<ViewRiksdagenCommittee> allCommittess = dataContainer.getAll(); final Map<String, List<ViewRiksdagenCommittee>> committeeMap = allCommittess.stream().collect(Collectors.groupingBy(c -> c.getEmbeddedId().getOrgCode().toUpperCase(Locale.ENGLISH))); final ComboBox<String> comboBox = new ComboBox<>("Select year", Collections.unmodifiableList(Arrays.asList("2018/19","2017/18","2016/17","2015/16","2014/15","2013/14","2012/13","2011/12","2010/11"))); panelContent.addComponent(comboBox); panelContent.setExpandRatio(comboBox, ContentRatio.SMALL); comboBox.setSelectedItem(selectedYear); comboBox.addValueChangeListener(new DecisionFlowValueChangeListener(NAME,"")); final SankeyChart chart = decisionFlowChartManager.createAllDecisionFlow(committeeMap,comboBox.getSelectedItem().orElse(selectedYear)); panelContent.addComponent(chart); panelContent.setExpandRatio(chart, ContentRatio.LARGE); final TextArea textarea = decisionFlowChartManager.createCommitteeeDecisionSummary(committeeMap,comboBox.getSelectedItem().orElse(selectedYear)); textarea.setSizeFull(); panelContent.addComponent(textarea); panelContent.setExpandRatio(textarea, ContentRatio.SMALL_GRID); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, selectedYear); panel.setCaption(new StringBuilder().append(NAME).append("::").append(PARLIAMENT_DECISION_FLOW).toString()); return panelContent; }
Example 5
Source File: PDPManagement.java From XACML with MIT License | 5 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); mainLayout.setMargin(false); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // horizontalLayoutToolbar horizontalLayoutToolbar = buildHorizontalLayoutToolbar(); mainLayout.addComponent(horizontalLayoutToolbar); // tree table = new Table(); table.setImmediate(false); table.setWidth("-1px"); table.setHeight("-1px"); mainLayout.addComponent(table); mainLayout.setExpandRatio(table, 1.0f); return mainLayout; }
Example 6
Source File: AttributeDictionarySelectorComponent.java From XACML with MIT License | 5 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // horizontalLayout_2 horizontalLayout_2 = buildHorizontalLayout_2(); mainLayout.addComponent(horizontalLayout_2); // listSelectAttribute listSelectAttribute = new ListSelect(); listSelectAttribute.setCaption("Dictionary Attributes"); listSelectAttribute.setImmediate(false); listSelectAttribute.setWidth("100.0%"); listSelectAttribute.setHeight("-1px"); listSelectAttribute.setInvalidAllowed(false); listSelectAttribute.setRequired(true); mainLayout.addComponent(listSelectAttribute); mainLayout.setExpandRatio(listSelectAttribute, 1.0f); return mainLayout; }
Example 7
Source File: ObligationAdviceEditorWindow.java From XACML with MIT License | 5 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("100%"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // horizontalLayout_1 horizontalLayout_1 = buildHorizontalLayout_1(); mainLayout.addComponent(horizontalLayout_1); // tableExpressions tableExpressions = new TreeTable(); tableExpressions.setCaption("Expressions"); tableExpressions.setImmediate(false); tableExpressions.setWidth("100%"); tableExpressions.setHeight("-1px"); mainLayout.addComponent(tableExpressions); mainLayout.setExpandRatio(tableExpressions, 1.0f); // buttonSave buttonSave = new Button(); buttonSave.setCaption("Save"); buttonSave.setImmediate(false); buttonSave.setWidth("-1px"); buttonSave.setHeight("-1px"); mainLayout.addComponent(buttonSave); mainLayout.setComponentAlignment(buttonSave, new Alignment(48)); return mainLayout; }
Example 8
Source File: AttributeSelectionWindow.java From XACML with MIT License | 5 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // horizontalLayout_1 horizontalLayout_1 = buildHorizontalLayout_1(); mainLayout.addComponent(horizontalLayout_1); // horizontalLayoutAttribute horizontalLayoutAttribute = new HorizontalLayout(); horizontalLayoutAttribute.setImmediate(false); horizontalLayoutAttribute.setWidth("-1px"); horizontalLayoutAttribute.setHeight("-1px"); horizontalLayoutAttribute.setMargin(false); mainLayout.addComponent(horizontalLayoutAttribute); mainLayout.setExpandRatio(horizontalLayoutAttribute, 1.0f); // buttonSave buttonSave = new Button(); buttonSave.setCaption("Select"); buttonSave.setImmediate(true); buttonSave.setWidth("-1px"); buttonSave.setHeight("-1px"); mainLayout.addComponent(buttonSave); mainLayout.setComponentAlignment(buttonSave, new Alignment(48)); return mainLayout; }
Example 9
Source File: GitPushWindow.java From XACML with MIT License | 4 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // textAreaComments textAreaComments = new TextArea(); textAreaComments.setCaption("Add Comments"); textAreaComments.setImmediate(false); textAreaComments .setDescription("Enter comments that reflect the changes you have made to the repository domains and/or policy files."); textAreaComments.setWidth("400px"); textAreaComments.setHeight("-1px"); textAreaComments.setInvalidAllowed(false); textAreaComments.setRequired(true); textAreaComments .setInputPrompt("Eg. Add new rule for employees in marketing department."); mainLayout.addComponent(textAreaComments); // tableChanges tableChanges = new Table(); tableChanges.setCaption("Changes To Be Pushed"); tableChanges.setImmediate(false); tableChanges.setWidth("100.0%"); tableChanges.setHeight("-1px"); mainLayout.addComponent(tableChanges); mainLayout.setExpandRatio(tableChanges, 1.0f); // buttonPush buttonPush = new Button(); buttonPush.setCaption("Push Changes"); buttonPush.setImmediate(true); buttonPush.setWidth("-1px"); buttonPush.setHeight("-1px"); mainLayout.addComponent(buttonPush); mainLayout.setComponentAlignment(buttonPush, new Alignment(48)); return mainLayout; }
Example 10
Source File: AttributeSimpleCreatorComponent.java From XACML with MIT License | 4 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // textFieldAttributeId textFieldAttributeId = new TextField(); textFieldAttributeId.setCaption("Attribute Id"); textFieldAttributeId.setImmediate(false); textFieldAttributeId.setWidth("100.0%"); textFieldAttributeId.setHeight("-1px"); textFieldAttributeId.setInvalidAllowed(false); textFieldAttributeId.setRequired(true); mainLayout.addComponent(textFieldAttributeId); mainLayout.setExpandRatio(textFieldAttributeId, 1.0f); // textFieldContextPath textFieldContextPath = new TextField(); textFieldContextPath.setCaption("Context Path"); textFieldContextPath.setImmediate(false); textFieldContextPath.setDescription("The Selector's Context Path."); textFieldContextPath.setWidth("100.0%"); textFieldContextPath.setHeight("-1px"); textFieldContextPath .setInputPrompt("eg. md:record/md:patient/md:patient-number/text()"); mainLayout.addComponent(textFieldContextPath); mainLayout.setExpandRatio(textFieldContextPath, 1.0f); // horizontalLayout_1 horizontalLayout_1 = buildHorizontalLayout_1(); mainLayout.addComponent(horizontalLayout_1); mainLayout.setExpandRatio(horizontalLayout_1, 1.0f); return mainLayout; }
Example 11
Source File: PageableTable.java From jdal with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") @PostConstruct public void init() { // build Component VerticalLayout verticalLayout = getVerticalLayout(); verticalLayout.setSizeUndefined(); verticalLayout.setSpacing(true); // filter if (filterEditor != null && filterForm == null) { filterForm = (VaadinView<Filter>) getGuiFactory().getView(filterEditor); } if (filterForm != null) { if (beanFilter != null) { filterForm.setModel(beanFilter); } else { beanFilter = filterForm.getModel(); } verticalLayout.addComponent((Component) filterForm.getPanel()); } // action group if (getActions().size() > 0) { verticalLayout.addComponent(createButtonBox()); } // table verticalLayout.addComponent(getTable()); verticalLayout.setExpandRatio(getTable(), 1.0f); // paginator if (this.paginator == null) { this.paginator = new VaadinPaginator<T>(); this.paginator.setMessageSource(getMessageSource()); } paginator.setModel(page); paginator.addPaginatorListener(this); paginator.setNativeButtons(isNativeButtons()); page.setPageableDataSource(getService()); // set external sorting, ie don't call Container.sort() getTable().setSorter(new PageSorter()); Component p = paginator.getPanel(); verticalLayout.addComponent(p); verticalLayout.setComponentAlignment(p, Alignment.MIDDLE_CENTER); getTable().setPageLength(page.getPageSize()); if (beanFilter != null) { postProcessFilter(beanFilter); page.setFilter(beanFilter); } // get initial page and wrap data in container this.page.setAutoload(true); paginator.firstPage(); getTable().addItemClickListener(this); this.setSizeUndefined(); }
Example 12
Source File: PolicySetEditorWindow.java From XACML with MIT License | 4 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // labelID labelID = new Label(); labelID.setCaption("Policy Set ID"); labelID.setImmediate(false); labelID.setWidth("100.0%"); labelID.setHeight("-1px"); labelID.setValue("Label"); mainLayout.addComponent(labelID); // textFieldVersion textFieldVersion = new TextField(); textFieldVersion.setCaption("Version"); textFieldVersion.setImmediate(false); textFieldVersion .setDescription("The format is numbers only separated by decimal point."); textFieldVersion.setWidth("-1px"); textFieldVersion.setHeight("-1px"); textFieldVersion.setInvalidAllowed(false); textFieldVersion.setRequired(true); textFieldVersion.setInputPrompt("Eg. 1 or 1.0 or 1.0.0 etc."); mainLayout.addComponent(textFieldVersion); // listSelectAlgorithm listSelectAlgorithm = new ListSelect(); listSelectAlgorithm.setCaption("Policy Combining Algorithm"); listSelectAlgorithm.setImmediate(false); listSelectAlgorithm.setWidth("100.0%"); listSelectAlgorithm.setHeight("-1px"); listSelectAlgorithm.setInvalidAllowed(false); listSelectAlgorithm.setRequired(true); mainLayout.addComponent(listSelectAlgorithm); // textAreaDescription textAreaDescription = new TextArea(); textAreaDescription.setCaption("Description"); textAreaDescription.setImmediate(false); textAreaDescription.setWidth("100.0%"); textAreaDescription.setHeight("-1px"); mainLayout.addComponent(textAreaDescription); mainLayout.setExpandRatio(textAreaDescription, 1.0f); // buttonSave buttonSave = new Button(); buttonSave.setCaption("Save"); buttonSave.setImmediate(true); buttonSave.setWidth("-1px"); buttonSave.setHeight("-1px"); mainLayout.addComponent(buttonSave); mainLayout.setComponentAlignment(buttonSave, new Alignment(48)); return mainLayout; }
Example 13
Source File: ServerPanel.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { setSizeFull(); addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("server-tab"); layout.setSpacing(false); layout.setMargin(false); // スプリットパネル SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splitPanel.setSplitPosition(40); splitPanel.setSizeFull(); layout.addComponent(splitPanel); // スプリットパネル上段 VerticalLayout upperLayout = new VerticalLayout(); upperLayout.setSizeFull(); upperLayout.setSpacing(false); upperLayout.setMargin(false); serverButtonsTop = new ServerButtonsTop(sender); upperLayout.addComponent(serverButtonsTop); serverTable = new ServerTable(sender); serverTable.setContainerDataSource(new InstanceDtoContainer()); upperLayout.addComponent(serverTable); serverTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); serverButtonsBottom = new ServerButtonsBottom(sender); upperLayout.addComponent(serverButtonsBottom); upperLayout.setExpandRatio(serverTable, 10); splitPanel.addComponent(upperLayout); // スプリットパネル下段 serverDesc = new ServerDesc(sender); splitPanel.addComponent(serverDesc); }
Example 14
Source File: RuleEditorWindow.java From XACML with MIT License | 4 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // labelRuleID labelRuleID = new Label(); labelRuleID.setCaption("Rule ID"); labelRuleID.setImmediate(false); labelRuleID.setWidth("100.0%"); labelRuleID.setHeight("-1px"); labelRuleID.setValue("Label"); mainLayout.addComponent(labelRuleID); mainLayout.setExpandRatio(labelRuleID, 1.0f); // optionGroupEffect optionGroupEffect = new OptionGroup(); optionGroupEffect.setCaption("Choose the effect."); optionGroupEffect.setImmediate(false); optionGroupEffect.setWidth("-1px"); optionGroupEffect.setHeight("-1px"); optionGroupEffect.setInvalidAllowed(false); optionGroupEffect.setRequired(true); mainLayout.addComponent(optionGroupEffect); // textAreaDescription textAreaDescription = new TextArea(); textAreaDescription.setCaption("Enter a description for the Rule."); textAreaDescription.setImmediate(false); textAreaDescription.setWidth("100.0%"); textAreaDescription.setHeight("-1px"); textAreaDescription.setNullSettingAllowed(true); textAreaDescription.setNullRepresentation(""); mainLayout.addComponent(textAreaDescription); mainLayout.setExpandRatio(textAreaDescription, 1.0f); // buttonSave buttonSave = new Button(); buttonSave.setCaption("Save"); buttonSave.setImmediate(true); buttonSave.setWidth("-1px"); buttonSave.setHeight("-1px"); mainLayout.addComponent(buttonSave); mainLayout.setComponentAlignment(buttonSave, new Alignment(48)); return mainLayout; }
Example 15
Source File: CSVPIPConfigurationComponent.java From XACML with MIT License | 4 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // textFieldFile textFieldFile = new TextField(); textFieldFile.setCaption("Path to CSV File"); textFieldFile.setImmediate(false); textFieldFile .setDescription("This is the path to CSV file on the PDP node."); textFieldFile.setWidth("-1px"); textFieldFile.setHeight("-1px"); textFieldFile.setInvalidAllowed(false); textFieldFile.setRequired(true); textFieldFile .setInputPrompt("Eg. \"c:\\data.csv\" \"http://foo.com/data.csv\""); mainLayout.addComponent(textFieldFile); mainLayout.setExpandRatio(textFieldFile, 1.0f); // textFieldDelimiter textFieldDelimiter = new TextField(); textFieldDelimiter.setCaption("Delimiter"); textFieldDelimiter.setImmediate(false); textFieldDelimiter .setDescription("Enter a separator character or string that delineates columns in each row."); textFieldDelimiter.setWidth("-1px"); textFieldDelimiter.setHeight("-1px"); textFieldDelimiter.setInputPrompt("Eg. \",\" or \"|\""); textFieldDelimiter.setNullSettingAllowed(true); mainLayout.addComponent(textFieldDelimiter); mainLayout.setExpandRatio(textFieldDelimiter, 1.0f); // textFieldQuote textFieldQuote = new TextField(); textFieldQuote.setCaption("Quote"); textFieldQuote.setImmediate(false); textFieldQuote .setDescription("Enter character used for quoted elements."); textFieldQuote.setWidth("-1px"); textFieldQuote.setHeight("-1px"); textFieldQuote.setInputPrompt("Eg. \" or '"); textFieldQuote.setNullSettingAllowed(true); mainLayout.addComponent(textFieldQuote); // textFieldSkip textFieldSkip = new TextField(); textFieldSkip.setCaption("Skip Lines"); textFieldSkip.setImmediate(false); textFieldSkip .setDescription("Skips the number of lines at the beginning of the file."); textFieldSkip.setWidth("-1px"); textFieldSkip.setHeight("-1px"); textFieldSkip.setInputPrompt("Eg. 1 or 2"); mainLayout.addComponent(textFieldSkip); return mainLayout; }
Example 16
Source File: VariableReferenceEditorWindow.java From XACML with MIT License | 4 votes |
@AutoGenerated private VerticalLayout buildMainLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // listSelectVariables listSelectVariables = new ListSelect(); listSelectVariables.setCaption("Defined Variables"); listSelectVariables.setImmediate(false); listSelectVariables.setWidth("100.0%"); listSelectVariables.setHeight("-1px"); mainLayout.addComponent(listSelectVariables); mainLayout.setExpandRatio(listSelectVariables, 1.0f); // textFieldVariable textFieldVariable = new TextField(); textFieldVariable.setCaption("Variable"); textFieldVariable.setImmediate(false); textFieldVariable.setWidth("-1px"); textFieldVariable.setHeight("-1px"); textFieldVariable.setInvalidAllowed(false); textFieldVariable.setRequired(true); textFieldVariable.setInputPrompt("Eg. \"12345\" or \"myVariable1\""); mainLayout.addComponent(textFieldVariable); mainLayout.setExpandRatio(textFieldVariable, 1.0f); // buttonSave buttonSave = new Button(); buttonSave.setCaption("Save"); buttonSave.setImmediate(true); buttonSave.setWidth("-1px"); buttonSave.setHeight("-1px"); mainLayout.addComponent(buttonSave); mainLayout.setComponentAlignment(buttonSave, new Alignment(48)); return mainLayout; }
Example 17
Source File: AdminUserAccountPageModContentFactoryImpl.java From cia with Apache License 2.0 | 4 votes |
@Secured({ "ROLE_ADMIN" }) @Override public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout content = createPanelContent(); final String pageId = getPageId(parameters); final int pageNr= getPageNr(parameters); getMenuItemFactory().createMainPageMenuBar(menuBar); LabelFactory.createHeader2Label(content,ADMIN_USERACCOUNT); final DataContainer<UserAccount, Long> dataContainer = getApplicationManager() .getDataContainer(UserAccount.class); final List<UserAccount> pageOrderBy = dataContainer.getPageOrderBy(pageNr,DEFAULT_RESULTS_PER_PAGE,UserAccount_.createdDate); getPagingUtil().createPagingControls(content,NAME,pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE); getGridFactory().createBasicBeanItemGrid(content, UserAccount.class, pageOrderBy, USER_ACCOUNT, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null); if (pageId != null && !pageId.isEmpty()) { final UserAccount userAccount = dataContainer.load(Long.valueOf(pageId)); if (userAccount != null) { getFormFactory() .addFormPanelTextFields(content, userAccount, UserAccount.class, AS_LIST); final VerticalLayout overviewLayout = new VerticalLayout(); overviewLayout.setSizeFull(); content.addComponent(overviewLayout); content.setExpandRatio(overviewLayout, ContentRatio.LARGE); final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout); for (final AccountOperation accountOperation : ManageUserAccountRequest.AccountOperation.values()) { final ManageUserAccountRequest request = new ManageUserAccountRequest(); request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId()); request.setAccountOperation(accountOperation); request.setUserAcountId(userAccount.getUserId()); final Button accountOperationButton = new Button(MessageFormat.format(BUTTON_PATTERN, accountOperation) , VaadinIcons.BULLSEYE); accountOperationButton.addClickListener(new ManageUserAccountClickListener(request)); accountOperationButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, accountOperation)); RowUtil.createRowItem(grid, accountOperationButton, "Will perform useraccount action"); } } } getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_USERACCOUNT_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId); return content; }
Example 18
Source File: SearchDocumentPageModContentFactoryImpl.java From cia with Apache License 2.0 | 4 votes |
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); final String pageId = getPageId(parameters); documentMenuItemFactory.createDocumentsMenuBar(menuBar); final VerticalLayout searchLayout = new VerticalLayout(); searchLayout.setSizeFull(); panelContent.addComponent(searchLayout); final VerticalLayout searchresultLayout = new VerticalLayout(); searchresultLayout.setSizeFull(); final Panel formPanel = new Panel(); formPanel.setSizeFull(); searchresultLayout.addComponent(formPanel); final FormLayout formContent = new FormLayout(); formPanel.setContent(formContent); panelContent.addComponent(searchresultLayout); panelContent.setExpandRatio(searchresultLayout, ContentRatio.LARGE); final SearchDocumentRequest searchRequest = new SearchDocumentRequest(); searchRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId()); searchRequest.setMaxResults(MAX_RESULT_SIZE); searchRequest.setSearchExpression(""); getFormFactory().addRequestInputFormFields(formContent, searchRequest, SearchDocumentRequest.class, AS_LIST, SEARCH, new SearchDocumentClickListener(searchRequest, new SearchDocumentResponseHandlerImpl(getGridFactory(), formPanel, searchresultLayout))); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
Example 19
Source File: AdminMonitoringPageModContentFactoryImpl.java From cia with Apache License 2.0 | 4 votes |
@Secured({ "ROLE_ADMIN" }) @Override public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout content = createPanelContent(); final String pageId = getPageId(parameters); getMenuItemFactory().createMainPageMenuBar(menuBar); final BrowserFrame browser = new BrowserFrame(ADMIN_MONITORING, new ExternalResource(MONITORING_CONTEXT_PATH)); browser.setSizeFull(); content.addComponent(browser); content.setExpandRatio(browser, ContentRatio.FULL_SIZE); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_MONITORING_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId); return content; }
Example 20
Source File: ServerDescBasic.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { setHeight("100%"); addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setWidth("100%"); layout.setHeight("100%"); layout.setMargin(true); layout.setSpacing(false); layout.addStyleName("server-desc-basic"); HorizontalLayout layout2 = new HorizontalLayout(); layout2.setWidth("100%"); layout2.setHeight("100%"); layout2.setMargin(true); layout2.setSpacing(true); layout2.addStyleName("server-desc-basic"); // サーバ基本情報 left = new BasicInfo(); left.setWidth("100%"); layout2.addComponent(left); // 表同士の間隔をあける Label padding = new Label(" "); padding.setWidth("7px"); padding.setHeight("99%"); padding.addStyleName("desc-padding"); layout2.addComponent(padding); Label padding2 = new Label(""); padding2.setWidth("1px"); layout2.addComponent(padding2); // 割り当てサービス String enableService = Config.getProperty("ui.enableService"); if (enableService == null || BooleanUtils.toBoolean(enableService)) { right = new AttachService(); right.setHeight("100%"); right.setWidth("100%"); layout2.addComponent(right); } layout2.setExpandRatio(left, 40); if (right != null) { layout2.setExpandRatio(right, 60); } else { VerticalLayout dummyLayout = new VerticalLayout(); dummyLayout.setSizeFull(); layout2.addComponent(dummyLayout); layout2.setExpandRatio(dummyLayout, 60); } layout.addComponent(layout2); layout.setExpandRatio(layout2, 1.0f); }