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

The following examples show how to use com.vaadin.ui.HorizontalLayout#setSpacing() . 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: 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 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: PolicyWorkspace.java    From XACML with MIT License 6 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutRightToolbar() {
	// common part: create layout
	horizontalLayoutRightToolbar = new HorizontalLayout();
	horizontalLayoutRightToolbar.setImmediate(false);
	horizontalLayoutRightToolbar.setWidth("100.0%");
	horizontalLayoutRightToolbar.setHeight("-1px");
	horizontalLayoutRightToolbar.setMargin(false);
	horizontalLayoutRightToolbar.setSpacing(true);
	
	// buttonRight
	buttonRight = new Button();
	buttonRight.setCaption(">>");
	buttonRight.setImmediate(true);
	buttonRight.setDescription("Restore left panel.");
	buttonRight.setWidth("-1px");
	buttonRight.setHeight("-1px");
	horizontalLayoutRightToolbar.addComponent(buttonRight);
	
	return horizontalLayoutRightToolbar;
}
 
Example 4
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 5
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 6
Source File: AbstractTableHeader.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 7
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    final HorizontalLayout headerLayout = new HorizontalLayout();
    headerLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    headerLayout.setSpacing(false);
    headerLayout.setMargin(false);
    headerLayout.setSizeFull();
    headerLayout.addComponent(headerCaption);
    if (hasCreatePermission()) {
        headerLayout.addComponents(addIcon);
        headerLayout.setComponentAlignment(addIcon, Alignment.MIDDLE_RIGHT);
    }
    headerLayout.setExpandRatio(headerCaption, 1.0F);

    final HorizontalLayout headerWrapperLayout = new HorizontalLayout();
    headerWrapperLayout.addStyleName("bordered-layout" + " " + "no-border-bottom" + " " + "metadata-table-margin");
    headerWrapperLayout.addComponent(headerLayout);
    headerWrapperLayout.setWidth("100%");
    headerLayout.setHeight("30px");

    final VerticalLayout tableLayout = new VerticalLayout();
    tableLayout.setSizeFull();
    tableLayout.setHeight("100%");
    tableLayout.addComponent(headerWrapperLayout);
    tableLayout.addComponent(metaDataGrid);
    tableLayout.addStyleName("table-layout");
    tableLayout.setExpandRatio(metaDataGrid, 1.0F);

    final VerticalLayout metadataFieldsLayout = createMetadataFieldsLayout();

    mainLayout = new HorizontalLayout();
    mainLayout.addComponent(tableLayout);
    mainLayout.addComponent(metadataFieldsLayout);
    mainLayout.setExpandRatio(tableLayout, 0.5F);
    mainLayout.setExpandRatio(metadataFieldsLayout, 0.5F);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    setCompositionRoot(mainLayout);
    setSizeFull();
}
 
Example 8
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 9
Source File: TableComponent.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Create a ButtonBox from TableAction List
 * @return HorizontalLayout with Buttons
 */
protected Component createButtonBox() {
	HorizontalLayout hl = new HorizontalLayout();
	hl.setSpacing(true);
	for (TableButtonListener a : actions) {
		a.setTable(this);
		Button b = FormUtils.newButton(a, this.nativeButtons);
		hl.addComponent(b);
	}
	
	return hl;
}
 
Example 10
Source File: ConfirmationDialog.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private HorizontalLayout createButtonLayout(final Button cancelButton) {
    final HorizontalLayout hButtonLayout = new HorizontalLayout();
    hButtonLayout.setSpacing(true);
    hButtonLayout.addComponent(okButton);
    hButtonLayout.addComponent(cancelButton);
    hButtonLayout.setSizeUndefined();
    hButtonLayout.setComponentAlignment(okButton, Alignment.TOP_CENTER);
    hButtonLayout.setComponentAlignment(cancelButton, Alignment.TOP_CENTER);
    return hButtonLayout;
}
 
Example 11
Source File: FormUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Add a default commit/discard buttons to a form
 * @param f the Form
 */
