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

The following examples show how to use com.vaadin.ui.HorizontalLayout#setWidth() . 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: 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 2
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 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: 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 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: ServerDescDetail.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);

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

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

    left = new DetailInfo();
    left.setWidth("200px");
    layout.addComponent(left);

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

    layout.setExpandRatio(right, 100);

    panel.addComponent(layout);
    panel.setExpandRatio(layout, 1.0f);
}
 
Example 7
Source File: AbstractPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the page visit history.
 *
 * @param pageName
 *            the page name
 * @param pageId
 *            the page id
 * @param panelContent
 *            the panel content
 */
protected final void createPageVisitHistory(final String pageName, final String pageId,
		final VerticalLayout panelContent) {

	final TabSheet tabsheet = new TabSheet();
	tabsheet.setWidth(100, Unit.PERCENTAGE);
	tabsheet.setHeight(100, Unit.PERCENTAGE);

	panelContent.addComponent(tabsheet);
	panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE);

	final HorizontalLayout tabContentPageItemRankHistory = new HorizontalLayout();
	tabContentPageItemRankHistory.setWidth(100, Unit.PERCENTAGE);
	tabContentPageItemRankHistory.setHeight(100, Unit.PERCENTAGE);
	final Tab tabPageItemRankHistory = tabsheet.addTab(tabContentPageItemRankHistory);

	tabPageItemRankHistory.setCaption(CURRENT_PAGE_VISIT_HISTORY);
	adminChartDataManager.createApplicationActionEventPageElementDailySummaryChart(tabContentPageItemRankHistory,
			pageName, pageId);

	final HorizontalLayout tabContentPageModeSummary = new HorizontalLayout();
	tabContentPageModeSummary.setWidth(100, Unit.PERCENTAGE);
	tabContentPageModeSummary.setHeight(100, Unit.PERCENTAGE);
	final Tab tabPageModeSummary = tabsheet.addTab(tabContentPageModeSummary);
	tabPageModeSummary.setCaption(GENERAL_PAGE_MODE_PAGE_VISIT);

	adminChartDataManager.createApplicationActionEventPageModeDailySummaryChart(tabContentPageModeSummary,
			pageName);

}
 
Example 8
Source File: AbstractHawkbitUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private HorizontalLayout buildViewTitle() {
    final HorizontalLayout viewHeadercontent = new HorizontalLayout();
    viewHeadercontent.setWidth("100%");
    viewHeadercontent.addStyleName("view-header-layout");

    viewTitle = new Label();
    viewTitle.setWidth("100%");
    viewTitle.setStyleName("header-content");
    viewHeadercontent.addComponent(viewTitle);

    viewHeadercontent.addComponent(notificationUnreadButton);
    viewHeadercontent.setComponentAlignment(notificationUnreadButton, Alignment.MIDDLE_RIGHT);
    return viewHeadercontent;
}
 
Example 9
Source File: ObligationAdviceEditorWindow.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);
	
	// buttonAdd
	buttonAdd = new Button();
	buttonAdd.setCaption("Add Expression");
	buttonAdd.setImmediate(false);
	buttonAdd.setWidth("-1px");
	buttonAdd.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonAdd);
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove Expression");
	buttonRemove.setImmediate(false);
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonRemove);
	
	// buttonClear
	buttonClear = new Button();
	buttonClear.setCaption("Clear Expressions");
	buttonClear.setImmediate(false);
	buttonClear.setWidth("-1px");
	buttonClear.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonClear);
	
	return horizontalLayout_1;
}
 
Example 10
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 11
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 12
Source File: AttributeSelectionWindow.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");
	
	// horizontalLayout_1
	horizontalLayout_1 = buildHorizontalLayout_1();
	mainLayout.addComponent(horizontalLayout_1);
	
	// horizontalLayoutAttribute
	horizontalLayoutAttribute = new HorizontalLayout();
	horizontalLayoutAttribute.setImmediate(false);
	horizontalLayoutAttribute.setWidth("-1px");
	horizontalLayoutAttribute.setHeight("-1px");
	horizontalLayoutAttribute.setMargin(false);
	mainLayout.addComponent(horizontalLayoutAttribute);
	mainLayout.setExpandRatio(horizontalLayoutAttribute, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Select");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 13
Source File: AttributeDictionary.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("Create a new attribute");
	buttonNew.setWidth("70px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			9));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove.setDescription("Remove the selected attribute(s)");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(9));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone an attribute.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(9));
	
	// comboBoxFilterCategory
	comboBoxFilterCategory = new ComboBox();
	comboBoxFilterCategory.setCaption("Filter By Category");
	comboBoxFilterCategory.setImmediate(false);
	comboBoxFilterCategory.setWidth("-1px");
	comboBoxFilterCategory.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterCategory);
	
	// comboBoxFilterDatatype
	comboBoxFilterDatatype = new ComboBox();
	comboBoxFilterDatatype.setCaption("Filter By Data Type");
	comboBoxFilterDatatype.setImmediate(false);
	comboBoxFilterDatatype.setWidth("-1px");
	comboBoxFilterDatatype.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterDatatype);
	
	return horizontalLayoutToolbar;
}
 
