com.vaadin.ui.Alignment Java Examples

The following examples show how to use com.vaadin.ui.Alignment. 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: MultipleTargetFilter.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
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 #2
Source File: AbstractView.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the top header actions for user context.
 */
private void createTopHeaderActionsForUserContext() {
	if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN) || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) {
		final Link userHomePageLink = pageLinkFactory.createUserHomeViewPageLink();
		topHeaderRightPanel.addComponent(userHomePageLink);
		topHeaderRightPanel.setComponentAlignment(userHomePageLink, Alignment.MIDDLE_RIGHT);

		final Button logoutButton = new Button(LOGOUT,VaadinIcons.SIGN_OUT);

		final LogoutRequest logoutRequest = new LogoutRequest();
		logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
		logoutButton.addClickListener(new LogoutClickListener(logoutRequest));

		topHeaderRightPanel.addComponent(logoutButton);
		topHeaderRightPanel.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT);

	} else {
		final Link createRegisterPageLink = pageLinkFactory.createRegisterPageLink();
		topHeaderRightPanel.addComponent(createRegisterPageLink);
		topHeaderRightPanel.setComponentAlignment(createRegisterPageLink, Alignment.MIDDLE_RIGHT);

		final Link createLoginPageLink = pageLinkFactory.createLoginPageLink();
		topHeaderRightPanel.addComponent(createLoginPageLink);
		topHeaderRightPanel.setComponentAlignment(createLoginPageLink, Alignment.MIDDLE_RIGHT);
	}
}
 
Example #3
Source File: MassUpdateWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
protected ComponentContainer buildButtonControls() {
    MHorizontalLayout controlsLayout = new MHorizontalLayout().withMargin(true).withFullWidth();

    updateBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_UPDATE_LABEL), clickEvent -> {
        updateForm.commit();
        massUpdateCommand.massUpdate(beanItem);
        close();
    }).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.CLIPBOARD);

    closeBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLOSE), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    Label spacing = new Label();
    controlsLayout.with(spacing, closeBtn, updateBtn).alignAll(Alignment.MIDDLE_RIGHT).expand(spacing);
    return controlsLayout;
}
 
Example #4
Source File: VersionAddWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
VersionAddWindow() {
    super(UserUIContext.getMessage(VersionI18nEnum.NEW));
    AdvancedEditBeanForm<Version> editForm = new AdvancedEditBeanForm<>();
    editForm.addFormHandler(this);
    editForm.setFormLayoutFactory(new DefaultDynaFormLayout(ProjectTypeConstants.VERSION,
            VersionDefaultFormLayoutFactory.getAddForm(), "id"));
    editForm.setBeanFormFieldFactory(new VersionEditFormFieldFactory(editForm));
    Version version = new Version();
    version.setProjectid(CurrentProjectVariables.getProjectId());
    version.setSaccountid(AppUI.getAccountId());
    version.setStatus(StatusI18nEnum.Open.name());
    editForm.setBean(version);
    ComponentContainer buttonControls = generateEditFormControls(editForm,
            CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.VERSIONS),
            false, true);
    withWidth("750px").withModal(true).withResizable(false).withContent(new MVerticalLayout(editForm,
            buttonControls).withAlign(buttonControls, Alignment.TOP_RIGHT)).withCenter();
}
 
Example #5
Source File: SelectChildTicketWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public Component generateRow(IBeanList<ProjectTicket> host, ProjectTicket item, int rowIndex) {
    MButton ticketLink = new MButton(item.getName(), clickEvent -> {
        if (item.getTypeId().equals(parentTicket.getTypeId())) {
            NotificationUtil.showErrorNotification(UserUIContext.getMessage(TaskI18nEnum.ERROR_CAN_NOT_ASSIGN_PARENT_TASK_TO_ITSELF));
        } else {
            TicketHierarchy ticketHierarchy = new TicketHierarchy();
            ticketHierarchy.setParentid(parentTicket.getTypeId());
            ticketHierarchy.setParenttype(parentTicket.getType());
            ticketHierarchy.setProjectid(CurrentProjectVariables.getProjectId());
            ticketHierarchy.setTicketid(item.getTypeId());
            ticketHierarchy.setTickettype(item.getType());
            TicketHierarchyMapper ticketHierarchyMapper = AppContextUtil.getSpringBean(TicketHierarchyMapper.class);
            ticketHierarchyMapper.insert(ticketHierarchy);
            EventBusFactory.getInstance().post(new TicketEvent.SubTicketAdded(this, item.getType(), item.getTypeId()));
        }

        close();
    }).withStyleName(WebThemes.BUTTON_LINK, WebThemes.TEXT_ELLIPSIS).withFullWidth();
    return new MHorizontalLayout(ELabel.fontIcon(ProjectAssetsManager.getAsset(item.getType())), ticketLink).expand(ticketLink).withStyleName("list-row").withFullWidth()
            .alignAll(Alignment.MIDDLE_LEFT);
}
 