public static void addOKCancelButtons(Form f) {
	Button ok = newOKButton(f);
	Button cancel = newCancelButton(f);
	HorizontalLayout hl = new HorizontalLayout();
	hl.setSpacing(true);
	hl.addComponent(ok);
	hl.addComponent(cancel);
	HorizontalLayout  footer = new HorizontalLayout();
	footer.setWidth("100%");
	footer.addComponent(hl);
	footer.setComponentAlignment(hl, Alignment.TOP_CENTER);
	f.setFooter(footer);
}
 
Example 12
Source File: AgentForm.java    From doecode with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public AgentForm(RepositoryForm form) {
    this.parent = form;
    
    setSizeUndefined();
    
    GridLayout formContainer = new GridLayout(2,5);
    formContainer.setSpacing(true);
    
    agentTypeCode.addItems(Agent.agentTypes);
    agentTypeSpecific.addItems(Agent.specificTypes);
    
    Validator phoneValidator = new RegexpValidator("^((\\d{3}-|\\(\\d{3}\\)\\s?)?\\d{3}-|^\\d{3}(\\.)?\\d{3}\\3)\\d{4}$", "Please enter a valid phone number.");
    phoneNumber.addValidator(phoneValidator);
            
    formContainer.addComponent(firstName);
    formContainer.addComponent(lastName);
    formContainer.addComponent(agentTypeCode,0,1);
    formContainer.addComponent(agentTypeSpecific,1,1);
    formContainer.addComponent(email,0,2);
    formContainer.addComponent(affiliation,1,2);
    formContainer.addComponent(orcid,0,3);
    formContainer.addComponent(phoneNumber,1,3);
    
    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    buttons.addComponents(save, delete);
    
    save.setStyleName(ValoTheme.BUTTON_FRIENDLY);
    delete.setStyleName(ValoTheme.BUTTON_DANGER);
    
    save.setEnabled(false);
    delete.setEnabled(false);
    
    save.addClickListener(e->this.save());
    delete.addClickListener(e->this.delete());
    
    formContainer.addComponent(buttons, 0,4,1,4);
    
    addComponent(formContainer);
}
 
Example 13
Source File: WebTree.java    From cuba with Apache License 2.0 5 votes vote down vote up
protected HorizontalLayout createTopPanel() {
    HorizontalLayout topPanel = new HorizontalLayout();
    topPanel.setSpacing(false);
    topPanel.setMargin(false);
    topPanel.setStyleName("c-tree-top");
    return topPanel;
}
 
Example 14
Source File: EnumerationEditorComponent.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("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	horizontalLayout_1.setSpacing(true);
	
	// buttonAdd
	buttonAdd = new Button();
	buttonAdd.setCaption("Add");
	buttonAdd.setImmediate(true);
	buttonAdd.setDescription("Add a new enumeration value.");
	buttonAdd.setWidth("-1px");
	buttonAdd.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonAdd);
	horizontalLayout_1.setComponentAlignment(buttonAdd, new Alignment(9));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove.setDescription("Remove the selected enumeration value.");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonRemove);
	horizontalLayout_1.setComponentAlignment(buttonRemove,
			new Alignment(10));
	
	// buttonClearAll
	buttonClearAll = new Button();
	buttonClearAll.setCaption("Clear All");
	buttonClearAll.setImmediate(false);
	buttonClearAll.setDescription("Clears all the values out.");
	buttonClearAll.setWidth("-1px");
	buttonClearAll.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonClearAll);
	
	return horizontalLayout_1;
}
 
