Java Code Examples for com.vaadin.ui.HorizontalLayout#setMargin()

The following examples show how to use com.vaadin.ui.HorizontalLayout#setMargin() . 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: 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 2
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildLayout() {
    final HorizontalLayout header = new HorizontalLayout();
    header.addStyleName("artifact-details-header");
    header.addStyleName("bordered-layout");
    header.addStyleName("no-border-bottom");
    header.setSpacing(false);
    header.setMargin(false);
    header.setSizeFull();
    header.setHeightUndefined();
    header.setImmediate(true);
    header.addComponents(headerCaptionLayout, maxMinButton);
    header.setComponentAlignment(headerCaptionLayout, Alignment.TOP_LEFT);
    header.setComponentAlignment(maxMinButton, Alignment.TOP_RIGHT);
    header.setExpandRatio(headerCaptionLayout, 1.0F);

    setSizeFull();
    setImmediate(true);
    addStyleName("artifact-table");
    addStyleName("table-layout");
    addComponent(header);
    setComponentAlignment(header, Alignment.MIDDLE_CENTER);
    addComponent(artifactDetailsTable);
    setComponentAlignment(artifactDetailsTable, Alignment.MIDDLE_CENTER);
    setExpandRatio(artifactDetailsTable, 1.0F);
}
 
Example 3
Source File: AttributeSelectionWindow.java    From XACML with MIT License 6 votes vote down vote up
@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);
	
	// optionGroupAttribute
	optionGroupAttribute = new OptionGroup();
	optionGroupAttribute.setCaption("Attribute Source");
	optionGroupAttribute.setImmediate(false);
	optionGroupAttribute.setWidth("-1px");
	optionGroupAttribute.setHeight("-1px");
	optionGroupAttribute.setInvalidAllowed(false);
	horizontalLayout_1.addComponent(optionGroupAttribute);
	
	// verticalLayout_2
	verticalLayout_2 = buildVerticalLayout_2();
	horizontalLayout_1.addComponent(verticalLayout_2);
	
	return horizontalLayout_1;
}
 
Example 4
Source File: DefaultGridHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Builds the title layout.
 *
 * @return title-layout
 */
protected HorizontalLayout buildTitleLayout() {
    titleLayout = new HorizontalLayout();
    titleLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    titleLayout.setSpacing(false);
    titleLayout.setMargin(false);
    titleLayout.setSizeFull();
    titleLayout.addComponent(prefixWithTitle);
    titleLayout.setComponentAlignment(prefixWithTitle, Alignment.TOP_LEFT);
    titleLayout.setExpandRatio(prefixWithTitle, 0.8F);

    if (hasHeaderMaximizeSupport()) {
        titleLayout.addComponents(getHeaderMaximizeSupport().maxMinButton);
        titleLayout.setComponentAlignment(getHeaderMaximizeSupport().maxMinButton, Alignment.TOP_RIGHT);
        titleLayout.setExpandRatio(getHeaderMaximizeSupport().maxMinButton, 0.2F);
    }

    return titleLayout;
}
 
Example 5
Source File: RangeEditorComponent.java    From XACML with MIT License 5 votes vote down vote up
@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);
	
	// comboBoxMin
	comboBoxMin = new ComboBox();
	comboBoxMin.setCaption("Minimum Type");
	comboBoxMin.setImmediate(true);
	comboBoxMin.setDescription("Select the type for the minimum.");
	comboBoxMin.setWidth("-1px");
	comboBoxMin.setHeight("-1px");
	horizontalLayout_1.addComponent(comboBoxMin);
	
	// textFieldMin
	textFieldMin = new TextField();
	textFieldMin.setCaption("Minimum Value");
	textFieldMin.setImmediate(true);
	textFieldMin.setDescription("Enter a value for the minimum.");
	textFieldMin.setWidth("-1px");
	textFieldMin.setHeight("-1px");
	textFieldMin.setInvalidAllowed(false);
	textFieldMin.setInputPrompt("eg. 1");
	horizontalLayout_1.addComponent(textFieldMin);
	horizontalLayout_1
			.setComponentAlignment(textFieldMin, new Alignment(9));
	
	return horizontalLayout_1;
}
 