Example #6
Source File: FormUtils.java    From jdal with Apache License 2.0 6 votes vote down vote up
/**
   * Create a titled separator
   * @param title title
   * @return a {@link HorizontalLayout} with title and rule.
   */
  public static Component createTitledSeparator(String title) {
  	Label titleLabel = new Label(title);
  	titleLabel.setStyleName(Reindeer.LABEL_H2);
Label rule = new Label("<hr />", ContentMode.HTML);
titleLabel.setSizeUndefined();
HorizontalLayout hl = new HorizontalLayout();
hl.addComponent(titleLabel);
Box.addHorizontalStruct(hl, 20);
hl.addComponent(rule);
hl.setComponentAlignment(rule, Alignment.BOTTOM_CENTER);
hl.setExpandRatio(rule, 1);
hl.setWidth(100, Unit.PERCENTAGE);

return hl;
  }
 
Example #7
Source File: GroupPageAddWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    final MVerticalLayout layout = new MVerticalLayout().withMargin(false);
    informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
    layout.addComponent(informationLayout.getLayout());

    final MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
        if (EditForm.this.validateForm()) {
            PageService pageService = AppContextUtil.getSpringBean(PageService.class);
            pageService.createFolder(folder, UserUIContext.getUsername());
            folder.setCreatedTime(new GregorianCalendar());
            folder.setCreatedUser(UserUIContext.getUsername());
            GroupPageAddWindow.this.close();
            EventBusFactory.getInstance().post(new PageEvent.GotoList(GroupPageAddWindow.this, folder.getPath()));
        }
    }).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(KeyCode.ENTER);

    MHorizontalLayout controlsBtn = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(new MarginInfo(true, false, true, false));
    layout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
    return layout;
}
 
Example #8
Source File: MainView.java    From usergrid with Apache License 2.0 6 votes vote down vote up
MainView( ) {
    this.setHeight( "100%" );

    VerticalLayout verticalLayoutForButtons = new VerticalLayout();
    verticalLayoutForButtons.setSizeFull();

    buttons = addButtons();
    this.addComponent( buttons );
    setComponentAlignment( buttons , Alignment.TOP_CENTER );

    tabSheet = addTabSheet();
    tabSheet.setSizeFull();
    this.addComponent( tabSheet );
    this.setComponentAlignment( tabSheet, Alignment.TOP_CENTER );

    this.setExpandRatio( buttons, 0.04f );
    this.setExpandRatio( tabSheet, 0.96f );
}
 
Example #9
Source File: QuestionnaireView.java    From gazpachoquest with GNU General Public License v3.0 6 votes vote down vote up
private HorizontalLayout createHeader() {
    final HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    final Label title = new Label("Activiti + Vaadin - A Match Made in Heaven");
    title.addStyleName(Reindeer.LABEL_H1);
    layout.addComponent(title);
    layout.setExpandRatio(title, 1.0f);

    Label currentUser = new Label();
    currentUser.setSizeUndefined();
    layout.addComponent(currentUser);
    layout.setComponentAlignment(currentUser, Alignment.MIDDLE_RIGHT);

    Button logout = new Button("Logout");
    logout.addStyleName(Reindeer.BUTTON_SMALL);
    // logout.addListener(createLogoutButtonListener());
    layout.addComponent(logout);
    layout.setComponentAlignment(logout, Alignment.MIDDLE_RIGHT);

    return layout;
}
 