Example 14
Source File: AdminApplicationConfigurationPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();

	final String pageId = getPageId(parameters);
	final int pageNr= getPageNr(parameters);


	getMenuItemFactory().createMainPageMenuBar(menuBar);

	LabelFactory.createHeader2Label(content,ADMIN_APPLICATION_CONFIGURATION);

	final DataContainer<ApplicationConfiguration, Long> dataContainer = getApplicationManager()
			.getDataContainer(ApplicationConfiguration.class);

	final List<ApplicationConfiguration> pageOrderBy = dataContainer.getPageOrderBy(pageNr,DEFAULT_RESULTS_PER_PAGE, ApplicationConfiguration_.configurationGroup);

	getPagingUtil().createPagingControls(content,NAME,pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);

	getGridFactory().createBasicBeanItemGrid(content,ApplicationConfiguration.class,
			pageOrderBy,
			APPLICATION_CONFIGURATION,
			COLUMN_ORDER, HIDE_COLUMNS,
			new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_CONFIGURATION_VIEW_NAME, "hjid"), null, null);

	if (pageId != null && !pageId.isEmpty()) {

		final ApplicationConfiguration applicationConfiguration = dataContainer.load(Long.valueOf(pageId));

		if (applicationConfiguration != null) {

			final VerticalLayout leftLayout = new VerticalLayout();
			leftLayout.setSizeFull();
			final VerticalLayout rightLayout = new VerticalLayout();
			rightLayout.setSizeFull();
			final HorizontalLayout horizontalLayout = new HorizontalLayout();
			horizontalLayout.setWidth(ContentSize.FULL_SIZE);
			content.addComponent(horizontalLayout);
			horizontalLayout.addComponent(leftLayout);
			horizontalLayout.addComponent(rightLayout);


			getFormFactory().addFormPanelTextFields(leftLayout, applicationConfiguration,
					ApplicationConfiguration.class,
					AS_LIST);

			final UpdateApplicationConfigurationRequest request = new UpdateApplicationConfigurationRequest();
			request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
			request.setApplicationConfigurationId(applicationConfiguration.getHjid());

			request.setConfigTitle(applicationConfiguration.getConfigTitle());
			request.setConfigDescription(applicationConfiguration.getConfigDescription());

			request.setComponentTitle(applicationConfiguration.getConfigTitle());
			request.setComponentDescription(applicationConfiguration.getComponentDescription());

			request.setPropertyValue(applicationConfiguration.getPropertyValue());

			final ClickListener buttonListener = new UpdateApplicationConfigurationClickListener(request);

			final Panel updateFormPanel = new Panel();
			updateFormPanel.setSizeFull();

			rightLayout.addComponent(updateFormPanel);

			final FormLayout updateFormContent = new FormLayout();
			updateFormPanel.setContent(updateFormContent);

			getFormFactory().addRequestInputFormFields(updateFormContent, request,
					UpdateApplicationConfigurationRequest.class, AS_LIST2,
					UPDATE_CONFIGURATION, buttonListener);

		}
	}

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_APPLICATION_CONFIGURATION_VIEW,
			ApplicationEventGroup.ADMIN, NAME, null, pageId);

	return content;
}
 
Example 15
Source File: AdminApplicationSessionPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();

	final String pageId = getPageId(parameters);
	final int pageNr= getPageNr(parameters);

	getMenuItemFactory().createMainPageMenuBar(menuBar);

	LabelFactory.createHeader2Label(content,ADMIN_APPLICATION_SESSION);

	final DataContainer<ApplicationSession, Long> dataContainer = getApplicationManager()
			.getDataContainer(ApplicationSession.class);

	final List<ApplicationSession> pageOrderBy = dataContainer.getPageOrderBy(pageNr,DEFAULT_RESULTS_PER_PAGE, ApplicationSession_.createdDate);

	getPagingUtil().createPagingControls(content,NAME,pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);

	getGridFactory().createBasicBeanItemGrid(content, ApplicationSession.class, pageOrderBy,
			APPLICATION_SESSION,
			COLUMN_ORDER, HIDE_COLUMNS,
			new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "hjid"), null, new ListPropertyConverter[] { new ListPropertyConverter("page", "events", "actionName")});

	if (pageId != null && !pageId.isEmpty()) {

		final ApplicationSession applicationSession = dataContainer.load(Long.valueOf(pageId));

		if (applicationSession != null) {

			final VerticalLayout rightLayout = new VerticalLayout();
			rightLayout.setSizeFull();
			final HorizontalLayout horizontalLayout = new HorizontalLayout();
			horizontalLayout.setWidth(ContentSize.FULL_SIZE);
			content.addComponent(horizontalLayout);
			content.setExpandRatio(horizontalLayout, ContentRatio.GRID);


			getFormFactory().addFormPanelTextFields(horizontalLayout, applicationSession,
					ApplicationSession.class,
					AS_LIST);

			horizontalLayout.addComponent(rightLayout);
			horizontalLayout.setExpandRatio(rightLayout, ContentRatio.GRID);

			getGridFactory().createBasicBeanItemGrid(rightLayout,
					ApplicationActionEvent.class,applicationSession.getEvents(),
					APPLICATION_ACTION_EVENT,
					COLUMN_ORDER2, HIDE_COLUMNS2,
					new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME, "hjid"),
					null, null);
		}

	}

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_APPLICATION_SESSION_VIEW, ApplicationEventGroup.ADMIN,
			NAME, null, pageId);

	return content;

}
 
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: AbstractView.java    From cia with Apache License 2.0 4 votes vote down vote up
/**
 * Creates the basic layout with panel and footer.
 *
 * @param panelName
 *            the panel name
 */