Example 6
Source File: ServiceDescDetail.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    addStyleName(Reindeer.PANEL_LIGHT);
    setHeight("100%");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addStyleName("service-desc-detail");
    setContent(layout);

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setMargin(false);
    leftLayout.setSpacing(false);
    leftLayout.setWidth("250px");
    leftLayout.setHeight("100%");

    left = new DetailInfoOpe();
    left.setWidth("250px");
    leftLayout.addComponent(left);
    leftLayout.setExpandRatio(left, 1.0f);
    layout.addComponent(leftLayout);

    right = new DetailParameters();
    right.setWidth("100%");
    right.setHeight("100%");
    layout.addComponent(right);

    layout.setExpandRatio(right, 100);
}
 
Example 7
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 8
Source File: PDPManagement.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(true);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonCreate
	buttonCreate = new Button();
	buttonCreate.setCaption("Create Group");
	buttonCreate.setImmediate(false);
	buttonCreate.setWidth("-1px");
	buttonCreate.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonCreate);
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove Group");
	buttonRemove.setImmediate(false);
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	
	return horizontalLayoutToolbar;
}
 
Example 9
Source File: AttributeSimpleCreatorComponent.java    From XACML with MIT License 5 votes vote down vote up
@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);
	
	// tableCategory
	tableCategory = new Table();
	tableCategory.setCaption("Choose Category");
	tableCategory.setImmediate(false);
	tableCategory.setWidth("-1px");
	tableCategory.setHeight("-1px");
	tableCategory.setInvalidAllowed(false);
	tableCategory.setRequired(true);
	horizontalLayout_1.addComponent(tableCategory);
	
	// tableDatatype
	tableDatatype = new Table();
	tableDatatype.setCaption("Choose Data Type");
	tableDatatype.setImmediate(false);
	tableDatatype.setWidth("-1px");
	tableDatatype.setHeight("-1px");
	tableDatatype.setInvalidAllowed(false);
	tableDatatype.setRequired(true);
	horizontalLayout_1.addComponent(tableDatatype);
	
	return horizontalLayout_1;
}
 
Example 10
Source File: SPUIComponentProvider.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Method to CreateName value labels.
 *
 * @param label
 *            as string
 * @param values
 *            as string
 * @return HorizontalLayout
 */
public static HorizontalLayout createNameValueLayout(final String label, final String... values) {
    final String valueStr = StringUtils.arrayToDelimitedString(values, " ");

    final Label nameValueLabel = new Label( label );
    nameValueLabel.setContentMode(ContentMode.TEXT);
    nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
    nameValueLabel.addStyleName("text-bold");
    nameValueLabel.setSizeUndefined();

    final Label valueStrLabel = new Label(valueStr);
    valueStrLabel.setWidth("100%");
    valueStrLabel.addStyleName("text-cut");
    valueStrLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
    valueStrLabel.addStyleName(LABEL_STYLE);

    final HorizontalLayout nameValueLayout = new HorizontalLayout();
    nameValueLayout.setMargin(false);
    nameValueLayout.setSpacing(true);
    nameValueLayout.setSizeFull();

    nameValueLayout.addComponent(nameValueLabel);
    nameValueLayout.setComponentAlignment(nameValueLabel, Alignment.TOP_LEFT);
    nameValueLayout.setExpandRatio(nameValueLabel, 0.0F);

    nameValueLayout.addComponent(valueStrLabel);
    nameValueLayout.setComponentAlignment(valueStrLabel, Alignment.TOP_LEFT);
    nameValueLayout.setExpandRatio(valueStrLabel, 1.0F);

    return nameValueLayout;
}
 
