Refine search
/** * Create the content for the login form with the supplied user name field, * password field and the login button. You cannot use any other text fields * or buttons for this purpose. To replace these components with your own * implementations, override {@link #createUsernameField()}, * {@link #createPasswordField()} and {@link #createLoginButton()}. If you * only want to change the default captions, override * {@link #getUsernameCaption()}, {@link #getPasswordCaption()} and * {@link #getLoginButtonCaption()}. You do not have to use the login button * in your layout. * * @param userNameField * the user name text field * @param passwordField * the password field * @param loginButton * the login button * @return content component * @since 7.7 */ protected Component createContent(TextField userNameField, PasswordField passwordField, Button loginButton) { VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.addComponent(userNameField); layout.addComponent(passwordField); layout.addComponent(loginButton); return layout; }
private Layout initContentPanel(NameEditForm form, MBeansContentTabSheet tabSheet) { VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setSpacing(false); layout.addComponent(form); layout.addComponent(tabSheet); layout.setExpandRatio(tabSheet, 1); return layout; }
@Override public Component initContent() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(table); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT); return layout; }
/** * Constructs an empty VerticalLayout. */ public VerticalLayout() { setWidth("100%"); setSpacing(true); setMargin(true); }
/** * Create a new legacy window. */ public LegacyWindow() { super(new VerticalLayout()); ((VerticalLayout) getContent()).setSpacing(false); }
addStyleName("dialog"); ueiBase = new TextField("UEI Base"); ueiBase.setNullSettingAllowed(false); ueiBase.setWidth("100%"); ueiBase.setRequired(true); ueiBase.setValue(defaultUei); ueiBase.setRequiredError("UEI Base cannot be null."); okButton = new Button("Continue"); okButton.addClickListener(this); cancelButton = new Button("Cancel"); cancelButton.addClickListener(this); HorizontalLayout toolbar = new HorizontalLayout(); toolbar.addComponent(okButton); toolbar.addComponent(cancelButton); VerticalLayout layout = new VerticalLayout(); layout.addComponent(ueiBase); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT); setContent(layout);
final TextField nameTextField = new TextField(item.getItemProperty("name")); nameTextField.setWidth(300, Unit.PIXELS); final TextField tf = new TextField(item.getItemProperty("targetSystemValue")); initTextFieldForWhitespaceVisibility(targetConfigurationValue.getTargetSystemValue(), tf); tf.setReadOnly(false); tf.setWidth(300, Unit.PIXELS); final HorizontalLayout hl = new HorizontalLayout(); hl.addComponent(tf); final Button minusTargetValueButton = new Button(); minusTargetValueButton.setIcon(VaadinIcons.MINUS); minusTargetValueButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY); minusTargetValueButton.setDescription("Add new source value."); minusTargetValueButton.addStyleName(ValoTheme.BUTTON_BORDERLESS); hl.addComponent(minusTargetValueButton); targetValueTableCellLayout.addComponent(hl);
private HorizontalLayout createTwinColumnLayout() { final HorizontalLayout twinColumnLayout = new HorizontalLayout(); twinColumnLayout.setSizeFull(); twinColumnLayout.setWidth("400px"); buildSourceTable(); buildSelectedTable(); final VerticalLayout selectButtonLayout = new VerticalLayout(); final Button selectButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SELECT_DIST_TYPE, "", "", "arrow-button", true, FontAwesome.FORWARD, SPUIButtonStyleNoBorder.class); selectButton.addClickListener(event -> addSMType()); final Button unSelectButton = SPUIComponentProvider.getButton("unselect-dist-type", "", "", "arrow-button", true, FontAwesome.BACKWARD, SPUIButtonStyleNoBorder.class); unSelectButton.addClickListener(event -> removeSMType()); selectButtonLayout.addComponent(selectButton); selectButtonLayout.addComponent(unSelectButton); selectButtonLayout.setComponentAlignment(selectButton, Alignment.MIDDLE_CENTER); selectButtonLayout.setComponentAlignment(unSelectButton, Alignment.MIDDLE_CENTER); twinColumnLayout.addComponent(sourceTable); twinColumnLayout.addComponent(selectButtonLayout); twinColumnLayout.addComponent(selectedTable); twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT); twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER); twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT); twinColumnLayout.setExpandRatio(sourceTable, 0.45F); twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07F); twinColumnLayout.setExpandRatio(selectedTable, 0.48F); sourceTable.setVisibleColumns(DIST_TYPE_NAME); return twinColumnLayout; }
protected void initLayout() { ThemeConstants theme = App.getInstance().getThemeConstants(); VerticalLayout root = new VerticalLayout(); root.setWidthUndefined(); root.setSpacing(true); root.setMargin(false); setContent(root); nameField = new TextField(messages.getMainMessage("PresentationsEditor.name")); nameField.setWidth(theme.get("cuba.web.PresentationEditor.name.width")); nameField.setValue(getPresentationCaption()); root.addComponent(nameField); root.addComponent(autoSaveField); root.addComponent(defaultField); globalField.setCaption(messages.getMainMessage("PresentationsEditor.global")); globalField.setValue(!isNew && presentation.getUser() == null); root.addComponent(globalField); HorizontalLayout buttons = new HorizontalLayout(); buttons.setMargin(false); buttons.setSpacing(true); buttons.setWidthUndefined(); root.addComponent(buttons); root.setComponentAlignment(buttons, Alignment.MIDDLE_LEFT);
private VerticalLayout buildStateDefinitionLayout() { I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource(); descriptionField = new TextField(); descriptionField.setNullRepresentation(""); descriptionField.setWidth("100%"); commentaryTextArea = new RichTextArea(); commentaryTextArea.setNullRepresentation(""); commentaryTextArea.setWidth("100%"); VerticalLayout stateLayout = new VerticalLayout(); stateLayout.setWidth("100%"); stateLayout.setSpacing(true); stateLayout.setMargin(true); stateLayout.addComponent(styled(new Label(messages.getMessage("field.description")), "h1")); stateLayout.addComponent(htmlLabel(messages.getMessage("field.description.info"))); stateLayout.addComponent(descriptionField); stateLayout.addComponent(styled(new Label(messages.getMessage("field.commentary")), "h1")); stateLayout.addComponent(htmlLabel(messages.getMessage("field.commentary.info"))); stateLayout.addComponent(commentaryTextArea); return stateLayout; }
public InfoDialog(String caption, String description) { setCaption(caption); setModal(true); setResizable(false); setClosable(false); setWidth(400, Unit.PIXELS); setHeight(200, Unit.PIXELS); okButton = UIHelper.createButton("ok", null, null, event -> InfoDialog.this.close()); okButton.setId("infoDialog.button.ok"); label.setValue(description); final HorizontalLayout buttonLayout = new HorizontalLayout(okButton); buttonLayout.setSpacing(true); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(label); layout.addComponent(buttonLayout); layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); setContent(layout); center(); }
layout.addComponent(tabs); VerticalLayout innerContainer = new VerticalLayout(); innerContainer.setWidth("100%"); innerContainer.setHeight(null); innerContainer.addComponent(history); VerticalLayout outerContainer = new VerticalLayout(); outerContainer.setWidth("99%"); outerContainer.setHeight("27px"); outerContainer.addComponent(innerContainer); historyContainer = outerContainer; layout.addComponent(historyContainer); resize.addClickListener(this::resizeButtonClick); resize.setData(false); resize.setWidth("100%"); resize.setHeight("10px"); resize.setPrimaryStyleName("resize-button"); layout.addComponent(resize); HorizontalLayout buttons = new HorizontalLayout(); buttons.addComponent(ok); buttons.addComponent(cancel); buttons.setWidth("100%"); buttons.setHeight("30px"); buttons.setComponentAlignment(ok, Alignment.MIDDLE_CENTER); buttons.setComponentAlignment(cancel, Alignment.MIDDLE_CENTER);
VerticalLayout vlMain = new VerticalLayout(); vlMain.setSizeFull(); HorizontalLayout hlFooter = new HorizontalLayout(); hlFooter.setHeight("50px"); // if you want you can define a height. hlFooter.addComponent(new Label("Test1")); // adding a simple component. You might want to set alignment for that component vlMain.addComponent(mainComponent); vlMain.setExpandRatio(mainComponent, 1.0f); // "give" the main component the maximum available space vlMain.addComponent(hlFooter);
protected void addInputField() { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth(100, UNITS_PERCENTAGE); addComponent(layout); textFieldPanel.setContent(new VerticalLayout()); textFieldPanel.setWidth(100, UNITS_PERCENTAGE); layout.addComponent(textFieldPanel); layout.setExpandRatio(textFieldPanel, 1.0f); commentInputField = new TextField(); commentInputField.setWidth(100, UNITS_PERCENTAGE); textFieldPanel.addComponent(commentInputField); addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT)); layout.addComponent(addCommentButton); layout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT); addCommentButton.addListener(new ClickListener() { public void buttonClick(ClickEvent event) { addNewComment(commentInputField.getValue().toString());
public OneFieldWindow(RulesPlugin rulesPlugin, FieldMetadata fieldMetadata, MaduraSessionManager maduraSessionManager, final String submitStyle) { main = new VerticalLayout(); setContent(main); setModal(true); main.setMargin(true); main.setSpacing(true); main.setWidth("320px"); MaduraPropertyWrapper maduraPropertyWrapper = maduraSessionManager.getMaduraPropertyWrapper(fieldMetadata); FieldFactory fieldFactory = maduraSessionManager.getFieldFactory(); Field<?> field = fieldFactory.createFieldByPropertyType(maduraPropertyWrapper); field.setReadOnly(true); main.addComponent(field); HorizontalLayout buttons = new HorizontalLayout(); main.addComponent(buttons); Button buttonOK = fieldFactory.createButton("OK", new Button.ClickListener(){ private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { close(); }}); if (submitStyle != null) { buttonOK.setClickShortcut(KeyCode.ENTER ); buttonOK.addStyleName(submitStyle); } buttons.addComponent(buttonOK); buttons.setComponentAlignment(buttonOK, Alignment.BOTTOM_RIGHT); }
@SuppressWarnings("serial") private Component getInitialLayout() { VerticalLayout ret = new VerticalLayout(); // Buttons Button close = new Button(m_messageSourceAccessor.getMessage("close", "Close")); HorizontalLayout actions = new HorizontalLayout(); actions.setMargin(true); actions.setSpacing(true); actions.addComponent(close); close.addClickListener(new ClickListener(){ @Override public void buttonClick(ClickEvent event) { close(); }}); ret.addComponent(actions); return ret; }
public AbstractAddWindow(final Window main, String caption) { m_main = main; setModal(true); setWidth("15em"); setCaption(caption); // Configure the windws layout; by default a VerticalLayout VerticalLayout layout = (VerticalLayout) getContent(); layout.setMargin(true); layout.setSpacing(true); m_name = new TextField("name"); final TextField description = new TextField("description"); layout.addComponent(m_name); layout.addComponent(description); Button close = new Button("Ok", new Button.ClickListener() { // inline click-listener public void buttonClick(ClickEvent event) { // close the window by removing it from the parent window (getParent()).removeWindow(AbstractAddWindow.this); // create the feature create((String) m_name.getValue(), (String) description.getValue()); } }); // The components added to the window are actually added to the window's // layout; you can use either. Alignments are set using the layout layout.addComponent(close); layout.setComponentAlignment(close, Alignment.BOTTOM_RIGHT); }
@Override public void doBuild(ViewChangeBusMessage event) { super.doBuild(event); centrePanel = new Panel(); centrePanel.addStyleName(ChameleonTheme.PANEL_BUBBLE); centrePanel.setSizeUndefined(); VerticalLayout vl = new VerticalLayout(); centrePanel.setContent(vl); vl.setSpacing(true); vl.setSizeUndefined(); label = new Label(); usernameBox = new TextField(); passwordBox = new PasswordField(); Label demoInfoLabel = new Label("for this demo, enter any user name, and a password of 'password'"); Label demoInfoLabel2 = new Label("In a real application your Shiro Realm implementation defines how to authenticate"); submitButton = new Button(); submitButton.addClickListener(this); statusMsgLabel = new Label("Please enter your username and password"); vl.addComponent(label); vl.addComponent(demoInfoLabel); vl.addComponent(demoInfoLabel2); vl.addComponent(usernameBox); vl.addComponent(passwordBox); vl.addComponent(submitButton); vl.addComponent(statusMsgLabel); setMiddleCentre(centrePanel); }
private void setContent() { VerticalLayout panel = new VerticalLayout(); setContent(panel); panel.setMargin(true); panel.setSpacing(true); setWidth("100%"); Label status = new NodeLabel(m_handler); Button startButton = new ActionButton(m_handler, Action.Start); Button stopButton = new ActionButton(m_handler, Action.Stop); HorizontalLayout buttonPanel = new HorizontalLayout(); buttonPanel.addComponent(startButton); buttonPanel.addComponent(stopButton); buttonPanel.setSpacing(true); Table propertiesTable = new PropertiesTable(m_handler); propertiesTable.setWidth("100%"); panel.addComponent(status); panel.addComponent(buttonPanel); panel.addComponent(propertiesTable); m_factory.submit(m_statusGetter); }
@Override protected void initContent(VerticalLayout layout) throws Exception { label = new Label(message); label.setContentMode(ContentMode.HTML); layout.addComponent(label); textField = new TextField(); textField.setValue(txtInput); textField.setWidth("100%"); textField.focus(); textField.addShortcutListener(new ShortcutListener("Confirm", ShortcutAction.KeyCode.ENTER, null) { private static final long serialVersionUID = 1L; @Override public void handleAction(Object sender, Object target) { confirm.doAction(TextInputDialog.this); } }); layout.addComponent(textField); txtInput = null; }