public OrderChanger(final Indexed container, final Object itemId) { HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(up); up.setIcon(new ThemeResource("../runo/icons/32/arrow-up.png")); up.addStyleName(BaseTheme.BUTTON_LINK); up.addListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { int newIndex = container.indexOfId(itemId) - 1; container.removeItem(itemId); container.addItemAt(newIndex, itemId); up.setEnabled(newIndex > 0); } }); up.setEnabled(container.indexOfId(itemId) > 0); layout.addComponent(down); down.setIcon(new ThemeResource("../runo/icons/32/arrow-down.png")); down.addStyleName(BaseTheme.BUTTON_LINK); down.addListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { int newIndex = container.indexOfId(itemId) + 1; container.removeItem(itemId); container.addItemAt(newIndex, itemId); down.setEnabled(newIndex < container.size() - 1); } }); down.setEnabled(container.indexOfId(itemId) < container.size() - 1); setCompositionRoot(layout); }
public HorizontalLayout createTopBar() { TextField filter = new TextField(); filter.setStyleName("filter-textfield"); filter.setInputPrompt("Filter"); ResetButtonForTextField.extend(filter); filter.setImmediate(true); filter.addTextChangeListener( new FieldEvents.TextChangeListener() { @Override public void textChange(FieldEvents.TextChangeEvent event) { grid.setFilter(event.getText()); } }); newProduct = new Button("New product"); newProduct.addStyleName(ValoTheme.BUTTON_PRIMARY); newProduct.setIcon(FontAwesome.PLUS_CIRCLE); newProduct.addClickListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { viewLogic.newProduct(); } }); HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setSpacing(true); topLayout.setWidth("100%"); topLayout.addComponent(filter); topLayout.addComponent(newProduct); topLayout.setComponentAlignment(filter, Alignment.MIDDLE_LEFT); topLayout.setExpandRatio(filter, 1); topLayout.setStyleName("top-bar"); return topLayout; }
@Override protected void setup() { HorizontalLayout hl = new HorizontalLayout(); hl.setWidth("250px"); final String longString = "this is a somewhat long string."; final Label longLabel = new Label(longString); Button changeLength = new Button("Change length"); changeLength.addListener( new Button.ClickListener() { public void buttonClick(ClickEvent event) { if (longLabel.getValue().equals(longString)) { longLabel.setValue(""); } else { longLabel.setValue(longString); } } }); hl.addComponent(longLabel); hl.addComponent(changeLength); addComponent(hl); }
/* * (non-Javadoc) * * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. * VaadinRequest) */ @Override protected void setup(VaadinRequest request) { setSizeFull(); HorizontalLayout layout = new HorizontalLayout(); layout.setSizeFull(); layout.setSpacing(true); addComponent(layout); Table table1 = createTable("no scrolling, has context menu"); addActionHandler(table1); table1.addItem(); layout.addComponent(table1); Table table2 = createTable("should scroll, has context menu"); for (int i = 0; i < 100; ++i) { table2.addItem(); } addActionHandler(table2); layout.addComponent(table2); Table table3 = createTable("no scrolling, no context menu"); table3.addItem(); layout.addComponent(table3); Table table4 = createTable("should scroll, no context menu"); for (int i = 0; i < 100; ++i) { table4.addItem(); } layout.addComponent(table4); }
public ConfirmDialog( String caption, String message, String okButtonText, String cancelButtonText) { super(caption); super.setModal(true); super.setClosable(false); super.setResizable(false); VerticalLayout windowLayout = new VerticalLayout(); windowLayout.setMargin(true); // confirmation message windowLayout.addComponent(new Label(message, ContentMode.HTML)); windowLayout.setSpacing(true); // buttons HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.setWidth(100.0f, Unit.PERCENTAGE); windowLayout.addComponent(buttonsLayout); okButton = new Button(okButtonText); buttonsLayout.addComponent(okButton); okButton.setTabIndex(1); okButton.addClickListener(this); buttonsLayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER); cancelButton = new Button(cancelButtonText); buttonsLayout.addComponent(cancelButton); cancelButton.setTabIndex(0); cancelButton.setClickShortcut(KeyCode.ESCAPE, null); cancelButton.addClickListener(this); buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_CENTER); super.setContent(windowLayout); }
private HorizontalLayout createStyleToolbar() { HorizontalLayout toolbar = new HorizontalLayout(); Button boldButton = new Button(FontAwesome.BOLD); boldButton.addClickListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { updateSelectedCellsBold(); } }); ColorPicker backgroundColor = new ColorPicker(); backgroundColor.setCaption("Background Color"); backgroundColor.addColorChangeListener( new ColorChangeListener() { @Override public void colorChanged(ColorChangeEvent event) { updateSelectedCellsBackgroundColor(event.getColor()); } }); ColorPicker fontColor = new ColorPicker(); fontColor.setCaption("Font Color"); fontColor.addColorChangeListener( new ColorChangeListener() { @Override public void colorChanged(ColorChangeEvent event) { updateSelectedCellsFontColor(event.getColor()); } }); toolbar.addComponent(boldButton); toolbar.addComponent(backgroundColor); toolbar.addComponent(fontColor); return toolbar; }
private void buildLayout() { VerticalLayout top = new VerticalLayout(); Label l1 = new Label("Users"); l1.setStyleName("h2"); top.addComponent(l1); top.addComponent(fieldSearch); top.addComponent(filterCCNo); Label l2 = new Label("Rules"); l2.setStyleName("h2"); userGrid.setWidth("100%"); userGrid.setHeight("250px"); userRulesGrid.setWidth("100%"); userRulesGrid.setHeight("250px"); HorizontalLayout rulesButtons = new HorizontalLayout(); rulesButtons.addComponent(addUserRuleButton); rulesButtons.addComponent(editUserRuleButton); rulesButtons.addComponent(deleteUserRuleButton); Panel userPanel = new Panel(userGrid); Panel userRulesPanel = new Panel(userRulesGrid); VerticalLayout main = new VerticalLayout(top, userPanel, l2, userRulesGrid, rulesButtons); main.setMargin(new MarginInfo(false, true, false, true)); setContent(main); }
/** * 页面底部版权 Bar * * @return */ public HorizontalLayout getPageFooter() { // 底部公司介绍 水平布局 HorizontalLayout footer = new HorizontalLayout(); footer.setWidth(100, Unit.PERCENTAGE); footer.setMargin(true); footer.addStyleName(Reindeer.LAYOUT_BLACK); // -----------------------底部公司介绍------------------------------- Label lbcopyright = new Label("Copyright 2014"); lbcopyright.setSizeUndefined(); // lbcopyright.addStyleName(Reindeer.LABEL_H2); Label lbcompany = new Label("上海释伟科技有限公司"); // lbcompany.addStyleName(Reindeer.LABEL_H2); Label lbdesc = new Label("留夫鸭电子商务O2O解决方案"); // lbdesc.addStyleName(Reindeer.LABEL_H2); Label lbspace = new Label(); // 占位空间 lbspace.setWidth(520, Unit.PIXELS); footer.setSpacing(true); // 设置间隙 footer.addComponent(lbcopyright); footer.setComponentAlignment(lbcopyright, Alignment.MIDDLE_LEFT); // footer.addComponent(lbspace); footer.addComponent(lbdesc); footer.setComponentAlignment(lbdesc, Alignment.MIDDLE_LEFT); footer.addComponent(lbspace); footer.addComponent(lbcompany); footer.setComponentAlignment(lbcompany, Alignment.MIDDLE_LEFT); return footer; }
private void initComponents() { setSpacing(true); HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); cardNuberField = new TextField(); cardNuberField.setWidth("100%"); cardNuberField.setInputPrompt("Ноомер социальной карты, либо e-mail"); layout.addComponent(cardNuberField); layout.setComponentAlignment(cardNuberField, Alignment.MIDDLE_RIGHT); layout.setExpandRatio(cardNuberField, 1.0f); addComponent(layout); layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); checkwordField = new TextField(); checkwordField.setWidth("100%"); checkwordField.setInputPrompt("Проверочное слово"); layout.addComponent(checkwordField); layout.setComponentAlignment(checkwordField, Alignment.MIDDLE_RIGHT); layout.setExpandRatio(checkwordField, 1.0f); addComponent(layout); Button btnSearch = new Button("Найти"); btnSearch.addClickListener(getSearchClickListener()); addComponent(btnSearch); }
protected HorizontalLayout generateActionButtons(Object taskItemId) { HorizontalLayout actionButtons = new HorizontalLayout(); FormDefinition form = taskFormModel.getForm(taskItemId); Button formButton = new Button( form == null ? i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_FORM_CREATE) : i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_FORM_EDIT)); formButton.addListener(new ShowFormClickListener(taskFormModel, taskItemId)); formButton.setData(taskItemId); actionButtons.addComponent(formButton); Button deleteTaskButton = new Button("-"); deleteTaskButton.setData(taskItemId); deleteTaskButton.addListener(new DeleteTaskClickListener(this)); actionButtons.addComponent(deleteTaskButton); Button addTaskButton = new Button("+"); addTaskButton.setData(taskItemId); addTaskButton.addListener(new AddTaskClickListener(this)); actionButtons.addComponent(addTaskButton); return actionButtons; }
private TableEmployee showOrganizationLabelsAndButtons(Long id) { panel.removeAllComponents(); panel.addComponent(new ButtonCreateOrganization(treetable)); treetable.setCollapsed(id, false); Organization org = AdminServiceProvider.get().findOrganizationById(id); Label nameLabel = new Label("Название: " + org.getName()); nameLabel.setStyleName("h2"); panel.addComponent(nameLabel); if (org.getCreator() != null) { Label creatorLabel = new Label("Создатель: " + org.getCreator().getLogin()); panel.addComponent(creatorLabel); } Format formatter = new SimpleDateFormat("dd.MM.yyyy hh:mm"); Label dateLabel = new Label("Дата создания: " + formatter.format(org.getDate())); panel.addComponent(dateLabel); panel.addComponent(groupLabel(id)); HorizontalLayout layoutButton = new HorizontalLayout(); layoutButton.addComponent(buttonEditOrganization(org, nameLabel)); layoutButton.addComponent(buttonCreateOrganization(org)); TableEmployee tableEmployee = new TableOrganizationEmployee(id); tableEmployee.setMargin(true, false, false, false); layoutButton.addComponent(buttonCreateEmployee(id)); layoutButton.setMargin(true, false, false, false); layoutButton.addComponent(createGroupLabel(id)); panel.addComponent(layoutButton); return tableEmployee; }
@AutoGenerated private HorizontalLayout buildConfirmDiv() { // common part: create layout confirmDiv = new HorizontalLayout(); confirmDiv.setImmediate(false); confirmDiv.setWidth("100.0%"); confirmDiv.setHeight("100.0%"); confirmDiv.setMargin(false); // confirmLabel confirmLabel = new Label(); confirmLabel.setImmediate(false); confirmLabel.setWidth("52px"); confirmLabel.setHeight("-1px"); confirmLabel.setValue("Confirm:"); confirmDiv.addComponent(confirmLabel); confirmDiv.setComponentAlignment(confirmLabel, new Alignment(9)); // passwordConfirm passwordConfirm = new PasswordField(); passwordConfirm.setCaption("Need confirm password:"******"195px"); passwordConfirm.setHeight("20px"); passwordConfirm.setRequired(true); confirmDiv.addComponent(passwordConfirm); confirmDiv.setExpandRatio(passwordConfirm, 1.0f); confirmDiv.setComponentAlignment(passwordConfirm, new Alignment(34)); return confirmDiv; }
@AutoGenerated private HorizontalLayout buildCompanyDiv() { // common part: create layout companyDiv = new HorizontalLayout(); companyDiv.setImmediate(false); companyDiv.setWidth("299px"); companyDiv.setHeight("31px"); companyDiv.setMargin(false); // companyLabel companyLabel = new Label(); companyLabel.setStyleName("companyLabel"); companyLabel.setImmediate(false); companyLabel.setWidth("63px"); companyLabel.setHeight("15px"); companyLabel.setValue("Company:"); companyDiv.addComponent(companyLabel); // company company = new TextField(); company.setImmediate(false); company.setWidth("202px"); company.setHeight("20px"); company.setRequired(true); company.setSecret(false); companyDiv.addComponent(company); companyDiv.setComponentAlignment(company, new Alignment(34)); return companyDiv; }
@AutoGenerated private HorizontalLayout buildPasswordDiv() { // common part: create layout passwordDiv = new HorizontalLayout(); passwordDiv.setImmediate(false); passwordDiv.setDescription("Your password"); passwordDiv.setWidth("291px"); passwordDiv.setHeight("34px"); passwordDiv.setMargin(false); // passwordLabel passwordLabel = new Label(); passwordLabel.setImmediate(false); passwordLabel.setWidth("80px"); passwordLabel.setHeight("20px"); passwordLabel.setValue("Password:"******"Need Password"); passwordField.setImmediate(false); passwordField.setWidth("197px"); passwordField.setHeight("20px"); passwordField.setRequired(true); passwordDiv.addComponent(passwordField); passwordDiv.setComponentAlignment(passwordField, new Alignment(34)); return passwordDiv; }
@AutoGenerated private HorizontalLayout buildLastNameDiv() { // common part: create layout lastNameDiv = new HorizontalLayout(); lastNameDiv.setImmediate(false); lastNameDiv.setWidth("291px"); lastNameDiv.setHeight("45px"); lastNameDiv.setMargin(false); // lastNameLabel lastNameLabel = new Label(); lastNameLabel.setStyleName("lastNameLabel"); lastNameLabel.setImmediate(false); lastNameLabel.setWidth("69px"); lastNameLabel.setHeight("60.0%"); lastNameLabel.setValue("Last Name:"); lastNameDiv.addComponent(lastNameLabel); lastNameDiv.setComponentAlignment(lastNameLabel, new Alignment(9)); // lastName lastName = new TextField(); lastName.setStyleName("lastName"); lastName.setCaption("Last Name Required:"); lastName.setImmediate(false); lastName.setWidth("202px"); lastName.setHeight("20px"); lastName.setRequired(true); lastName.setSecret(false); lastNameDiv.addComponent(lastName); lastNameDiv.setComponentAlignment(lastName, new Alignment(34)); return lastNameDiv; }
private void assembleSearchLayout() { logger.info( "Company ID : " + companyid + " | User Name : " + username + " > " + "Assembling search layout"); // Remove all components in User Input Layout hlSearchLayout.removeAllComponents(); hlSearchLayout.setMargin(true); // Add components for Search Layout flColumn1 = new GERPFormLayout(); flColumn2 = new GERPFormLayout(); flColumn3 = new GERPFormLayout(); flColumn4 = new GERPFormLayout(); flColumn1.addComponent(cbproduct); flColumn2.addComponent(dfemailStartdate); flColumn2.setSpacing(true); flColumn3.addComponent(dfemailEndDate); flColumn3.setMargin(true); flColumn3.setSpacing(true); flColumn4.addComponent(tfemailid); hlSearchLayout.addComponent(flColumn1); hlSearchLayout.addComponent(flColumn2); hlSearchLayout.addComponent(flColumn3); hlSearchLayout.addComponent(flColumn4); hlSearchLayout.setSizeUndefined(); hlSearchLayout.setMargin(true); }
@AutoGenerated private HorizontalLayout buildEmailDiv() { // common part: create layout emailDiv = new HorizontalLayout(); emailDiv.setImmediate(false); emailDiv.setWidth("291px"); emailDiv.setHeight("100.0%"); emailDiv.setMargin(false); // emailLabel emailLabel = new Label(); emailLabel.setStyleName("emailLabel"); emailLabel.setImmediate(false); emailLabel.setWidth("63px"); emailLabel.setHeight("15px"); emailLabel.setValue("Email:"); emailDiv.addComponent(emailLabel); emailDiv.setComponentAlignment(emailLabel, new Alignment(9)); // email email = new TextField(); email.setCaption("Email Required"); email.setImmediate(false); email.setWidth("197px"); email.setHeight("18px"); email.setRequired(true); email.setSecret(false); emailDiv.addComponent(email); emailDiv.setComponentAlignment(email, new Alignment(34)); return emailDiv; }
@AutoGenerated private HorizontalLayout buildWorkAreaLayout() { // common part: create layout workAreaLayout = new HorizontalLayout(); workAreaLayout.setImmediate(false); workAreaLayout.setWidth("100.0%"); workAreaLayout.setHeight("100.0%"); workAreaLayout.setMargin(false); // availableModulesComponent availableModulesComponent = new AvailableModulesComponent(); availableModulesComponent.setImmediate(false); availableModulesComponent.setWidth("-1px"); availableModulesComponent.setHeight("100.0%"); workAreaLayout.addComponent(availableModulesComponent); // configuratedModulesComponent configuratedModulesComponent = new ConfiguratedModulesComponent(); configuratedModulesComponent.setImmediate(false); configuratedModulesComponent.setWidth("100.0%"); configuratedModulesComponent.setHeight("100.0%"); workAreaLayout.addComponent(configuratedModulesComponent); workAreaLayout.setExpandRatio(configuratedModulesComponent, 1.0f); return workAreaLayout; }
public void onSuccessfulLogin2() { this.context = (WebApplicationContext) getContext(); context .getHttpSession() .setAttribute("session", HibernateUtil.getSessionFactory().openSession()); context.getHttpSession().setAttribute("userName", userCurrent.getName()); controlUserPermissions = new ControlUserPermissions(userCurrent, context); String propName = this.getProperty("pathEntityOrder"); String propPath = this.getContext().getBaseDirectory().getAbsolutePath() + File.separator + propName; HibernateUtil.getEntityOrder(propPath); /** * ******************************************** Cabecera * ****************************************************** */ HorizontalLayout headHorizontalLayout = new HorizontalLayout(); headHorizontalLayout.setWidth("100%"); headHorizontalLayout.setHeight("80"); logoPNG = new Embedded(null, new ThemeResource("images/logo.png")); logoPNG.setWidth("140"); logoPNG.setHeight("60"); headHorizontalLayout.addComponent(logoPNG); headHorizontalLayout.setComponentAlignment(logoPNG, Alignment.MIDDLE_LEFT); headHorizontalLayout.setExpandRatio(logoPNG, 3); UserTab userTab = new UserTab(this); headHorizontalLayout.addComponent(userTab); headHorizontalLayout.setComponentAlignment(userTab, Alignment.MIDDLE_RIGHT); headHorizontalLayout.setExpandRatio(userTab, 1); /** * ********************************************************************* * *************************************** */ /** * ******************************************** Barra Menú * **************************************************** */ toolbar = new YacareToolbar(this); /** * ********************************************************************* * *************************************** */ /** * ******************************************** Cuerpo de página * ********************************************** */ bodyPageVerticalLayout = new VerticalLayout(); bodyPageVerticalLayout.addComponent(headHorizontalLayout); bodyPageVerticalLayout.addComponent(toolbar); YacareFooter footer = new YacareFooter(); bodyPageVerticalLayout.addComponent(footer); bodyPageVerticalLayout.setComponentAlignment(footer, Alignment.BOTTOM_CENTER); /** * ********************************************************************* * *************************************** */ getMainWindow().setContent(bodyPageVerticalLayout); }
@AutoGenerated private HorizontalLayout buildHorizontalLayout_2() { // common part: create layout horizontalLayout_2 = new HorizontalLayout(); horizontalLayout_2.setImmediate(false); horizontalLayout_2.setWidth("-1px"); horizontalLayout_2.setHeight("-1px"); horizontalLayout_2.setMargin(true); horizontalLayout_2.setSpacing(true); // btnCrearUsuario btnCrearUsuario = new Button(); btnCrearUsuario.setCaption("Crear"); btnCrearUsuario.setImmediate(true); btnCrearUsuario.setWidth("80px"); btnCrearUsuario.setHeight("-1px"); horizontalLayout_2.addComponent(btnCrearUsuario); // btnEliminarUsuario btnEliminarUsuario = new Button(); btnEliminarUsuario.setCaption("Eliminar"); btnEliminarUsuario.setImmediate(true); btnEliminarUsuario.setWidth("-1px"); btnEliminarUsuario.setHeight("-1px"); horizontalLayout_2.addComponent(btnEliminarUsuario); return horizontalLayout_2; }
@AutoGenerated private HorizontalLayout buildHorizontalLayout_1() { // common part: create layout horizontalLayout_1 = new HorizontalLayout(); horizontalLayout_1.setImmediate(false); horizontalLayout_1.setWidth("-1px"); horizontalLayout_1.setHeight("-1px"); horizontalLayout_1.setMargin(false); horizontalLayout_1.setSpacing(true); // cmbPolicia cmbPolicia = new ComboBox(); cmbPolicia.setCaption("Policia"); cmbPolicia.setImmediate(false); cmbPolicia.setWidth("230px"); cmbPolicia.setHeight("-1px"); horizontalLayout_1.addComponent(cmbPolicia); // btnAgregarPolicia btnAgregarPolicia = new Button(); btnAgregarPolicia.setCaption(" "); btnAgregarPolicia.setImmediate(true); btnAgregarPolicia.setWidth("-1px"); btnAgregarPolicia.setHeight("-1px"); horizontalLayout_1.addComponent(btnAgregarPolicia); horizontalLayout_1.setComponentAlignment(btnAgregarPolicia, new Alignment(9)); return horizontalLayout_1; }
private void initLayout() { horizontalLayout = new HorizontalLayout(); uriFragmentUtility.addListener( new FragmentChangedListener() { @Override public void fragmentChanged(FragmentChangedEvent source) { String fragment = uriFragmentUtility.getFragment(); if (!uriCallbacks.isEmpty() && Strings.hasText(fragment)) { for (UriChangedCallback callback : uriCallbacks) { callback.handle(fragment); } } } }); activityQueuesPane = new ActivityQueuesPane(this); initViewController(); activityQueuesPane.refreshData(); viewController.displayCurrentView(); removeAllComponents(); showHideButton0 = new Button(); showHideButton0.setStyleName(BaseTheme.BUTTON_LINK); showHideButton0.setIcon(resourceCache.getImage("/img/guzik_1.png")); showHideButton0.setSizeFull(); showHideButton1 = new Button(); showHideButton1.setStyleName(BaseTheme.BUTTON_LINK); showHideButton1.setIcon(resourceCache.getImage("/img/guzik_2.png")); showHideButton2 = new Button(); showHideButton2.setStyleName(BaseTheme.BUTTON_LINK); showHideButton2.setIcon(resourceCache.getImage("/img/guzik_2.png")); final VerticalLayout leftPanel = verticalLayout( showHideButton1, new NewProcessExtendedPane(bpmSession, i18NSource, this), activityQueuesPane, new ActivityFiltersPane(this), showHideButton2); leftPanelTrigger = new LeftPanelVisibilityTrigger(leftPanel, true); leftPanel.setWidth(300, Sizeable.UNITS_PIXELS); showHideButton0.addListener(leftPanelTrigger); showHideButton1.addListener(leftPanelTrigger); showHideButton2.addListener(leftPanelTrigger); ComponentContainer viewContainer = viewController.getViewContainer(); horizontalLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE); horizontalLayout.addComponent(leftPanel); horizontalLayout.addComponent(viewContainer); horizontalLayout.setExpandRatio(viewContainer, 1.0f); addComponent(showHideButton0); addComponent(horizontalLayout); addComponent(uriFragmentUtility); }
@Override public void attach() { // System.out.println("refer url is: "+referrer); // System.out.println("Start to read the window name: "); // List<String> wNames = new ArrayList<String>(); // for(Window w:getWindows()){ // wNames.add(w.getName()); // System.out.println("window name is: "+w.getName()); // } // getApplication().getMainWindow().removeAllComponents(); VerticalLayout userAuthLayout = new VerticalLayout(); userAuthLayout.addStyleName("sourceAppLayout"); Label comfireLable = new Label("Please Check the User Information"); comfireLable.addStyleName("comfireLable"); userAuthLayout.addComponent(comfireLable); // userAuthLayout.setComponentAlignment(comfireLable, Alignment.MIDDLE_RIGHT); HorizontalLayout g1 = new HorizontalLayout(); g1.addStyleName("sourceAPPAuthInfoLayout"); userAuthLayout.addComponent(g1); userAuthLayout.setComponentAlignment(g1, Alignment.MIDDLE_LEFT); // network infor Label networkInfo = new Label("Authencation Network"); networkInfo.addStyleName("inforCard"); g1.addComponent(networkInfo); g1.setComponentAlignment(networkInfo, Alignment.TOP_LEFT); Label autheFromSiteName = new Label("eBay"); autheFromSiteName.addStyleName("inforValue"); g1.addComponent(autheFromSiteName); g1.setComponentAlignment(autheFromSiteName, Alignment.TOP_RIGHT); HorizontalLayout g2 = new HorizontalLayout(); g2.addStyleName("sourceAPPAuthInfoLayout"); userAuthLayout.addComponent(g2); userAuthLayout.setComponentAlignment(g2, Alignment.MIDDLE_LEFT); // userName infor Label userNameInfo = new Label("User Info"); userNameInfo.addStyleName("inforCard"); userNameInfo.addStyleName("userNameInfo"); g2.addComponent(userNameInfo); g2.setComponentAlignment(userNameInfo, Alignment.TOP_LEFT); Label authUserName = new Label(referrer.split("username="******"inforValue"); g2.addComponent(authUserName); g2.setComponentAlignment(authUserName, Alignment.TOP_RIGHT); // // token expireDate infor // Label tokenInfo=new Label("Developer"); // g.addComponent(tokenInfo); // g.setComponentAlignment(tokenInfo,Alignment.MIDDLE_CENTER); // Label tokenExpireDate=new Label(referrer.split("username=")[1]); // g.addComponent(authUserName); // g.setComponentAlignment(authUserName,Alignment.MIDDLE_CENTER); userAuthLayout.addComponent(getWebFoot()); this.setContent(userAuthLayout); }
public LoadForm(BWPresentation bwPresentation) { bwSpecReceiver = new SpecificationReceiver(bwPresentation); // Upload buttons setMargin(true); setWidth("320px"); setHeight("120px"); // Load goal specification (upload) Upload uploadBW = new Upload("Upload the Blended Workflow specification here:", this.bwSpecReceiver); uploadBW.setButtonCaption("Submit"); uploadBW.addListener((Upload.SucceededListener) this.bwSpecReceiver); uploadBW.addListener((Upload.FailedListener) this.bwSpecReceiver); HorizontalLayout submitPanel = new HorizontalLayout(); submitPanel.setSpacing(true); Button bwSpecificationLoadBtn = new Button("Load"); bwSpecificationLoadBtn.addListener( new ClickListener() { @Atomic(mode = TxMode.WRITE) @Override public void buttonClick(ClickEvent event) { try { String bwSpec = bwSpecReceiver.getSpecInString(); if (bwSpec != null) { BlendedWorkflow.getInstance().getBwManager().loadBWSpecification(bwSpec); getApplication().getMainWindow().removeWindow(LoadForm.this.getWindow()); } else { getApplication() .getMainWindow() .showNotification("Blended Workflow Specification missing"); } } catch (java.lang.NullPointerException jle) { getApplication() .getMainWindow() .showNotification( "Please upload a Blended Workflow Specifications", Notification.TYPE_ERROR_MESSAGE); } } }); submitPanel.addComponent(bwSpecificationLoadBtn); Button cancel = new Button("Cancel"); cancel.addListener( new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { getApplication().getMainWindow().removeWindow(LoadForm.this.getWindow()); } }); submitPanel.addComponent(cancel); addComponent(uploadBW); addComponent(submitPanel); setComponentAlignment(submitPanel, Alignment.BOTTOM_CENTER); }
/** * Build content 'evaluation process' of tab 3. * * @return content of third tab */ private Layout buildTab3Content() { VerticalLayout tab3Content = new VerticalLayout(); tab3Content.setSpacing(true); tab3Content.setMargin(true); tab3Content.setSizeFull(); Label instructions = new Label( "<b>Instructions:</b> <i>Please select and click a sentence below in order to process the evaluation.</i>", Label.CONTENT_XHTML); tab3Content.addComponent(instructions); this.tableEvaluation = new Table("Evaluation process:"); tableEvaluation.setHeight("150px"); tableEvaluation.setWidth("100%"); tableEvaluation.setImmediate(true); tableEvaluation.setSelectable(true); tableEvaluation.setMultiSelect(false); tableEvaluation.setSortDisabled(false); tableEvaluation.addContainerProperty("ID", Integer.class, null); tableEvaluation.addContainerProperty("Sentence", String.class, null); tableEvaluation.addContainerProperty("Precision", Double.class, null); tableEvaluation.addContainerProperty("Recall", Double.class, null); tableEvaluation.addContainerProperty("F-Score", Double.class, null); tab3Content.addComponent(tableEvaluation); this.buttonNext2 = new Button("Next"); buttonNext2.setImmediate(true); buttonNext2.setDescription("Get the next sentence in table"); tab3Content.addComponent(buttonNext2); this.textAreaEvalSentence = new TextArea("Sentence:"); textAreaEvalSentence.setImmediate(false); textAreaEvalSentence.setReadOnly(true); textAreaEvalSentence.setRows(3); textAreaEvalSentence.setWidth("100%"); tab3Content.addComponent(textAreaEvalSentence); HorizontalLayout hlay1 = new HorizontalLayout(); this.listSelectGoldstandard = new ListSelect("Goldstandard:"); listSelectGoldstandard.setImmediate(true); listSelectGoldstandard.setHeight("120px"); listSelectGoldstandard.setWidth("100%"); listSelectGoldstandard.setNullSelectionAllowed(false); this.listSelectFramework = new ListSelect("Framework:"); listSelectFramework.setImmediate(true); listSelectFramework.setHeight("120px"); listSelectFramework.setWidth("100%"); listSelectFramework.setNullSelectionAllowed(false); hlay1.setSpacing(true); hlay1.setMargin(false); hlay1.setWidth("100%"); hlay1.addComponent(listSelectGoldstandard); hlay1.addComponent(listSelectFramework); tab3Content.addComponent(hlay1); return tab3Content; }
public void buildView() { TabSheet tabSheet = new TabSheet(); tabSheet.setSizeFull(); VerticalLayout layoutUtama = new VerticalLayout(); layoutUtama.setSizeFull(); layoutUtama.setMargin(true); // LAYOUT TOP VerticalLayout layoutTop = new VerticalLayout(); layoutTop.setMargin(true); HorizontalLayout layoutTopInner1 = new HorizontalLayout(); HorizontalLayout layoutTopInner2 = new HorizontalLayout(); layoutTop.addComponent(layoutTopInner1); layoutTop.addComponent(layoutTopInner2); // LAYOUT TABLE VerticalLayout layoutTable = new VerticalLayout(); layoutTable.setSizeFull(); layoutTable.addComponent(table); table.setSizeFull(); // LAYOUT BOTTOM VerticalLayout layoutBottom = new VerticalLayout(); HorizontalLayout layoutFooter1 = new HorizontalLayout(); HorizontalLayout layoutFooter2 = new HorizontalLayout(); layoutBottom.addComponent(layoutFooter1); layoutBottom.addComponent(layoutFooter2); // LAYOUT UTAMA layoutUtama.addComponent(layoutTop); layoutUtama.addComponent(layoutTable); layoutUtama.addComponent(layoutBottom); tabSheet.addComponent(layoutUtama); content.addComponent(tabSheet); setCompositionRoot(content); // Extended Konfigurasi Size layoutUtama.setExpandRatio(layoutTable, 1); layoutTopInner1.addComponent(fieldSearchById); layoutTopInner1.setComponentAlignment(fieldSearchById, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(comboSearchByDivision); layoutTopInner1.setComponentAlignment(comboSearchByDivision, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(dateFieldSearchByTransdateFrom); layoutTopInner1.setComponentAlignment(dateFieldSearchByTransdateFrom, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(dateFieldSearchByTransdateTo); layoutTopInner1.setComponentAlignment(dateFieldSearchByTransdateTo, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(btnSearch); layoutTopInner1.setComponentAlignment(btnSearch, Alignment.BOTTOM_CENTER); layoutBottom.addComponent(btnSelect); // init formLayout.setVisible(true); }
@Override protected Component render() { final HorizontalLayout horizontalLayout = new HorizontalLayout(); label = new Label(); horizontalLayout.addComponent(label); final Upload upload = new Upload(); horizontalLayout.addComponent(upload); return horizontalLayout; }
private void BuildMenuBar() { menuBar.addComponent(branding); menuBar.addComponent(menu); menuBar.addComponent(settings); menuBar.addStyleName("sidebar"); // menuBar.setComponentAlignment(menu, Alignment.MIDDLE_CENTER); menuBar.setExpandRatio(menu, 1); menuBar.setWidth("100%"); }
@Override public void init() { UserService logins = new FileBasedUserService(loginFile); Provider<UploadBotHandler> handlerProvider = createUploadHandler(); UploadBotWidget uploadBotWidget = new UploadBotWidget(logins, handlerProvider); HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(uploadBotWidget); layout.addComponent(new BotStatusWidget(logins, outputDir)); setMainWindow(new Window("Submit your bot", layout)); }
/** * LanguageSelect constructor. * * @param inPreferences {@link PreferencesHelper} * @param inConfigManager {@link ConfigManager} * @param inUser {@link User} */ public LanguageSelect( final PreferencesHelper inPreferences, final ConfigManager inConfigManager, final User inUser) { super(); // initialize language form prefs (1) or config admin (2) // final String lActiveLanguage = inPreferences.getLocale(inUser, // new Locale(inConfigManager.getLanguage())).getLanguage(); setStyleName("ripla-language-select"); // $NON-NLS-1$ setSizeUndefined(); layout = new HorizontalLayout(); setCompositionRoot(layout); layout.setHeight(22, Unit.PIXELS); layout.setSpacing(true); final Label lLabel = new Label( Activator.getMessages().getMessage("toolbar.label.language"), ContentMode.HTML); // $NON-NLS-1$ lLabel.setStyleName("ripla-toolbar-label"); // $NON-NLS-1$ lLabel.setSizeUndefined(); layout.addComponent(lLabel); layout.setComponentAlignment(lLabel, Alignment.MIDDLE_LEFT); layout.setExpandRatio(lLabel, 1); select = createSelect(); select.addValueChangeListener( new Property.ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent inEvent) { final Locale lNew = ((LocaleAdapter) select.getValue()).getLocale(); final Locale lOld = VaadinSession.getCurrent().getLocale(); if (!lOld.equals(lNew)) { VaadinSession.getCurrent().setLocale(lNew); if (listener != null) { listener.processAction( new IToolbarAction() { @Override public void run() { LOG.trace("Setting language preference to {}.", lNew.getLanguage()); VaadinSession.getCurrent() .getAttribute(IRiplaEventDispatcher.class) .dispatch( org.ripla.interfaces.IRiplaEventDispatcher.Event.REFRESH, new HashMap<String, Object>()); } }); } } } }); layout.addComponent(select); }