Example 11
Source File: PolicyWorkspace.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutLeftToolbarLeft() {
	// common part: create layout
	horizontalLayoutLeftToolbarLeft = new HorizontalLayout();
	horizontalLayoutLeftToolbarLeft.setImmediate(false);
	horizontalLayoutLeftToolbarLeft.setWidth("-1px");
	horizontalLayoutLeftToolbarLeft.setHeight("-1px");
	horizontalLayoutLeftToolbarLeft.setMargin(false);
	horizontalLayoutLeftToolbarLeft.setSpacing(true);
	
	// buttonSynchronize
	buttonSynchronize = new Button();
	buttonSynchronize.setCaption("Synchronize Repository");
	buttonSynchronize.setImmediate(true);
	buttonSynchronize
			.setDescription("Synchronize local repository with main branch.");
	buttonSynchronize.setWidth("-1px");
	buttonSynchronize.setHeight("-1px");
	horizontalLayoutLeftToolbarLeft.addComponent(buttonSynchronize);
	
	// buttonExport
	buttonExport = new Button();
	buttonExport.setCaption("Export Workspace");
	buttonExport.setImmediate(true);
	buttonExport.setDescription("Export your workspace to your local drive.");
	buttonExport.setWidth("-1px");
	buttonExport.setHeight("-1px");
	horizontalLayoutLeftToolbarLeft.addComponent(buttonExport);
	
	return horizontalLayoutLeftToolbarLeft;
}
 
Example 12
Source File: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void buildLayout() {
    nameEditLayout = new HorizontalLayout();

    final HorizontalLayout headerCaptionLayout = new HorizontalLayout();
    headerCaptionLayout.setMargin(false);
    headerCaptionLayout.setSpacing(true);
    headerCaptionLayout.setSizeFull();
    headerCaptionLayout.addStyleName("header-caption");

    headerCaptionLayout.addComponent(captionPrefix);
    headerCaptionLayout.setComponentAlignment(captionPrefix, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(captionPrefix, 0.0F);

    headerCaptionLayout.addComponent(captionNameVersion);
    headerCaptionLayout.setComponentAlignment(captionNameVersion, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(captionNameVersion, 1.0F);

    nameEditLayout.setWidth(100.0F, Unit.PERCENTAGE);
    nameEditLayout.addComponents(headerCaptionLayout);
    nameEditLayout.setComponentAlignment(headerCaptionLayout, Alignment.TOP_LEFT);
    if (hasEditPermission()) {
        nameEditLayout.addComponent(editButton);
        nameEditLayout.setComponentAlignment(editButton, Alignment.TOP_RIGHT);
        nameEditLayout.addComponent(manageMetadataBtn);
        nameEditLayout.setComponentAlignment(manageMetadataBtn, Alignment.TOP_RIGHT);
    }
    nameEditLayout.setExpandRatio(headerCaptionLayout, 1.0F);
    nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);

    addComponent(nameEditLayout);
    setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
    addComponent(detailsTab);
    setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);

    setSizeFull();
    setHeightUndefined();
    addStyleName(SPUIStyleDefinitions.WIDGET_STYLE);
}
 
Example 13
Source File: TargetFilterHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private static HorizontalLayout createHeaderFilterIconLayout() {
    final HorizontalLayout titleFilterIconsLayout = new HorizontalLayout();
    titleFilterIconsLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    titleFilterIconsLayout.setSpacing(false);
    titleFilterIconsLayout.setMargin(false);
    titleFilterIconsLayout.setSizeFull();
    return titleFilterIconsLayout;
}
 