protected final void createBasicLayoutWithPanelAndFooter(final String panelName) {
	final VerticalLayout layout = createFullSizeVerticalLayout();
	final VerticalLayout pageModeContent = createFullSizeVerticalLayout(false,false);
	layout.addComponent(pageModeContent);

	final HorizontalLayout topHeader = new HorizontalLayout();

	addLogoToHeader(topHeader);
	createTopTitleHeader(topHeader);

	topHeaderRightPanel.removeAllComponents();
	topHeader.addComponent(topHeaderRightPanel);
	topHeader.setComponentAlignment(topHeaderRightPanel, Alignment.MIDDLE_RIGHT);
	topHeader.setExpandRatio(topHeaderRightPanel, ContentRatio.LARGE);

	createTopHeaderActionsForUserContext();

	topHeaderRightPanel.setWidth("100%");
	topHeaderRightPanel.setHeight("50px");

	topHeader.setWidth("100%");
	topHeader.setHeight("50px");

	pageModeContent.addComponent(topHeader);
	pageModeContent.setComponentAlignment(topHeader, Alignment.TOP_CENTER);

	pageModeContent.addComponent(getBarmenu());
	pageModeContent.setComponentAlignment(getBarmenu(), Alignment.TOP_CENTER);

	panel = new Panel(panelName);
	panel.addStyleName("v-panel-page-panel");

	panel.setSizeFull();
	pageModeContent.addComponent(panel);
	pageModeContent.setExpandRatio(panel, ContentRatio.FULL_SIZE);

	pageModeContent.addComponent(pageLinkFactory.createMainViewPageLink());
	setContent(layout);

	setWidth(100, Unit.PERCENTAGE);
	setHeight(100, Unit.PERCENTAGE);
	setSizeFull();

}
 
Example 18
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 19
Source File: LayoutUsageExample.java    From viritin with Apache License 2.0 4 votes vote down vote up
public void layoutCodeExample() {

        VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setMargin(true);
        verticalLayout.setSpacing(true);
        verticalLayout.setHeight("100%");
        HorizontalLayout horizontalLayout = new HorizontalLayout(c, d);
        horizontalLayout.setWidth("100%");
        horizontalLayout.setMargin(false);
        horizontalLayout.setSpacing(true);
        verticalLayout.addComponents(a, b, horizontalLayout);
        setContent(verticalLayout);

        // Is same as 
        setContent(new MVerticalLayout().withFullHeight().with(a, b,
                new MHorizontalLayout(c, d).withFullWidth().withMargin(false)));

        // Or ... 
        VerticalLayout wrapper = new VerticalLayout();
        wrapper.setMargin(true);
        wrapper.setSpacing(true);
        wrapper.setHeight("100%");
        HorizontalLayout toolbar = new HorizontalLayout(c, d);
        toolbar.setWidth("100%");
        toolbar.setMargin(false);
        toolbar.setSpacing(true);
        HorizontalLayout wrapper2 = new HorizontalLayout();
        wrapper2.addComponent(menu);
        wrapper2.addComponent(mainContent);
        wrapper2.setSizeFull();
        mainContent.setSizeFull();
        wrapper2.setExpandRatio(mainContent, 1);
        wrapper.addComponents(toolbar, wrapper2);
        wrapper.setExpandRatio(wrapper2, 1);
        setContent(wrapper);

        // Is same as:
        setContent(
                new MVerticalLayout(new MHorizontalLayout(c, d).withFullWidth())
                .expand(
                        new MHorizontalLayout(menu)
                        .expand(mainContent)
                )
        );
        // the expand call takes care of adding component and setting sane 
        // values for layout and the added component

    }
 
Example 20
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;
}