List of usage examples for com.vaadin.ui CssLayout setHeight
@Override public void setHeight(String height)
From source file:jp.primecloud.auto.ui.LoadBalancerPanel.java
License:Open Source License
@Override public void attach() { setSizeFull();//from w ww . j av a 2s .co m addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("loadbalancer-tab"); layout.setSpacing(false); layout.setMargin(false); // ? SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splitPanel.setSplitPosition(40); splitPanel.setSizeFull(); layout.addComponent(splitPanel); // ? VerticalLayout upperLayout = new VerticalLayout(); upperLayout.setSizeFull(); upperLayout.setSpacing(false); upperLayout.setMargin(false); CssLayout upperTopLayout = new CssLayout(); Label label = new Label(ViewProperties.getCaption("label.loadbalancer")); upperTopLayout.setWidth("100%"); upperTopLayout.setMargin(true); upperTopLayout.addStyleName("loadbalancer-table-label"); upperTopLayout.addComponent(label); upperTopLayout.setHeight("28px"); upperLayout.addComponent(upperTopLayout); loadBalancerTable = new LoadBalancerTable(sender); loadBalancerTable.setContainerDataSource(new LoadBalancerDtoContainer()); upperLayout.addComponent(loadBalancerTable); loadBalancerTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); loadBalancerButtonsBottom = new LoadBalancerButtonsBottom(sender); upperLayout.addComponent(loadBalancerButtonsBottom); upperLayout.setExpandRatio(loadBalancerTable, 10); splitPanel.addComponent(upperLayout); // ? loadBalancerDesc = new LoadBalancerDesc(sender); splitPanel.addComponent(loadBalancerDesc); }
From source file:jp.primecloud.auto.ui.MainView.java
License:Open Source License
@Override public void attach() { setSizeFull();/*from w w w.j a va 2 s .c o m*/ addStyleName("mycloud-panel"); setMargin(false); setSpacing(false); // ??? topBar = new TopBar(this); addComponent(topBar); // ??? CssLayout topLayout = new CssLayout(); topLayout.setWidth("100%"); topLayout.setHeight("28px"); topLayout.addStyleName("mycloud-name"); topLayout.setMargin(true); addComponent(topLayout); // myCloud?? myCloudField = new TextField(); myCloudField.setWidth("80%"); myCloudField.addStyleName("mycloud-label"); myCloudField.setEnabled(false); myCloudField.setReadOnly(true); topLayout.addComponent(myCloudField); // Reload reloadButton = new Button(ViewProperties.getCaption("button.reload")); reloadButton.setDescription(ViewProperties.getCaption("description.reload")); reloadButton.addStyleName("sync-button"); reloadButton.addStyleName("borderless"); reloadButton.setIcon(Icons.SYNC.resource()); reloadButton.setEnabled(false); reloadButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { refresh(); } }); topLayout.addComponent(reloadButton); // myCloud VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSizeFull(); mainLayout.setSpacing(false); mainLayout.setMargin(false); Panel mainPanel = new Panel(mainLayout); mainPanel.setSizeFull(); mainPanel.addStyleName(Reindeer.PANEL_LIGHT); addComponent(mainPanel); setExpandRatio(mainPanel, 100); // tab = new TabSheet(); tab.setSizeFull(); tab.setEnabled(false); tab.addStyleName(Reindeer.TABSHEET_BORDERLESS); mainLayout.addComponent(tab); mainLayout.setExpandRatio(tab, 100); // String enableService = Config.getProperty("ui.enableService"); if (enableService == null || BooleanUtils.toBoolean(enableService)) { servicePanel = new ServicePanel(this); tab.addTab(servicePanel, ViewProperties.getCaption("tab.service"), Icons.SERVICETAB.resource()); } // ? serverPanel = new ServerPanel(this); tab.addTab(serverPanel, ViewProperties.getCaption("tab.server"), Icons.SERVERTAB.resource()); // ? String enableLoadBalancer = Config.getProperty("ui.enableLoadBalancer"); if (enableLoadBalancer == null || BooleanUtils.toBoolean(enableLoadBalancer)) { loadBalancerPanel = new LoadBalancerPanel(this); tab.addTab(loadBalancerPanel, ViewProperties.getCaption("tab.loadbalancer"), Icons.LOADBALANCER_TAB.resource()); } // ??????? tab.addListener(new SelectedTabChangeListener() { @Override public void selectedTabChange(SelectedTabChangeEvent event) { MainView.this.selectedTabChange(event); } }); // ? Refresher timer = new Refresher(); timer.setRefreshInterval(15 * 1000); //(msec) timer.addListener(new Refresher.RefreshListener() { @Override public void refresh(Refresher source) { if (needsRefresh()) { refreshTableOnly(); } } }); mainLayout.addComponent(timer); // ? showLogin(); }
From source file:jp.primecloud.auto.ui.MyCloud.java
License:Open Source License
public MyCloud() { setWidth("100%"); setHeight("100%"); addStyleName("mycloud-panel"); VerticalLayout layout = this; layout.setMargin(false);/*w ww . j a v a2 s .com*/ layout.setSpacing(false); CssLayout hlay = new CssLayout(); hlay.setWidth("100%"); hlay.setHeight("28px"); hlay.addStyleName("mycloud-name"); hlay.setMargin(true); //?? lblMycloud = new TextField(); lblMycloud.setWidth("80%"); lblMycloud.addStyleName("mycloud-label"); lblMycloud.setEnabled(false); lblMycloud.setReadOnly(true); hlay.addComponent(lblMycloud); // reloadb = new Button(ViewProperties.getCaption("button.reload")); reloadb.setDescription(ViewProperties.getCaption("description.reload")); reloadb.addStyleName("sync-button"); reloadb.addStyleName("borderless"); reloadb.setIcon(Icons.SYNC.resource()); reloadb.setEnabled(false); reloadb.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // ???? Component c = MyCloud.this.myCloudTabs.tabDesc.getSelectedTab(); refresh(); MyCloud.this.myCloudTabs.tabDesc.setSelectedTab(c); } }); hlay.addComponent(reloadb); layout.addComponent(hlay); //myCloud? layout.addComponent(myCloudTabs); layout.setExpandRatio(myCloudTabs, 100); }
From source file:jp.primecloud.auto.ui.MyCloudTabs.java
License:Open Source License
MyCloudTabs() { // ??/// w w w . j av a 2 s .co m String enableLoadBalancer = Config.getProperty("ui.enableLoadBalancer"); this.enableLoadBalancer = (enableLoadBalancer == null) || (BooleanUtils.toBoolean(enableLoadBalancer)); setSizeFull(); // ??disable?????? tabDesc.setSizeFull(); tabDesc.setEnabled(false); tabDesc.addStyleName(Reindeer.TABSHEET_BORDERLESS); addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.setSpacing(false); layout.setMargin(false); // pnService.setSizeFull(); pnService.addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout vlService = (VerticalLayout) pnService.getContent(); vlService.setSizeFull(); vlService.addStyleName("service-tab"); vlService.setSpacing(false); vlService.setMargin(false); //? SplitPanel splService = new SplitPanel(); splService.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splService.setSplitPosition(40); splService.setSizeFull(); vlService.addComponent(splService); vlService.setExpandRatio(splService, 10); //? VerticalLayout layServiceUpper = new VerticalLayout(); layServiceUpper.setSizeFull(); layServiceUpper.setSpacing(false); layServiceUpper.setMargin(false); layServiceUpper.addComponent(serviceButtonsTop); layServiceUpper.addComponent(serviceTable); layServiceUpper.addComponent(serviceButtonsBottom); layServiceUpper.setExpandRatio(serviceTable, 10); splService.addComponent(layServiceUpper); //? splService.addComponent(serviceDesc); tabDesc.addTab(pnService, ViewProperties.getCaption("tab.service"), Icons.SERVICETAB.resource()); //? pnServer.setSizeFull(); pnServer.addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout vlServer = (VerticalLayout) pnServer.getContent(); vlServer.setSizeFull(); vlServer.addStyleName("server-tab"); vlServer.setSpacing(false); vlServer.setMargin(false); //? SplitPanel splServer = new SplitPanel(); splServer.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splServer.setSplitPosition(40); splServer.setSizeFull(); vlServer.addComponent(splServer); //? VerticalLayout layServerUpper = new VerticalLayout(); layServerUpper.setSizeFull(); layServerUpper.setSpacing(false); layServerUpper.setMargin(false); layServerUpper.addComponent(serverButtonsTop); layServerUpper.addComponent(serverTable); layServerUpper.addComponent(serverButtonsBottom); layServerUpper.setExpandRatio(serverTable, 10); splServer.addComponent(layServerUpper); //? splServer.addComponent(serverDesc); tabDesc.addTab(pnServer, ViewProperties.getCaption("tab.server"), Icons.SERVERTAB.resource()); //? pnLoadBalancer.setSizeFull(); pnLoadBalancer.addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout vlLBalancer = (VerticalLayout) pnLoadBalancer.getContent(); vlLBalancer.setSizeFull(); vlLBalancer.addStyleName("loadbalancer-tab"); vlLBalancer.setSpacing(false); vlLBalancer.setMargin(false); CssLayout hLBalancer = new CssLayout(); Label lLBalancer = new Label(ViewProperties.getCaption("label.loadbalancer")); hLBalancer.setWidth("100%"); hLBalancer.setMargin(true); hLBalancer.addStyleName("loadbalancer-table-label"); hLBalancer.addComponent(lLBalancer); hLBalancer.setHeight("28px"); //? SplitPanel splLBalancer = new SplitPanel(); splLBalancer.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splLBalancer.setSplitPosition(40); splLBalancer.setSizeFull(); vlLBalancer.addComponent(splLBalancer); //? VerticalLayout layLBUpper = new VerticalLayout(); layLBUpper.setSizeFull(); layLBUpper.setSpacing(false); layLBUpper.setMargin(false); layLBUpper.addComponent(hLBalancer); layLBUpper.addComponent(loadBalancerTable); layLBUpper.addComponent(loadBalancerTableOpe); layLBUpper.setExpandRatio(loadBalancerTable, 10); splLBalancer.addComponent(layLBUpper); //? splLBalancer.addComponent(loadBalancerDesc); if (this.enableLoadBalancer) { tabDesc.addTab(pnLoadBalancer, ViewProperties.getCaption("tab.loadbalancer"), Icons.LOADBALANCER_TAB.resource()); } // tabDesc.addListener(TabSheet.SelectedTabChangeEvent.class, this, "selectedTabChange"); layout.addComponent(tabDesc); Refresher timer = new Refresher(); timer.setRefreshInterval(15 * 1000); //(msec) timer.addListener(new Refresher.RefreshListener() { @Override public void refresh(Refresher source) { if (needsRefresh()) { refreshTableOnly(); } } }); layout.addComponent(timer); layout.setExpandRatio(tabDesc, 100); }
From source file:org.escidoc.browser.elabsmodul.views.helpers.ResourcePropertiesViewHelper.java
License:Open Source License
public Panel generatePropertiesView() { // Item title String resourceType = resourceProxy.getType().toString(); if (this.type != null && this.type.length() > 0) { resourceType = this.type; }/* w w w .j a va 2 s . c o m*/ final Label titleLabel = new Label(resourceType.substring(0, 1).toUpperCase() + resourceType.substring(1).toLowerCase() + ": " + resourceProxy.getName()); titleLabel.setDescription("header"); titleLabel.setStyleName("h2 fullwidth"); // HR Ruler final Label descRuler = new Label("<hr/>", Label.CONTENT_RAW); descRuler.setStyleName("hr"); // ItemProperties View final CssLayout propertiesView = new CssLayout(); propertiesView.setWidth("100%"); propertiesView.setHeight("100%"); final Label descMetadata1 = new Label("ID: " + resourceProxy.getId()); final Label descMetadata2 = new Label( LAST_MODIFIED_BY + " " + resourceProxy.getModifier() + " on " + resourceProxy.getModifiedOn(), Label.CONTENT_XHTML); final Panel pnlPropertiesLeft = buildLeftPanel(); pnlPropertiesLeft.setWidth("40%"); pnlPropertiesLeft.setHeight("20px"); pnlPropertiesLeft.setStyleName(FLOAT_LEFT); pnlPropertiesLeft.addStyleName(Runo.PANEL_LIGHT); pnlPropertiesLeft.getLayout().setMargin(false); pnlPropertiesLeft.addComponent(descMetadata1); final Panel pnlPropertiesRight = buildRightPanel(); pnlPropertiesRight.setWidth("60%"); pnlPropertiesRight.setHeight("20px"); pnlPropertiesRight.setStyleName(FLOAT_RIGHT); pnlPropertiesRight.addStyleName(Runo.PANEL_LIGHT); pnlPropertiesRight.getLayout().setMargin(false); pnlPropertiesRight.addComponent(descMetadata2); propertiesView.addComponent(pnlPropertiesLeft); propertiesView.addComponent(pnlPropertiesRight); Panel viewHandler = buildmainView(); new BreadCrumbMenu(viewHandler, breadCrumbModel, serviceLocation); viewHandler.addComponent(titleLabel); viewHandler.addComponent(descRuler); viewHandler.addComponent(propertiesView); return viewHandler; }
From source file:org.escidoc.browser.ui.maincontent.ContainerMetadataRecordsView.java
License:Open Source License
private Panel lblMetadaRecs() { panel.setSizeFull();//from w w w. j a v a 2s .co m VerticalLayout vl = new VerticalLayout(); vl.setSizeFull(); final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.METADATA); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); if (containerController.hasAccess()) { final Button btnAddNew = new Button(); btnAddNew.addListener(new OnAddContainerMetadata(mainWindow, repositories, resourceProxy)); btnAddNew.setStyleName(BaseTheme.BUTTON_LINK); btnAddNew.addStyleName("floatright paddingtop3"); btnAddNew.setWidth("20px"); btnAddNew.setIcon(ICON); cssLayout.addComponent(btnAddNew); } vl.addComponent(cssLayout); ContainerMetadataTable metadataTable = new ContainerMetadataTable(resourceProxy.getMetadataRecords(), containerController, router, resourceProxy, repositories); metadataTable.buildTable(); vl.addComponent(metadataTable); vl.setComponentAlignment(metadataTable, Alignment.TOP_LEFT); vl.setExpandRatio(metadataTable, 0.9f); panel.setContent(vl); return panel; }
From source file:org.escidoc.browser.ui.maincontent.ContainerView.java
License:Open Source License
private VerticalLayout buildVlResourceProperties() { // common part: create layout VerticalLayout vlResourceProperties = new VerticalLayout(); vlResourceProperties.setImmediate(false); vlResourceProperties.setWidth("100.0%"); vlResourceProperties.setHeight("100.0%"); vlResourceProperties.setMargin(false); CssLayout cssLayout = new CssLayout(); cssLayout.setWidth("100%"); cssLayout.setHeight("100%"); // creating the properties / without the breadcrump createProperties(cssLayout);// w w w.j a va2s . com vlResourceProperties.addComponent(cssLayout); return vlResourceProperties; }
From source file:org.escidoc.browser.ui.maincontent.ItemContent.java
License:Open Source License
private void initView() { final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.COMPONENTS); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); if (true) {/*w ww.jav a 2 s. co m*/ final Button btnAddNew = new Button(); btnAddNew.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { Window modalWindow = new Window("Select a file to add."); modalWindow.setWidth("25%"); modalWindow.setHeight("20%"); modalWindow.setModal(true); modalWindow.addComponent(new ComponentUploadView(repositories, controller, itemProxy, ItemContent.this, mainWindow)); mainWindow.addWindow(modalWindow); } }); btnAddNew.setStyleName(BaseTheme.BUTTON_LINK); btnAddNew.addStyleName("floatright paddingtop3"); btnAddNew.setWidth("20px"); btnAddNew.setIcon(ICON); cssLayout.addComponent(btnAddNew); } verticalLayout.addComponent(cssLayout); wrap(verticalLayout); if (controller.hasComponents()) { verticalLayout.addComponent(buildTable()); } else { final Label lblNoComponents = new Label( "No components in this Item. You can drag n'drop some file from your computer to this box to add new components!"); lblNoComponents.setWidth("90%"); lblNoComponents.setStyleName("skybluetext"); verticalLayout.addComponent(lblNoComponents); } }
From source file:org.escidoc.browser.ui.maincontent.MetadataRecsItem.java
License:Open Source License
private Panel lblMetadaRecs() { pnl.setSizeFull();// w w w . j a va2 s .c o m VerticalLayout vl = new VerticalLayout(); vl.setSizeFull(); final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.METADATA); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); ItemMetadataTable metadataItem = new ItemMetadataTable(itemController, router, resourceProxy, repositories); metadataItem.buildTable(); if (itemController.hasAccess()) { final Button btnAddNew = new Button(); btnAddNew.addListener(new AddMetaDataFileItemBehaviour(mainWindow, repositories, resourceProxy)); btnAddNew.setStyleName(BaseTheme.BUTTON_LINK); btnAddNew.addStyleName("floatright paddingtop3"); btnAddNew.setWidth("20px"); btnAddNew.setIcon(ICON); cssLayout.addComponent(btnAddNew); } vl.addComponent(cssLayout); vl.addComponent(metadataItem); vl.setExpandRatio(metadataItem, 9f); pnl.setContent(vl); return pnl; }
From source file:org.escidoc.browser.ui.maincontent.OrgUnitMetadataRecordsView.java
License:Open Source License
@SuppressWarnings("serial") private Component buildMetaDataTab() { Panel innerPanel = new Panel(); innerPanel.setSizeFull();/*from w ww. ja v a 2s. c om*/ VerticalLayout vl = new VerticalLayout(); vl.setSizeFull(); final CssLayout cssLayout = new CssLayout(); cssLayout.setHeight("20px"); buildPanelHeader(cssLayout, ViewConstants.METADATA); ThemeResource ICON = new ThemeResource("images/assets/plus.png"); if (canAddMetadata()) { final Button addNewOrgUnitBtn = new Button(); addNewOrgUnitBtn.addListener(new Button.ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") ClickEvent event) { OnAddOrgUnitMetadata view = new OnAddOrgUnitMetadata(controller, router.getMainWindow()); view.showAddWindow(); } }); addNewOrgUnitBtn.setStyleName(BaseTheme.BUTTON_LINK); addNewOrgUnitBtn.addStyleName("floatright paddingtop3"); addNewOrgUnitBtn.setWidth("20px"); addNewOrgUnitBtn.setIcon(ICON); cssLayout.addComponent(addNewOrgUnitBtn); } vl.addComponent(cssLayout); OrgUnitMetadataTable metadataTable = new OrgUnitMetadataTable(orgUnit.getMetadataRecords(), controller, router); metadataTable.buildTable(); vl.addComponent(metadataTable); vl.setExpandRatio(metadataTable, 9); innerPanel.setContent(vl); return innerPanel; }