Example 14
Source File: ServerDescBasic.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void attach() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(true);
    layout.setSpacing(false);
    layout.addStyleName("server-desc-basic");

    HorizontalLayout layout2 = new HorizontalLayout();
    layout2.setWidth("100%");
    layout2.setHeight("100%");
    layout2.setMargin(true);
    layout2.setSpacing(true);
    layout2.addStyleName("server-desc-basic");

    // サーバ基本情報
    left = new BasicInfo();
    left.setWidth("100%");
    layout2.addComponent(left);

    // 表同士の間隔をあける
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");
    layout2.addComponent(padding);

    Label padding2 = new Label("");
    padding2.setWidth("1px");
    layout2.addComponent(padding2);

    // 割り当てサービス
    String enableService = Config.getProperty("ui.enableService");
    if (enableService == null || BooleanUtils.toBoolean(enableService)) {
        right = new AttachService();
        right.setHeight("100%");
        right.setWidth("100%");
        layout2.addComponent(right);
    }

    layout2.setExpandRatio(left, 40);
    if (right != null) {
        layout2.setExpandRatio(right, 60);
    } else {
        VerticalLayout dummyLayout = new VerticalLayout();
        dummyLayout.setSizeFull();
        layout2.addComponent(dummyLayout);
        layout2.setExpandRatio(dummyLayout, 60);
    }

    layout.addComponent(layout2);
    layout.setExpandRatio(layout2, 1.0f);
}
 
Example 15
Source File: MainLayout.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 4 votes vote down vote up
@PostConstruct
public void postConstuct() {
	setSizeFull();
	eventBus.subscribe(this);
	
	navbar = new HorizontalLayout();
	navbar.setWidth("100%");
	navbar.setMargin(true);
	navbar.setDefaultComponentAlignment(Alignment.MIDDLE_RIGHT);
	addComponent(navbar);
	
	final Label brand = new Label("Vaadin4Spring Security Demo");
	brand.addStyleName(ValoTheme.LABEL_H2);
	brand.addStyleName(ValoTheme.LABEL_NO_MARGIN);
	navbar.addComponent(brand);
	navbar.setComponentAlignment(brand, Alignment.MIDDLE_LEFT);
	navbar.setExpandRatio(brand, 1);
	
	btnHome = new Button("Home", FontAwesome.HOME);
	btnHome.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	btnHome.setData(ViewToken.HOME);
	btnHome.addClickListener(this);
	navbar.addComponent(btnHome);
	
	btnUser = new Button("User home", FontAwesome.USER);
	btnUser.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	btnUser.setData(ViewToken.USER);
	btnUser.addClickListener(this);
	navbar.addComponent(btnUser);
	
	btnAdmin = new Button("Admin home", FontAwesome.USER_MD);
	btnAdmin.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	btnAdmin.setData(ViewToken.ADMIN);
	btnAdmin.addClickListener(this);
	navbar.addComponent(btnAdmin);
	
	btnAdminHidden = new Button("Admin secret", FontAwesome.EYE_SLASH);
	btnAdminHidden.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	btnAdminHidden.setData(ViewToken.ADMIN_HIDDEN);
	btnAdminHidden.addClickListener(this);
	navbar.addComponent(btnAdminHidden);
	
	btnSignIn = new Button("Sign in", FontAwesome.SIGN_IN);
	btnSignIn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	btnSignIn.setData(ViewToken.SIGNIN);
	btnSignIn.addClickListener(this);
	navbar.addComponent(btnSignIn);
	
	btnSignUp = new Button("Sign up", FontAwesome.PENCIL_SQUARE_O);
	btnSignUp.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	btnSignUp.setData(ViewToken.SIGNUP);
	btnSignUp.addClickListener(this);
	navbar.addComponent(btnSignUp);
					
	btnLogout = new Button("Logout", FontAwesome.SIGN_OUT);
	btnLogout.setData("-");
	btnLogout.addStyleName(ValoTheme.BUTTON_BORDERLESS);
	navbar.addComponent(btnLogout);
	btnLogout.addClickListener(new ClickListener() {
		
		@Override
		public void buttonClick(ClickEvent event) {
			logout();			
		}
	});
	
	viewContainer = new Panel();
	viewContainer.setSizeFull();
	addComponent(viewContainer);
	setExpandRatio(viewContainer, 1);				
}
 