Example 15
Source File: ExpressionBuilderComponent.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("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	horizontalLayout_1.setSpacing(true);
	
	// buttonAddExpression
	buttonAddExpression = new Button();
	buttonAddExpression.setCaption("Add Expression");
	buttonAddExpression.setImmediate(true);
	buttonAddExpression.setWidth("-1px");
	buttonAddExpression.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonAddExpression);
	
	// buttonDeleteExpression
	buttonDeleteExpression = new Button();
	buttonDeleteExpression.setCaption("Delete Expression");
	buttonDeleteExpression.setImmediate(true);
	buttonDeleteExpression.setWidth("-1px");
	buttonDeleteExpression.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonDeleteExpression);
	
	// buttonClearAll
	buttonClearAll = new Button();
	buttonClearAll.setCaption("Clear All");
	buttonClearAll.setImmediate(true);
	buttonClearAll.setDescription("Clears all the expressions.");
	buttonClearAll.setWidth("-1px");
	buttonClearAll.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonClearAll);
	
	// checkBoxShortName
	checkBoxShortName = new CheckBox();
	checkBoxShortName.setCaption("Display Short XACML ID's");
	checkBoxShortName.setImmediate(false);
	checkBoxShortName
			.setDescription("If checked, the right-most string of the function and datatype URI's will only be displayed.");
	checkBoxShortName.setWidth("-1px");
	checkBoxShortName.setHeight("-1px");
	horizontalLayout_1.addComponent(checkBoxShortName);
	
	return horizontalLayout_1;
}
 
Example 16
Source File: PIPManagement.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);
	
	// buttonAdd
	buttonAdd = new Button();
	buttonAdd.setCaption("Add Configuration");
	buttonAdd.setImmediate(true);
	buttonAdd.setWidth("-1px");
	buttonAdd.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonAdd);
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone Configuration");
	buttonClone.setImmediate(true);
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove Configuration");
	buttonRemove.setImmediate(true);
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	
	// buttonImport
	buttonImport = new Button();
	buttonImport.setCaption("Import Configuration");
	buttonImport.setImmediate(false);
	buttonImport
			.setDescription("Imports a configuration from a properties file.");
	buttonImport.setWidth("-1px");
	buttonImport.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonImport);
	
	return horizontalLayoutToolbar;
}
 
Example 17
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 18
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 19
Source File: SensorAdminPanel.java    From sensorhub with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void build(final MyBeanItem<ModuleConfig> beanItem, final ISensorModule<?> module)
{
    super.build(beanItem, module);       
    
    // add section label
    final GridLayout form = new GridLayout();
    form.setWidth(100.0f, Unit.PERCENTAGE);
    form.setMargin(false);
    form.setSpacing(true);
    
    // section title
    form.addComponent(new Label(""));
    HorizontalLayout titleBar = new HorizontalLayout();
    titleBar.setSpacing(true);
    Label sectionLabel = new Label("Inputs/Outputs");
    sectionLabel.addStyleName(STYLE_H3);
    sectionLabel.addStyleName(STYLE_COLORED);
    titleBar.addComponent(sectionLabel);
    titleBar.setComponentAlignment(sectionLabel, Alignment.MIDDLE_LEFT);
    
    // refresh button to show latest record
    Button refreshButton = new Button("Refresh");
    refreshButton.setDescription("Load latest data from sensor");
    refreshButton.setIcon(REFRESH_ICON);
    refreshButton.addStyleName(STYLE_QUIET);
    titleBar.addComponent(refreshButton);
    titleBar.setComponentAlignment(refreshButton, Alignment.MIDDLE_LEFT);
    refreshButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;
        @Override
        public void buttonClick(ClickEvent event)
        {
            rebuildSwePanels(form, module);
        }
    });
            
    form.addComponent(titleBar);
    
    // add I/O panel
    rebuildSwePanels(form, module);
    addComponent(form);
}
 
Example 20
Source File: ServiceDescBasic.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%");

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

    // サービス基本情報
    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setMargin(false);
    leftLayout.setSpacing(false);
    leftLayout.setWidth("100%");
    leftLayout.setHeight("100%");

    left = new BasicInfoOpe();
    left.setWidth("100%");
    leftLayout.addComponent(left);
    leftLayout.setExpandRatio(left, 1.0f);
    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.setMargin(false);
    rightLayout.setSpacing(false);
    rightLayout.setWidth("100%");
    rightLayout.setHeight("100%");

    right = new AttachServersOpe();
    right.setWidth("100%");
    rightLayout.addComponent(right);
    serverOpe = new ServiceSvrOperation();
    rightLayout.addComponent(serverOpe);
    rightLayout.setExpandRatio(right, 1.0f);
    layout.addComponent(rightLayout);

    layout.setExpandRatio(leftLayout, 40);
    layout.setExpandRatio(rightLayout, 60);
}