Example #10
Source File: GetStartedInstructionWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void displayInfo(SimpleUser user) {
    Div infoDiv = new Div().appendText("You have not setup SMTP account properly. So we can not send the invitation by email automatically. Please copy/paste below paragraph and inform to the user by yourself").setStyle("font-weight:bold;color:red");
    Label infoLbl = new Label(infoDiv.write(), ContentMode.HTML);

    Div userInfoDiv = new Div().appendText("Your username is ").appendChild(new B().appendText(user.getEmail()));
    Label userInfoLbl = ELabel.html(userInfoDiv.write());

    if (Boolean.TRUE.equals(user.isAccountOwner())) {
        user.setRoleName(UserUIContext.getMessage(RoleI18nEnum.OPT_ACCOUNT_OWNER));
    }
    Div roleInfoDiv = new Div().appendText("Your role is ").appendChild(new B().appendText(user.getRoleName()));
    Label roleInfoLbl = new Label(roleInfoDiv.write(), ContentMode.HTML);
    contentLayout.with(infoLbl, userInfoLbl, roleInfoLbl);

    final Button addNewBtn = new Button("Create another user", clickEvent -> {
        EventBusFactory.getInstance().post(new UserEvent.GotoAdd(GetStartedInstructionWindow.this, null));
        close();
    });
    addNewBtn.setStyleName(WebThemes.BUTTON_ACTION);

    Button doneBtn = new Button(UserUIContext.getMessage(GenericI18Enum.ACTION_DONE), clickEvent -> close());
    doneBtn.setStyleName(WebThemes.BUTTON_ACTION);

    final MHorizontalLayout controlsBtn = new MHorizontalLayout(addNewBtn, doneBtn).withMargin(true);
    contentLayout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
}
 
Example #11
Source File: CommonDialogWindow.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void createCancelButton() {
    cancelButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_BUTTON,
            i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), "", "", true, FontAwesome.TIMES,
            SPUIButtonStyleNoBorderWithIcon.class);
    cancelButton.setSizeUndefined();
    cancelButton.addStyleName("default-color");
    addCloseListenerForCancelButton();
    if (cancelButtonClickListener != null) {
        cancelButton.addClickListener(cancelButtonClickListener);
    }

    buttonsLayout.addComponent(cancelButton);
    buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_LEFT);
    buttonsLayout.setExpandRatio(cancelButton, 1.0F);
}
 
Example #12
Source File: ElementCollectionField.java    From viritin with Apache License 2.0 5 votes vote down vote up
@Override
public void addInternalElement(final ET v) {
    ensureInited();
    items.add(v);
    MBeanFieldGroup<ET> fg = getFieldGroupFor(v);
    for (Object property : getVisibleProperties()) {
        Component c = fg.getField(property);
        if (c == null) {
            c = getComponentFor(v, property.toString());
            Logger.getLogger(ElementCollectionField.class.getName())
                    .log(Level.WARNING, "No editor field for{0}", property);
        }
        layout.addComponent(c);
        layout.setComponentAlignment(c, Alignment.MIDDLE_LEFT);
    }
    if (getPopupEditor() != null) {
        MButton b = new MButton(VaadinIcons.PENCIL)
                .withStyleName(ValoTheme.BUTTON_ICON_ONLY)
                .withListener(new Button.ClickListener() {
            private static final long serialVersionUID = 5019806363620874205L;
            @Override
            public void buttonClick(Button.ClickEvent event) {
                editInPopup(v);
            }
        });
        layout.add(b);
    }
    if (isAllowRemovingItems()) {
        layout.add(createRemoveButton(v));
    }
    if (!isAllowEditItems()) {
        fg.setReadOnly(true);
    }
}
 
Example #13
Source File: SelectPDPGroupWindow.java    From XACML with MIT License 5 votes vote down vote up
@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");
	
	// listSelectPDPGroup
	listSelectPDPGroup = new ListSelect();
	listSelectPDPGroup.setImmediate(false);
	listSelectPDPGroup.setWidth("-1px");
	listSelectPDPGroup.setHeight("-1px");
	listSelectPDPGroup.setInvalidAllowed(false);
	listSelectPDPGroup.setRequired(true);
	mainLayout.addComponent(listSelectPDPGroup);
	mainLayout.setExpandRatio(listSelectPDPGroup, 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 #14
Source File: AbstractFilterLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS);
    setStyleName("filter-btns-main-layout");
    setHeight(100.0F, Unit.PERCENTAGE);
    setSpacing(false);
    setMargin(false);

    addComponents(filterHeader, filterButtons);

    setComponentAlignment(filterHeader, Alignment.TOP_CENTER);
    setComponentAlignment(filterButtons, Alignment.TOP_CENTER);

    setExpandRatio(filterButtons, 1.0F);
}
 