Example 16
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void createComponents() {
    prefixTitleOfArtifactDetails = new Label();
    prefixTitleOfArtifactDetails.addStyleName(ValoTheme.LABEL_SMALL);
    prefixTitleOfArtifactDetails.addStyleName(ValoTheme.LABEL_BOLD);
    prefixTitleOfArtifactDetails.setSizeUndefined();

    titleOfArtifactDetails = new Label();
    titleOfArtifactDetails.setId(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID);
    titleOfArtifactDetails.setSizeFull();
    titleOfArtifactDetails.setImmediate(true);
    titleOfArtifactDetails.setWidth("100%");
    titleOfArtifactDetails.addStyleName(ValoTheme.LABEL_SMALL);
    titleOfArtifactDetails.addStyleName("text-bold");
    titleOfArtifactDetails.addStyleName("text-cut");
    titleOfArtifactDetails.addStyleName("header-caption-right");

    headerCaptionLayout = new HorizontalLayout();
    headerCaptionLayout.setMargin(false);
    headerCaptionLayout.setSpacing(true);
    headerCaptionLayout.setSizeFull();
    headerCaptionLayout.addStyleName("header-caption");

    headerCaptionLayout.addComponent(prefixTitleOfArtifactDetails);
    headerCaptionLayout.setComponentAlignment(prefixTitleOfArtifactDetails, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(prefixTitleOfArtifactDetails, 0.0F);

    headerCaptionLayout.addComponent(titleOfArtifactDetails);
    headerCaptionLayout.setComponentAlignment(titleOfArtifactDetails, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(titleOfArtifactDetails, 1.0F);

    maxMinButton = createMaxMinButton();

    artifactDetailsTable = createArtifactDetailsTable();

    artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer());
    addGeneratedColumn(artifactDetailsTable);
    if (!readOnly) {
        addGeneratedColumnButton(artifactDetailsTable);
    }
    setTableColumnDetails(artifactDetailsTable);
}
 
Example 17
Source File: ObadviceDictionary.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(false);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonNew
	buttonNew = new Button();
	buttonNew.setCaption("New");
	buttonNew.setImmediate(true);
	buttonNew
			.setDescription("Add a new advice or obligation to the dictionary.");
	buttonNew.setWidth("-1px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			24));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove
			.setDescription("Remove the selected advice or obligation from the dictionary.");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(24));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone the selected obligation/advice.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(24));
	
	// comboBoxFilter
	comboBoxFilter = new ComboBox();
	comboBoxFilter.setCaption("Filter By Type");
	comboBoxFilter.setImmediate(false);
	comboBoxFilter.setWidth("-1px");
	comboBoxFilter.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilter);
	
	return horizontalLayoutToolbar;
}
 
Example 18
Source File: XacmlAdminConsole.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("100.0%");
	horizontalLayout_1.setHeight("40px");
	horizontalLayout_1.setMargin(false);
	
	// embedded_1
	embedded_1 = new Embedded();
	embedded_1.setImmediate(false);
	embedded_1.setWidth("30px");
	embedded_1.setHeight("30px");
	embedded_1.setSource(new ThemeResource("img/att.png"));
	embedded_1.setType(1);
	embedded_1.setMimeType("image/png");
	horizontalLayout_1.addComponent(embedded_1);
	horizontalLayout_1.setComponentAlignment(embedded_1, new Alignment(33));
	
	// caption
	caption = new Label();
	caption.setImmediate(false);
	caption.setWidth("-1px");
	caption.setHeight("-1px");
	caption.setValue("AT&T Policy Engine Admin Console");
	horizontalLayout_1.addComponent(caption);
	horizontalLayout_1.setExpandRatio(caption, 1.0f);
	horizontalLayout_1.setComponentAlignment(caption, new Alignment(33));
	
	// labelWelcome
	labelWelcome = new Label();
	labelWelcome.setImmediate(false);
	labelWelcome.setWidth("-1px");
	labelWelcome.setHeight("40px");
	labelWelcome.setValue("Label");
	horizontalLayout_1.addComponent(labelWelcome);
	horizontalLayout_1.setComponentAlignment(labelWelcome,
			new Alignment(34));
	
	return horizontalLayout_1;
}
 
