List of usage examples for com.vaadin.ui GridLayout setColumnExpandRatio
public void setColumnExpandRatio(int columnIndex, float ratio)
From source file:dhbw.clippinggorilla.userinterface.windows.NewSourceWindow.java
public Component getFooter(Runnable cancelRunnable, Runnable nextRunnable, Component... extraComponents) { Label placeholder = new Label(); Button cancel = new Button(Language.get(Word.CANCEL), VaadinIcons.CLOSE); cancel.addClickListener(ce -> cancelRunnable.run()); Button next = new Button(Language.get(Word.NEXT), VaadinIcons.ARROW_RIGHT); next.addClickListener(ce -> nextRunnable.run()); GridLayout footer = new GridLayout(3 + extraComponents.length, 1); footer.setSpacing(true);/* w w w. j a va2 s. c o m*/ footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); footer.setWidth(100.0f, Sizeable.Unit.PERCENTAGE); footer.setSizeUndefined(); footer.setWidth("100%"); for (Component extraComponent : extraComponents) { footer.addComponent(extraComponent); footer.setComponentAlignment(extraComponent, Alignment.MIDDLE_CENTER); } footer.addComponents(placeholder, cancel, next); footer.setColumnExpandRatio(footer.getColumns() - 1 - 2, 1);//ExpandRatio(placeholder, 1); footer.setComponentAlignment(cancel, Alignment.MIDDLE_CENTER); footer.setComponentAlignment(next, Alignment.MIDDLE_CENTER); return footer; }
From source file:dhbw.clippinggorilla.userinterface.windows.RegisterWindow.java
public RegisterWindow() { setModal(true);/*w ww . ja v a 2 s. c om*/ setResizable(false); setDraggable(false); setCaption(Language.get(Word.REGISTER)); addCloseShortcut(KeyCode.ENTER, null); Button save = new Button(Language.get(Word.REGISTER)); VerticalLayout windowLayout = new VerticalLayout(); windowLayout.setMargin(false); windowLayout.setSizeUndefined(); FormLayout forms = new FormLayout(); forms.setMargin(true); forms.setSizeUndefined(); TextField firstName = new TextField(Language.get(Word.FIRST_NAME)); firstName.focus(); firstName.setMaxLength(20); firstName.addValueChangeListener(event -> { String firstNameError = UserUtils.checkName(event.getValue()); if (!firstNameError.isEmpty()) { firstName.setComponentError(new UserError(firstNameError, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(firstNameError); save.setEnabled(setError(firstName, true)); } else { firstName.setComponentError(null); boolean enabled = setError(firstName, false); save.setEnabled(enabled); } }); forms.addComponent(firstName); TextField lastName = new TextField(Language.get(Word.LAST_NAME)); lastName.setMaxLength(20); lastName.addValueChangeListener(event -> { String lastNameError = UserUtils.checkName(event.getValue()); if (!lastNameError.isEmpty()) { lastName.setComponentError(new UserError(lastNameError, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(lastNameError); save.setEnabled(setError(lastName, true)); } else { lastName.setComponentError(null); save.setEnabled(setError(lastName, false)); } }); forms.addComponent(lastName); TextField userName = new TextField(Language.get(Word.USERNAME)); userName.setMaxLength(20); userName.addValueChangeListener(event -> { String userNameError = UserUtils.checkUsername(event.getValue()); if (!userNameError.isEmpty()) { userName.setComponentError(new UserError(userNameError, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(userNameError); save.setEnabled(setError(userName, true)); } else { userName.setComponentError(null); save.setEnabled(setError(userName, false)); } }); forms.addComponent(userName); TextField email1 = new TextField(Language.get(Word.EMAIL)); email1.setMaxLength(256); email1.addValueChangeListener(event -> { String email1Error = UserUtils.checkEmail(event.getValue().toLowerCase()); if (!email1Error.isEmpty()) { email1.setComponentError(new UserError(email1Error, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(email1Error); save.setEnabled(setError(email1, true)); } else { email1.setComponentError(null); save.setEnabled(setError(email1, false)); } }); forms.addComponent(email1); TextField email2 = new TextField(Language.get(Word.EMAIL_AGAIN)); email2.setMaxLength(256); email2.addValueChangeListener(event -> { String email2Error = UserUtils.checkEmail(event.getValue().toLowerCase()) + UserUtils.checkSecondEmail(email1.getValue().toLowerCase(), event.getValue().toLowerCase()); if (!email2Error.isEmpty()) { email2.setComponentError(new UserError(email2Error, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(email2Error); save.setEnabled(setError(email2, true)); } else { email2.setComponentError(null); save.setEnabled(setError(email2, false)); } }); forms.addComponent(email2); ProgressBar strength = new ProgressBar(); PasswordField password1 = new PasswordField(Language.get(Word.PASSWORD)); password1.setMaxLength(51); password1.addValueChangeListener(event -> { String password1Error = UserUtils.checkPassword(event.getValue()); strength.setValue(UserUtils.calculatePasswordStrength(event.getValue())); if (!password1Error.isEmpty()) { password1.setComponentError(new UserError(password1Error, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(password1Error); save.setEnabled(setError(password1, true)); } else { password1.setComponentError(null); save.setEnabled(setError(password1, false)); } }); forms.addComponent(password1); strength.setWidth("184px"); strength.setHeight("1px"); forms.addComponent(strength); PasswordField password2 = new PasswordField(Language.get(Word.PASSWORD_AGAIN)); password2.setMaxLength(51); password2.addValueChangeListener(event -> { String password2Error = UserUtils.checkPassword(event.getValue()) + UserUtils.checkSecondPassword(password1.getValue(), event.getValue()); if (!password2Error.isEmpty()) { password2.setComponentError(new UserError(password2Error, AbstractErrorMessage.ContentMode.HTML, ErrorMessage.ErrorLevel.INFORMATION)); VaadinUtils.infoNotification(password2Error); save.setEnabled(setError(password2, true)); } else { password2.setComponentError(null); save.setEnabled(setError(password2, false)); } }); forms.addComponent(password2); GridLayout footer = new GridLayout(3, 1); footer.setSpacing(true); footer.setSizeUndefined(); footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); footer.setWidth(100.0f, Unit.PERCENTAGE); Label placeholder = new Label(); Button cancel = new Button(Language.get(Word.CANCEL)); cancel.setIcon(VaadinIcons.CLOSE); cancel.addClickListener(ce -> { close(); }); cancel.setClickShortcut(KeyCode.ESCAPE, null); save.setEnabled(false); save.setIcon(VaadinIcons.CHECK); save.addStyleName(ValoTheme.BUTTON_PRIMARY); save.addClickListener(ce -> { try { User user = UserUtils.registerUser(userName.getValue(), password1.getValue(), password2.getValue(), email1.getValue().toLowerCase(), email2.getValue().toLowerCase(), firstName.getValue(), lastName.getValue()); UserUtils.setCurrentUser(user); close(); UI.getCurrent().addWindow(ActivateWindow.get()); } catch (UserCreationException ex) { Log.error("Registration failed", ex); VaadinUtils.errorNotification(Language.get(Word.REG_FAILED)); } }); save.setClickShortcut(KeyCode.ENTER, null); footer.addComponents(placeholder, cancel, save); footer.setColumnExpandRatio(0, 1);//ExpandRatio(placeholder, 1); footer.setComponentAlignment(cancel, Alignment.MIDDLE_CENTER); footer.setComponentAlignment(save, Alignment.MIDDLE_CENTER); windowLayout.addComponent(forms); windowLayout.addComponent(footer); setContent(windowLayout); }
From source file:dhbw.ka.mwi.businesshorizon2.ui.scenarioscreen.ScenarioScreenViewImpl.java
License:Open Source License
/** * Die Methode fuegt der View ein Szenario hinzu. Sie baut hierzu saemtliche * notwendigen GUI-Elemente und entsprechenden Listener hinzu. * //w w w . java2 s . co m * Auf ein GridLayout umgestellt. * * @author Julius Hacker, Tobias Lindner * @param rateReturnEquity Standardwert fuer die Renditeforderung Eigenkapital * @param rateReturnCapitalStock Standardwert fuer die Renditeforderung Fremdkapital * @param businessTax Standardwert fuer die Gewerbesteuer * @param corporateAndSolitaryTax Standardwert fuer die Koerperschaftssteuer mit Solidaritaetszuschlag. */ @Override public void addScenario(String rateReturnEquity, String rateReturnCapitalStock, String corporateAndSolitaryTax, String businessTax, String personalTaxRate, boolean isIncludeInCalculation, final int number) { HashMap<String, AbstractComponent> scenarioComponents = new HashMap<String, AbstractComponent>(); Property.ValueChangeListener changeListener = new Property.ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { presenter.updateScenario(number); logger.debug("TextChange ausgeloest"); logger.debug("ChangeListener " + System.identityHashCode(this)); presenter.isValid(); } }; final GridLayout gl = new GridLayout(3, 7); gl.addStyleName("gridLayoutScenarios"); gl.setSizeFull(); gl.setColumnExpandRatio(0, 2); gl.setColumnExpandRatio(1, 1); gl.setColumnExpandRatio(2, 1); final Label scenarioName = new Label("<strong>Szenario " + number + "</strong>"); scenarioName.setContentMode(Label.CONTENT_XHTML); scenarioComponents.put("label", scenarioName); logger.debug("SzenarioName: " + scenarioName); gl.addComponent(scenarioName, 0, 0); //EK Rendite final Label textEigenkapital = new Label("Renditeforderung Eigenkapital: "); textEigenkapital.setSizeFull(); final TextField tfEigenkapital = new TextField(); if (!"0.0".equals(rateReturnEquity)) { tfEigenkapital.setValue(rateReturnEquity); } tfEigenkapital.setImmediate(true); tfEigenkapital.addStyleName("scenario"); tfEigenkapital.addListener(changeListener); gl.addComponent(textEigenkapital, 0, 1); gl.addComponent(tfEigenkapital, 1, 1); scenarioComponents.put("rateReturnEquity", tfEigenkapital); // Fremdkapital final Label textFremdkapitel = new Label("Renditeforderung FK: "); final TextField tfFremdkapital = new TextField(); if (!"0.0".equals(rateReturnCapitalStock)) { tfFremdkapital.setValue(rateReturnCapitalStock); } tfFremdkapital.setImmediate(true); tfFremdkapital.addStyleName("scenario"); tfFremdkapital.addListener(changeListener); gl.addComponent(textFremdkapitel, 0, 2); gl.addComponent(tfFremdkapital, 1, 2); scenarioComponents.put("rateReturnCapitalStock", tfFremdkapital); //Gewerbesteuer final Label textGewerbesteuer = new Label("Gewerbesteuer:"); final TextField tfGewerbesteuer = new TextField(); if (!"0.0".equals(businessTax)) { tfGewerbesteuer.setValue(businessTax); } tfGewerbesteuer.setImmediate(true); tfGewerbesteuer.addStyleName("scenario"); tfGewerbesteuer.addListener(changeListener); gl.addComponent(textGewerbesteuer, 0, 3); gl.addComponent(tfGewerbesteuer, 1, 3); scenarioComponents.put("businessTax", tfGewerbesteuer); //Krperschaftssteuer final Label textKoerperschaftssteuer = new Label("Krperschaftssteuer mit Solidarittszuschlag: "); final TextField tfKoerperschaftssteuer = new TextField(); if (!"0.0".equals(corporateAndSolitaryTax)) { tfKoerperschaftssteuer.setValue(corporateAndSolitaryTax); } tfKoerperschaftssteuer.setImmediate(true); tfKoerperschaftssteuer.addStyleName("scenario"); tfKoerperschaftssteuer.addListener(changeListener); gl.addComponent(textKoerperschaftssteuer, 0, 4); gl.addComponent(tfKoerperschaftssteuer, 1, 4); scenarioComponents.put("corporateAndSolitaryTax", tfKoerperschaftssteuer); // Persnlicher Steuersatz final Label textPersonalTaxRate = new Label("pers\u00F6nlicher Steuersatz: "); final TextField tfPersonalTaxRate = new TextField(); if (!"0.0".equals(personalTaxRate)) { tfPersonalTaxRate.setValue(personalTaxRate); } tfPersonalTaxRate.setImmediate(true); tfPersonalTaxRate.addStyleName("scenario"); tfPersonalTaxRate.addListener(changeListener); gl.addComponent(textPersonalTaxRate, 0, 5); gl.addComponent(tfPersonalTaxRate, 1, 5); scenarioComponents.put("personalTaxRate", tfPersonalTaxRate); deleteIcon = new Embedded(null, new ThemeResource("./images/icons/newIcons/1418766003_editor_trash_delete_recycle_bin_-128.png")); deleteIcon.setHeight(60, UNITS_PIXELS); deleteIcon.addStyleName("deleteScenario"); deleteIcon.addListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void click(ClickEvent event) { presenter.removeScenario(number); } }); gl.addComponent(deleteIcon, 2, 0, 2, 6); gl.setComponentAlignment(deleteIcon, Alignment.MIDDLE_CENTER); final Label gap = new Label(); gap.setHeight(20, UNITS_PIXELS); gl.addComponent(gap, 0, 6); scenarioComponents.put("scenario", gl); this.scenarios.add(scenarioComponents); this.vlScenarios.addComponent(gl); //Button bei 3 Scenarios deaktivieren if (number == 3) { deactivateAddScenario(); } }
From source file:edu.kit.dama.ui.admin.schedule.SchedulerBasePropertiesLayout.java
License:Apache License
/** * Default constructor./* ww w . j a v a 2s . c o m*/ */ public SchedulerBasePropertiesLayout() { super(); LOGGER.debug("Building " + DEBUG_ID_PREFIX + " ..."); setId(DEBUG_ID_PREFIX.substring(0, DEBUG_ID_PREFIX.length() - 1)); setSizeFull(); setMargin(true); setSpacing(true); setColumns(3); setRows(3); //first row addComponent(getIdField(), 0, 0); addComponent(getGroupField(), 1, 0); addComponent(getNameField(), 2, 0); //second row addComponent(getDescriptionArea(), 0, 1, 2, 1); Button addTriggerButton = new Button(); addTriggerButton.setDescription("Add a new trigger."); addTriggerButton.setIcon(new ThemeResource(IconContainer.ADD)); addTriggerButton.addClickListener((Button.ClickEvent event) -> { addTrigger(); }); Button removeTriggerButton = new Button(); removeTriggerButton.setDescription("Remove the selected trigger."); removeTriggerButton.setIcon(new ThemeResource(IconContainer.DELETE)); removeTriggerButton.addClickListener((Button.ClickEvent event) -> { removeTrigger(); }); Button refreshTriggerButton = new Button(); refreshTriggerButton.setDescription("Refresh the list of triggers."); refreshTriggerButton.setIcon(new ThemeResource(IconContainer.REFRESH)); refreshTriggerButton.addClickListener((Button.ClickEvent event) -> { reloadTriggers(); }); VerticalLayout buttonLayout = new VerticalLayout(addTriggerButton, refreshTriggerButton, removeTriggerButton); buttonLayout.setComponentAlignment(addTriggerButton, Alignment.TOP_RIGHT); buttonLayout.setComponentAlignment(removeTriggerButton, Alignment.TOP_RIGHT); buttonLayout.setMargin(true); GridLayout triggerLayout = new UIUtils7.GridLayoutBuilder(2, 2).addComponent(getTriggerTable(), 0, 0, 1, 2) .addComponent(buttonLayout, 1, 0, 1, 2).getLayout(); triggerLayout.setSizeFull(); triggerLayout.setMargin(false); triggerLayout.setColumnExpandRatio(0, .95f); triggerLayout.setColumnExpandRatio(1, .05f); triggerLayout.setRowExpandRatio(0, .9f); triggerLayout.setRowExpandRatio(1, .05f); triggerLayout.setRowExpandRatio(2, .05f); //third row addComponent(triggerLayout, 0, 2, 2, 2); addTriggerComponent = new AddTriggerComponent(this); setRowExpandRatio(1, .3f); setRowExpandRatio(2, .6f); }
From source file:edu.kit.dama.ui.components.ConfirmationWindow7.java
License:Apache License
/** * Builds a customized subwindow <b>ConfirmationWindow</b> that allows the * user to confirm his previously requested action. * * @param pTitle The title of the window. * @param pMessage The message shown in the window. * @param pOptionType The type of the window (OK or YES_NO) which defines the * visible buttons./*ww w . j av a 2s . c om*/ * @param pMessageType The message type (INFORMATION, WARNING, ERROR) which * determines the icon. If pMessageType is null, no icon will be shown. * @param pListener The listener which receives the result if a button was * pressed or the window was closed. * */ ConfirmationWindow7(String pTitle, String pMessage, OPTION_TYPE pOptionType, MESSAGE_TYPE pMessageType, IConfirmationWindowListener7 pListener) { this.listener = pListener; //basic setup //set caption depending on type String caption = pTitle; if (caption == null) { if (pMessageType != null) { switch (pMessageType) { case QUESTION: caption = DEFAULT_TITLE; break; case INFORMATION: caption = "Information"; break; case WARNING: caption = "Warning"; break; case ERROR: caption = "Error"; break; } } else { //no type provided...use default title caption = DEFAULT_TITLE; } } setCaption(caption); setModal(true); center(); // Build line of buttons depending on pOptionType HorizontalLayout buttonLine = new HorizontalLayout(); buttonLine.setSpacing(true); buttonLine.setWidth("100%"); //add spacer Label spacer = new Label(); buttonLine.addComponent(spacer); //add buttons if (OPTION_TYPE.YES_NO_OPTION.equals(pOptionType)) { buttonLine.addComponent(buildYesButton("Yes")); buttonLine.addComponent(buildNoButton()); buttonLine.setComponentAlignment(yesButton, Alignment.MIDDLE_RIGHT); buttonLine.setComponentAlignment(noButton, Alignment.MIDDLE_RIGHT); //Assign ENTER to the YES button yesButton.setClickShortcut(ShortcutAction.KeyCode.ENTER, null); //Assign ESC to the NO button noButton.setClickShortcut(ShortcutAction.KeyCode.ESCAPE, null); } else { buttonLine.addComponent(buildYesButton("OK")); buttonLine.setComponentAlignment(yesButton, Alignment.MIDDLE_RIGHT); //Assign ENTER to the OK button yesButton.setClickShortcut(ShortcutAction.KeyCode.ENTER, null); //Assign ESC to close the dialog setCloseShortcut(ShortcutAction.KeyCode.ESCAPE, null); } buttonLine.setExpandRatio(spacer, 1.0f); //determine the icon depending on pMessageType ThemeResource icon = null; if (pMessageType != null) { switch (pMessageType) { case QUESTION: icon = new ThemeResource("img/24x24/question.png"); break; case INFORMATION: icon = new ThemeResource("img/24x24/information.png"); break; case WARNING: icon = new ThemeResource("img/24x24/warning.png"); break; case ERROR: icon = new ThemeResource("img/24x24/forbidden.png"); break; } } Component iconComponent = new Label(); if (icon != null) { //icon was set, overwrite icon component iconComponent = new Image(null, icon); } //build the message label Label message = new Label(pMessage, ContentMode.HTML); message.setSizeUndefined(); //build the main layout GridLayout mainLayout = new UIUtils7.GridLayoutBuilder(2, 2) .addComponent(iconComponent, Alignment.TOP_LEFT, 0, 0, 1, 1).addComponent(message, 1, 0, 1, 1) .addComponent(buttonLine, 0, 1, 2, 1).getLayout(); mainLayout.setMargin(true); mainLayout.setSpacing(true); mainLayout.setColumnExpandRatio(0, .05f); mainLayout.setColumnExpandRatio(1, 1f); mainLayout.setRowExpandRatio(0, 1f); mainLayout.setRowExpandRatio(1, .05f); setContent(mainLayout); //add the close listener addCloseListener(new CloseListener() { @Override public void windowClose(CloseEvent e) { fireCloseEvents(RESULT.CANCEL); } }); }
From source file:edu.kit.dama.ui.simon.panel.SimonMainPanel.java
License:Apache License
/** * Create the tab for a single category. * * @param pProbes The probes of this category. * * @return The category tab component.//from w ww . j a v a 2 s .co m */ private Component createCategoryTab(List<AbstractProbe> pProbes) { UIUtils7.GridLayoutBuilder layoutBuilder = new UIUtils7.GridLayoutBuilder(2, pProbes.size()); int row = 0; for (AbstractProbe probe : pProbes) { Embedded status = new Embedded(null, getResourceForStatus(probe.getCurrentStatus())); Label name = new Label(probe.getName()); layoutBuilder.addComponent(status, Alignment.MIDDLE_LEFT, 0, row, 1, 1).addComponent(name, Alignment.MIDDLE_LEFT, 1, row, 1, 1); row++; } GridLayout tabLayout = layoutBuilder.getLayout(); tabLayout.setColumnExpandRatio(0, .01f); tabLayout.setColumnExpandRatio(1, 1.0f); tabLayout.setImmediate(true); tabLayout.setSpacing(true); tabLayout.setMargin(true); tabLayout.setWidth("100%"); return tabLayout; }
From source file:edu.nps.moves.mmowgliMobile.ui.UserRenderer2.java
License:Open Source License
public void setMessage(FullEntryView2 mView, ListEntry message, ListView2 messageList, AbstractOrderedLayout layout) {// w ww . ja va 2 s. co m // messageList can be null if coming in from ActionPlan Object key = HSess.checkInit(); UserListEntry wu = (UserListEntry) message; User u = wu.getUser(); layout.removeAllComponents(); HorizontalLayout hlay = new HorizontalLayout(); layout.addComponent(hlay); hlay.addStyleName("m-userview-top"); hlay.setWidth("100%"); hlay.setMargin(true); hlay.setSpacing(true); Image img = new Image(); img.addStyleName("m-ridgeborder"); img.setSource(mediaLocator.locate(u.getAvatar().getMedia())); img.setWidth("90px"); img.setHeight("90px"); hlay.addComponent(img); hlay.setComponentAlignment(img, Alignment.MIDDLE_CENTER); Label lab; hlay.addComponent(lab = new Label()); lab.setWidth("5px"); VerticalLayout vlay = new VerticalLayout(); vlay.setSpacing(true); hlay.addComponent(vlay); hlay.setComponentAlignment(vlay, Alignment.MIDDLE_LEFT); vlay.setWidth("100%"); hlay.setExpandRatio(vlay, 1.0f); HorizontalLayout horl = new HorizontalLayout(); horl.setSpacing(false); vlay.addComponent(horl); vlay.setComponentAlignment(horl, Alignment.BOTTOM_LEFT); horl.addComponent(lab = new Label("name")); lab.addStyleName("m-user-top-label"); //light-text"); horl.addComponent(lab = new HtmlLabel(" " + u.getUserName())); lab.addStyleName("m-user-top-value"); horl = new HorizontalLayout(); horl.setSpacing(false); vlay.addComponent(horl); vlay.setComponentAlignment(horl, Alignment.TOP_LEFT); horl.addComponent(lab = new Label("level")); lab.addStyleName("m-user-top-label"); //light-text"); Level lev = u.getLevel(); if (u.isGameMaster()) { Level l = Level.getLevelByOrdinal(Level.GAME_MASTER_ORDINAL, HSess.get()); if (l != null) lev = l; } horl.addComponent(lab = new HtmlLabel(" " + lev.getDescription())); lab.addStyleName("m-user-top-value"); GridLayout gLay = new GridLayout(); // gLay.setHeight("155px"); // won't size properly gLay.setMargin(true); gLay.addStyleName("m-userview-mid"); gLay.setColumns(2); gLay.setRows(11); gLay.setSpacing(true); gLay.setWidth("100%"); gLay.setColumnExpandRatio(1, 1.0f); layout.addComponent(gLay); addRow(gLay, "user ID:", "" + getPojoId(message)); addRow(gLay, "location:", u.getLocation()); addRow(gLay, "expertise:", u.getExpertise()); addRow(gLay, "affiliation:", u.getAffiliation()); addRow(gLay, "date registered:", formatter.format(u.getRegisterDate())); gLay.addComponent(new Hr(), 0, 5, 1, 5); Container cntr = new CardsByUserContainer<Card>(u); // expects ThreadLocal session to be setup numCards = cntr.size(); addRow(gLay, "cards played:", "" + numCards); cntr = new ActionPlansByUserContainer<Card>(u); // expects ThreadLocal session to be setup numAps = cntr.size(); addRow(gLay, "action plans:", "" + numAps); gLay.addComponent(new Hr(), 0, 8, 1, 8); addRow(gLay, "exploration points:", "" + u.getBasicScore()); addRow(gLay, "innovation points:", "" + u.getInnovationScore()); cardListener = new CardLis(u, mView); apListener = new AppLis(u, mView); layout.addComponent(makeButtons()); HSess.checkClose(key); }
From source file:org.activiti.editor.ui.EditorProcessDefinitionDetailPanel.java
License:Apache License
protected void initHeader() { GridLayout details = new GridLayout(2, 2); details.setWidth(100, UNITS_PERCENTAGE); details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); details.setSpacing(true);/*w ww .ja v a2 s . c o m*/ details.setMargin(false, false, true, false); details.setColumnExpandRatio(1, 1.0f); detailPanelLayout.addComponent(details); // Image Embedded image = new Embedded(null, Images.PROCESS_50); details.addComponent(image, 0, 0, 0, 1); // Name Label nameLabel = new Label(modelData.getName()); nameLabel.addStyleName(Reindeer.LABEL_H2); details.addComponent(nameLabel, 1, 0); // Properties HorizontalLayout propertiesLayout = new HorizontalLayout(); propertiesLayout.setSpacing(true); details.addComponent(propertiesLayout); // Version String versionString = i18nManager.getMessage(Messages.PROCESS_VERSION, modelData.getVersion()); Label versionLabel = new Label(versionString); versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_VERSION); propertiesLayout.addComponent(versionLabel); }
From source file:org.activiti.explorer.ui.flow.ProcessDefinitionDetailPanel.java
License:Apache License
protected void initHeader() { GridLayout taskDetails = new GridLayout(4, 2); taskDetails.setWidth(100, UNITS_PERCENTAGE); taskDetails.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); taskDetails.setSpacing(true);/*from www . j a v a 2 s . c om*/ taskDetails.setMargin(false, false, true, false); // Add image Embedded image = new Embedded(null, Images.FLOW_50); taskDetails.addComponent(image, 0, 0, 0, 1); // Add task name Label nameLabel = new Label(processDefinition.getName()); nameLabel.addStyleName(Reindeer.LABEL_H2); taskDetails.addComponent(nameLabel, 1, 0, 3, 0); // Add version String versionString = i18nManager.getMessage(Messages.FLOW_VERSION, processDefinition.getVersion()); Label versionLabel = new Label(versionString); versionLabel.addStyleName(ExplorerLayout.STYLE_FLOW_HEADER_VERSION); taskDetails.addComponent(versionLabel, 1, 1); // Add deploy time PrettyTimeLabel deployTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.FLOW_DEPLOY_TIME), deployment.getDeploymentTime(), null); deployTimeLabel.addStyleName(ExplorerLayout.STYLE_FLOW_HEADER_DEPLOY_TIME); taskDetails.addComponent(deployTimeLabel, 2, 1); taskDetails.setColumnExpandRatio(1, 1.0f); taskDetails.setColumnExpandRatio(2, 1.0f); taskDetails.setColumnExpandRatio(3, 1.0f); verticalLayout.addComponent(taskDetails); }
From source file:org.activiti.explorer.ui.flow.ProcessInstanceDetailPanel.java
License:Apache License
protected void addName() { GridLayout header = new GridLayout(3, 2); header.setWidth(100, UNITS_PERCENTAGE); header.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK); header.setSpacing(true);/* w w w .j a v a2 s .c o m*/ header.setMargin(false, false, true, false); // Add image Embedded image = new Embedded(null, Images.FLOW_50); header.addComponent(image, 0, 0, 0, 1); // Add task name Label nameLabel = new Label(processDefinition.getName() + " (" + processInstance.getId() + ")"); nameLabel.addStyleName(Reindeer.LABEL_H2); header.addComponent(nameLabel, 1, 0, 2, 0); // Add start time PrettyTimeLabel startTimeLabel = new PrettyTimeLabel(i18nManager.getMessage(Messages.FLOW_START_TIME), historicProcessInstance.getStartTime(), null); startTimeLabel.addStyleName(ExplorerLayout.STYLE_FLOW_HEADER_START_TIME); header.addComponent(startTimeLabel, 1, 1); header.setColumnExpandRatio(1, 1.0f); header.setColumnExpandRatio(2, 1.0f); verticalLayout.addComponent(header); }