Example #15
Source File: ConfirmDialog.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: RunnersLayout.java    From usergrid with Apache License 2.0 5 votes vote down vote up
private void addRefreshButton()  {

        Button button = new Button( "Refresh" );
        button.setWidth( "100px" );

        button.addClickListener( new Button.ClickListener() {
            public void buttonClick( Button.ClickEvent event ) {
                loadData();
            }
        });

        addComponent( button );
        this.setComponentAlignment( button, Alignment.BOTTOM_CENTER );
    }
 
Example #17
Source File: ExpressionSelectionWindow.java    From XACML with MIT License 5 votes vote down vote up
@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");
	
	// optionGroupExpression
	optionGroupExpression = new OptionGroup();
	optionGroupExpression
			.setCaption("Select One Of The Following Types of Expressions");
	optionGroupExpression.setImmediate(false);
	optionGroupExpression.setWidth("-1px");
	optionGroupExpression.setHeight("-1px");
	mainLayout.addComponent(optionGroupExpression);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Select");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(24));
	
	return mainLayout;
}
 
Example #18
Source File: ProjectMemberInvitePresenter.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void displayInfo(InviteMembers invitation) {
    Div infoDiv = new Div().appendText(UserUIContext.getMessage(ProjectMemberI18nEnum.OPT_NO_SMTP_SEND_MEMBERS))
            .setStyle("font-weight:bold;color:red");
    contentLayout.with(ELabel.html(infoDiv.write()));

    Div introDiv = new Div().appendText("Below users are invited to the project ")
            .appendChild(new B().appendText(CurrentProjectVariables.getProject().getName()))
            .appendText(" as role ").appendChild(new B().appendText(invitation.getRoleName()));
    contentLayout.with(ELabel.html(introDiv.write()));

    MVerticalLayout linksContainer = new MVerticalLayout().withStyleName(WebThemes.SCROLLABLE_CONTAINER);
    contentLayout.with(linksContainer);

    Collection<String> inviteEmails = invitation.getEmails();
    for (String inviteEmail : inviteEmails) {
        Div userEmailDiv = new Div().appendText(String.format("&nbsp;&nbsp;&nbsp;&nbsp;%s %s: ", VaadinIcons.PAPERPLANE.getHtml(),
                UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL))).appendChild(new A().setHref("mailto:" + inviteEmail)
                .appendText(inviteEmail));
        linksContainer.with(ELabel.html(userEmailDiv.write()), ELabel.hr());
    }

    MButton addNewBtn = new MButton(UserUIContext.getMessage(ProjectMemberI18nEnum.ACTION_INVITE_MORE_MEMBERS), clickEvent -> {
        EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoInviteMembers(CanSendEmailInstructionWindow.this, null));
        close();
    }).withStyleName(WebThemes.BUTTON_ACTION);

    MButton doneBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_DONE), clickEvent -> {
        EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoList(this, CurrentProjectVariables.getProjectId()));
        close();
    }).withStyleName(WebThemes.BUTTON_ACTION);

    MHorizontalLayout controlsBtn = new MHorizontalLayout(addNewBtn, doneBtn).withMargin(true);
    contentLayout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
}
 
Example #19
Source File: InvoicesView.java    From jpa-invoicer with The Unlicense 5 votes vote down vote up
@PostConstruct
public void initComponent() {
    table.setColumnCollapsingAllowed(true);
    table.setColumnWidth("invoiceDate", 105);
    table.setColumnWidth("lastEdited", 105);
    table.setColumnWidth("lastEditor", 110);
    if (session.getUser().getAdministrates().isEmpty()) {
        Notification.show("Add invoicer first!");
        ViewMenuUI.getMenu().navigateTo(MyAccount.class);
        return;
    }
    sender.addMValueChangeListener(e -> listEntities());

    form.setResetHandler(this::reset);
    form.setSavedHandler(this::save);

    table.addMValueChangeListener(e -> {
        if (e.getValue() != null) {
            form.setEntity(e.getValue());
            form.openInModalPopup();
        }
    });

    listEntities();

    Button addButton = new Button("Add", e -> {
        final Invoice invoice = facade.createFor(sender.getValue());
        form.setEntity(invoice);
        form.openInModalPopup();
    });

    add(
            new MHorizontalLayout(addButton, sender).space().add(backup)
            .alignAll(Alignment.MIDDLE_LEFT)
    );
    expand(table);
}
 