Example 19
Source File: WinServerEdit.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
public OpenStackDetailTab(InstanceDto instance, PlatformDto platform, ImageDto image) {
    this.instance = instance;
    this.platform = platform;
    this.image = image;

    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    sizeSelect = new ComboBox(ViewProperties.getCaption("field.serverSize"));
    sizeSelect.setWidth(COMBOBOX_WIDTH);
    sizeSelect.setNullSelectionAllowed(false);

    zoneSelect = new ComboBox(ViewProperties.getCaption("field.zone"));
    zoneSelect.setWidth(COMBOBOX_WIDTH);
    zoneSelect.setNullSelectionAllowed(false);
    zoneSelect.setItemCaptionPropertyId(ZONE_CAPTION_ID);
    zoneSelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);

    grpSelect = new ComboBox(ViewProperties.getCaption("field.securityGroup"));
    grpSelect.setWidth(COMBOBOX_WIDTH);
    grpSelect.setImmediate(true);
    grpSelect.setNullSelectionAllowed(false);

    keySelect = new ComboBox(ViewProperties.getCaption("field.keyPair"));
    keySelect.setWidth(COMBOBOX_WIDTH);
    keySelect.setNullSelectionAllowed(false);

    Label spacer = new Label(" ");
    spacer.addStyleName("desc-padding-horizontal");
    spacer.setHeight("5px");

    form.getLayout().addComponent(sizeSelect);
    form.getLayout().addComponent(zoneSelect);
    form.getLayout().addComponent(grpSelect);
    form.getLayout().addComponent(keySelect);
    form.getLayout().addComponent(spacer);

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setMargin(false);

    form.getLayout().addComponent(layout);

    addComponent(form);

    InstanceStatus status = InstanceStatus.fromStatus(instance.getInstance().getStatus());
    if (status != InstanceStatus.STOPPED) {
        // サーバがStopped以外の場合は、詳細設定タブ自体を変更不可とする
        form.setEnabled(false);
    } else {
        // 停止時は、いくつかの項目を変更不可とする
        if (StringUtils.isNotEmpty(instance.getOpenstackInstance().getInstanceId())) {
            // 一度でも起動した場合、項目を変更不可とする
            form.setEnabled(false);
        }
    }
}
 
Example 20
Source File: LoadBalancerDescServer.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void attach() {
    addStyleName(Reindeer.PANEL_LIGHT);
    setHeight("100%");

    VerticalLayout panel = (VerticalLayout) getContent();
    panel.setWidth("100%");
    panel.setHeight("100%");
    panel.setMargin(true);
    panel.setSpacing(false);
    panel.addStyleName("loadbalancer-desc-basic");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addStyleName("loadbalancer-desc-basic");

    // ロードバランサ詳細情報
    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setWidth("100%");
    leftLayout.setHeight("100%");
    leftLayout.setMargin(true, false, false, false);
    leftLayout.setSpacing(false);

    loadBalancerInfo = new LoadBalancerDetailInfo();
    leftLayout.addComponent(loadBalancerInfo);
    leftLayout.setExpandRatio(loadBalancerInfo, 10);
    layout.addComponent(leftLayout);

    // 表同士の間隔をあける
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");
    layout.addComponent(padding);

    Label padding2 = new Label("");
    padding2.setWidth("1px");
    layout.addComponent(padding2);

    // 割り当てサーバ
    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setWidth("100%");
    rightLayout.setHeight("100%");
    rightLayout.setMargin(false);
    rightLayout.setSpacing(false);
    rightLayout.addStyleName("loadbalancer-desc-server-right");

    attachServiceServerTable = new AttachSeriviceServerTable();
    rightLayout.addComponent(attachServiceServerTable);
    loadBalancerOpe = new LoadbalancerServerOperation();
    rightLayout.addComponent(loadBalancerOpe);
    rightLayout.setExpandRatio(attachServiceServerTable, 100);
    layout.addComponent(rightLayout);

    layout.setExpandRatio(leftLayout, 48);
    layout.setExpandRatio(rightLayout, 52);

    panel.addComponent(layout);
}