Example #20
Source File: XacmlErrorHandler.java    From XACML with MIT License 5 votes vote down vote up
@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("100.0%");
	setHeight("-1px");
	
	// labelError
	labelError = new Label();
	labelError.setImmediate(false);
	labelError.setWidth("100.0%");
	labelError.setHeight("80px");
	labelError.setValue("This holds error messages.");
	mainLayout.addComponent(labelError);
	
	// buttonGo
	buttonGo = new Button();
	buttonGo.setCaption("Ok");
	buttonGo.setImmediate(true);
	buttonGo.setWidth("-1px");
	buttonGo.setHeight("-1px");
	mainLayout.addComponent(buttonGo);
	mainLayout.setComponentAlignment(buttonGo, new Alignment(48));
	
	return mainLayout;
}
 
Example #21
Source File: DefaultGridHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Builds the layout for the header component.
 */
protected void buildComponent() {
    addComponent(titleLayout);
    setComponentAlignment(titleLayout, Alignment.TOP_LEFT);
    setWidth(100, Unit.PERCENTAGE);
    setImmediate(true);
    addStyleName("action-history-header");
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");
}
 
Example #22
Source File: AbstractGridComponentLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Layouts header, grid and optional footer.
 */
protected void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout gridHeaderLayout = new VerticalLayout();
    gridHeaderLayout.setSizeFull();
    gridHeaderLayout.setSpacing(false);
    gridHeaderLayout.setMargin(false);

    gridHeaderLayout.setStyleName("table-layout");
    gridHeaderLayout.addComponent(gridHeader);

    gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
    gridHeaderLayout.addComponent(grid);
    gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
    gridHeaderLayout.setExpandRatio(grid, 1.0F);

    addComponent(gridHeaderLayout);
    setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(gridHeaderLayout, 1.0F);
    if (hasFooterSupport()) {
        final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
        addComponent(footerLayout);
        setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
    }

}
 
Example #23
Source File: AttributeDictionarySelectorComponent.java    From XACML with MIT License 5 votes vote down vote up
@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(false);
	horizontalLayout_2.setSpacing(true);
	
	// comboBoxCategoryFilter
	comboBoxCategoryFilter = new ComboBox();
	comboBoxCategoryFilter.setCaption("Filter Category");
	comboBoxCategoryFilter.setImmediate(false);
	comboBoxCategoryFilter.setWidth("-1px");
	comboBoxCategoryFilter.setHeight("-1px");
	horizontalLayout_2.addComponent(comboBoxCategoryFilter);
	horizontalLayout_2.setExpandRatio(comboBoxCategoryFilter, 1.0f);
	
	// buttonNewAttribute
	buttonNewAttribute = new Button();
	buttonNewAttribute.setCaption("New Attribute");
	buttonNewAttribute.setImmediate(true);
	buttonNewAttribute
			.setDescription("Click to create a new attribute in the dictionary.");
	buttonNewAttribute.setWidth("-1px");
	buttonNewAttribute.setHeight("-1px");
	horizontalLayout_2.addComponent(buttonNewAttribute);
	horizontalLayout_2.setComponentAlignment(buttonNewAttribute,
			new Alignment(10));
	
	return horizontalLayout_2;
}
 
Example #24
Source File: RangeEditorComponent.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("100.0%");
	verticalLayout_2.setHeight("100.0%");
	verticalLayout_2.setMargin(false);
	verticalLayout_2.setSpacing(true);
	
	// textFieldTestInput
	textFieldTestInput = new TextField();
	textFieldTestInput.setCaption("Value");
	textFieldTestInput.setImmediate(true);
	textFieldTestInput.setDescription("Enter a value to test against.");
	textFieldTestInput.setWidth("-1px");
	textFieldTestInput.setHeight("-1px");
	textFieldTestInput.setInputPrompt("eg. 50");
	verticalLayout_2.addComponent(textFieldTestInput);
	
	// buttonValidate
	buttonValidate = new Button();
	buttonValidate.setCaption("Test");
	buttonValidate.setImmediate(true);
	buttonValidate
			.setDescription("Click to test if value is within the range.");
	buttonValidate.setWidth("-1px");
	buttonValidate.setHeight("-1px");
	verticalLayout_2.addComponent(buttonValidate);
	verticalLayout_2.setComponentAlignment(buttonValidate,
			new Alignment(48));
	
	return verticalLayout_2;
}
 
Example #25
Source File: ToolEditorUI.java    From chipster with MIT License 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
	treeToolEditor = new TreeToolEditor(this);
	toolEditor = new ToolEditor(this);
	textEditor = new TextEditor(this);
	final Panel vLayout = new Panel();
	vSplitPanel = new VerticalSplitPanel();
	vSplitPanel.setSplitPosition(50, Unit.PERCENTAGE);
	vSplitPanel.setImmediate(true);
	vSplitPanel.setLocked(false);
	vSplitPanel.setWidth("100%");
	vLayout.setContent(vSplitPanel);
    setContent(vSplitPanel);
    VerticalLayout vvLayout = new VerticalLayout();
    vvLayout.setSizeFull();
    Label title = new Label("<h2><b>&nbsp;Tool Editor</b></h2>", ContentMode.HTML);

    vvLayout.addComponent(title);
    vvLayout.setComponentAlignment(title, Alignment.TOP_LEFT);
    HorizontalSplitPanel hSplitpPanel = new HorizontalSplitPanel();
    hSplitpPanel.setSizeFull();
    vvLayout.addComponent(hSplitpPanel);

    HorizontalLayout buttonPanel = getButtonPanel();
    vvLayout.addComponent(buttonPanel);
    vvLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_CENTER);

    vvLayout.setExpandRatio(hSplitpPanel, 5);
    vvLayout.setComponentAlignment(hSplitpPanel, Alignment.TOP_LEFT);
    vvLayout.setMargin(false);
    vvLayout.setSpacing(false);
    hSplitpPanel.setFirstComponent(treeToolEditor);
    hSplitpPanel.setSecondComponent(toolEditor);
    vSplitPanel.setFirstComponent(vvLayout);
    vSplitPanel.setSecondComponent(textEditor);
    hSplitpPanel.setStyleName("topborder");
}
 
Example #26
Source File: DistributionSetTypeSoftwareModuleSelectLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #27
Source File: DeploymentView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void maximizeActionHistory() {
    removeComponent(countMessageLabel);
    mainLayout.removeAllComponents();
    mainLayout.setColumns(3);
    mainLayout.setRows(1);
    mainLayout.addComponent(actionHistoryLayout, 0, 0);
    mainLayout.addComponent(actionStatusLayout, 1, 0);
    mainLayout.addComponent(actionStatusMsgLayout, 2, 0);
    mainLayout.setColumnExpandRatio(0, 0.55F);
    mainLayout.setColumnExpandRatio(1, 0.18F);
    mainLayout.setColumnExpandRatio(2, 0.27F);
    mainLayout.setComponentAlignment(actionHistoryLayout, Alignment.TOP_LEFT);
}
 
Example #28
Source File: SelectPIPConfigurationWindow.java    From XACML with MIT License 5 votes vote down vote up
@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");
	
	// table
	table = new Table();
	table.setCaption("PIP Configurations");
	table.setImmediate(false);
	table.setWidth("-1px");
	table.setHeight("-1px");
	mainLayout.addComponent(table);
	
	// 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 #29
Source File: ProjectMemberBlock.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
public ProjectMemberBlock(String username, String userAvatarId, String displayName) {
    withMargin(false).withWidth("80px");
    Image userAvatar = UserAvatarControlFactory.createUserAvatarEmbeddedComponent(userAvatarId, 48, displayName);
    userAvatar.addStyleName(WebThemes.CIRCLE_BOX);
    A userLink = new A().setId("tag" + TooltipHelper.TOOLTIP_ID).
            setHref(ProjectLinkGenerator.generateProjectMemberLink(CurrentProjectVariables.getProjectId(),
                    username)).appendText(StringUtils.trim(displayName, 30, true)).setTitle(displayName);
    userLink.setAttribute("onmouseover", TooltipHelper.userHoverJsFunction(username));
    userLink.setAttribute("onmouseleave", TooltipHelper.itemMouseLeaveJsFunction());
    ELabel userLbl = ELabel.html(userLink.write()).withStyleName(ValoTheme.LABEL_SMALL).withFullWidth();
    with(userAvatar, userLbl).withAlign(userAvatar, Alignment.TOP_CENTER);
}
 
Example #30
Source File: SensorAdminPanel.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
protected Panel newPanel(String title)
{
    Panel panel = new Panel(title);
    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
    panel.setContent(layout);
    return panel;
}