List of usage examples for com.vaadin.ui VerticalLayout setSizeFull
@Override public void setSizeFull()
From source file:info.magnolia.ui.mediaeditor.field.image.ImageMediaField.java
License:Open Source License
@Override protected Component initContent() { addStyleName("image-media-field"); setSizeFull();/*from ww w. j a va 2 s. c om*/ VerticalLayout mediaContentWrapper = new VerticalLayout(); mediaContentWrapper.addStyleName("media-wrapper"); mediaContentWrapper.setSizeFull(); fieldComponent = createImage(); mediaContentWrapper.addComponent(fieldComponent); mediaContentWrapper.setComponentAlignment(fieldComponent, Alignment.MIDDLE_CENTER); return mediaContentWrapper; }
From source file:io.subutai.plugin.accumulo.ui.AccumuloComponent.java
public AccumuloComponent(ExecutorService executorService, Accumulo accumulo, Hadoop hadoop, Zookeeper zookeeper, Tracker tracker, EnvironmentManager environmentManager) throws NamingException { setSizeFull();//from www .jav a 2s .c om VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSpacing(true); verticalLayout.setSizeFull(); TabSheet sheet = new TabSheet(); sheet.setSizeFull(); final Manager manager = new Manager(executorService, accumulo, hadoop, zookeeper, tracker, environmentManager); Wizard wizard = new Wizard(executorService, accumulo, hadoop, zookeeper, tracker, environmentManager); sheet.addTab(wizard.getContent(), "Install"); sheet.getTab(0).setId("AccumuloInstallTab"); sheet.addTab(manager.getContent(), "Manage"); sheet.getTab(1).setId("AccumuloManageTab"); sheet.addSelectedTabChangeListener(new TabSheet.SelectedTabChangeListener() { @Override public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) { TabSheet tabsheet = event.getTabSheet(); String caption = tabsheet.getTab(event.getTabSheet().getSelectedTab()).getCaption(); if (caption.equals("Manage")) { manager.refreshClustersInfo(); } } }); verticalLayout.addComponent(sheet); setCompositionRoot(verticalLayout); manager.refreshClustersInfo(); }
From source file:io.subutai.plugin.accumulo.ui.wizard.ConfigurationStep.java
public ConfigurationStep(final Accumulo accumulo, final Hadoop hadoop, final Zookeeper zookeeper, final EnvironmentManager environmentManager, final Wizard wizard) { this.environmentManager = environmentManager; this.wizard = wizard; this.hadoop = hadoop; this.zookeeper = zookeeper; this.accumulo = accumulo; if (wizard.getConfig().getSetupType() == SetupType.OVER_HADOOP_N_ZK) { //hadoop combo final ComboBox hadoopClustersCombo = getCombo("Hadoop cluster"); hadoopClustersCombo.setId("hadoopClusterscb"); //zookeeper combo final ComboBox zkClustersCombo = getCombo("Zookeeper cluster"); zkClustersCombo.setId("zkClustersCombo"); //master nodes final ComboBox masterNodeCombo = getCombo("Master node"); masterNodeCombo.setId("masterNodeCombo"); final ComboBox gcNodeCombo = getCombo("GC node"); gcNodeCombo.setId("gcNodeCombo"); final ComboBox monitorNodeCombo = getCombo("Monitor node"); monitorNodeCombo.setId("monitorNodeCombo"); //accumulo init controls TextField clusterNameTxtFld = getTextField("Cluster name", "Cluster name", 20); clusterNameTxtFld.setId("clusterNameTxtFld"); TextField instanceNameTxtFld = getTextField("Instance name", "Instance name", 20); instanceNameTxtFld.setId("instanceNameTxtFld"); TextField passwordTxtFld = getTextField("Password", "Password", 20); passwordTxtFld.setId("passwordTxtFld"); //tracers final TwinColSelect tracersSelect = getTwinSelect("Tracers", "hostname", "Available Nodes", "Selected Nodes", 4); tracersSelect.setId("TracersSelect"); //slave nodes final TwinColSelect slavesSelect = getTwinSelect("Slaves", "hostname", "Available Nodes", "Selected Nodes", 4); slavesSelect.setId("SlavesSelect"); //get existing hadoop clusters List<HadoopClusterConfig> hadoopClusters = hadoop.getClusters(); //fill hadoopClustersCombo with hadoop cluster infos for (HadoopClusterConfig hadoopClusterInfo : hadoopClusters) { hadoopClustersCombo.addItem(hadoopClusterInfo); hadoopClustersCombo.setItemCaption(hadoopClusterInfo, hadoopClusterInfo.getClusterName()); }// www . j a v a 2 s . c om //try to find hadoop cluster info based on one saved in the configuration if (wizard.getConfig().getHadoopClusterName() != null) { hadoop.getCluster(wizard.getConfig().getHadoopClusterName()); } //select if saved found if (!hadoopClusters.isEmpty()) { //select first one if saved not found hadoopClustersCombo.setValue(hadoopClusters.iterator().next()); fillZookeeperComboBox(zkClustersCombo, zookeeper, hadoopClusters.iterator().next().getEnvironmentId()); } // fill selection controls with hadoop nodes if (hadoopClustersCombo.getValue() != null) { HadoopClusterConfig hadoopInfo = (HadoopClusterConfig) hadoopClustersCombo.getValue(); wizard.getConfig().setHadoopClusterName(hadoopInfo.getClusterName()); setComboDS(masterNodeCombo, hadoopInfo.getAllNodes(), new HashSet<String>()); setComboDS(gcNodeCombo, hadoopInfo.getAllNodes(), new HashSet<String>()); setComboDS(monitorNodeCombo, hadoopInfo.getAllNodes(), new HashSet<String>()); setTwinSelectDS(tracersSelect, getSlaveContainerHosts(Sets.newHashSet(hadoopInfo.getAllNodes()))); setTwinSelectDS(slavesSelect, getSlaveContainerHosts(Sets.newHashSet(hadoopInfo.getAllNodes()))); } //on hadoop cluster change reset all controls and config hadoopClustersCombo.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { if (event.getProperty().getValue() != null) { HadoopClusterConfig hadoopInfo = (HadoopClusterConfig) event.getProperty().getValue(); //reset relevant controls setComboDS(masterNodeCombo, hadoopInfo.getAllNodes(), new HashSet<String>()); setComboDS(gcNodeCombo, hadoopInfo.getAllNodes(), new HashSet<String>()); setComboDS(monitorNodeCombo, hadoopInfo.getAllNodes(), new HashSet<String>()); setTwinSelectDS(tracersSelect, getSlaveContainerHosts(Sets.newHashSet(hadoopInfo.getAllNodes()))); setTwinSelectDS(slavesSelect, getSlaveContainerHosts(Sets.newHashSet(hadoopInfo.getAllNodes()))); //reset relevant properties wizard.getConfig().setMasterNode(null); wizard.getConfig().setGcNode(null); wizard.getConfig().setMonitor(null); wizard.getConfig().setTracers(null); wizard.getConfig().setSlaves(null); wizard.getConfig().setHadoopClusterName(hadoopInfo.getClusterName()); fillZookeeperComboBox(zkClustersCombo, zookeeper, hadoopInfo.getEnvironmentId()); } } }); //restore master node if back button is pressed if (wizard.getConfig().getMasterNode() != null) { masterNodeCombo.setValue(wizard.getConfig().getMasterNode()); } //restore gc node if back button is pressed if (wizard.getConfig().getGcNode() != null) { gcNodeCombo.setValue(wizard.getConfig().getGcNode()); } //restore monitor node if back button is pressed if (wizard.getConfig().getMonitor() != null) { monitorNodeCombo.setValue(wizard.getConfig().getMonitor()); } //add value change handler masterNodeCombo.addValueChangeListener(new Property.ValueChangeListener() { public void valueChange(Property.ValueChangeEvent event) { if (event.getProperty().getValue() != null) { String masterNode = (String) event.getProperty().getValue(); wizard.getConfig().setMasterNode(masterNode); } } }); //add value change handler gcNodeCombo.addValueChangeListener(new Property.ValueChangeListener() { public void valueChange(Property.ValueChangeEvent event) { if (event.getProperty().getValue() != null) { String gcNode = (String) event.getProperty().getValue(); wizard.getConfig().setGcNode(gcNode); } } }); //add value change handler monitorNodeCombo.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { if (event.getProperty().getValue() != null) { String monitor = (String) event.getProperty().getValue(); wizard.getConfig().setMonitor(monitor); } } }); //restore tracers if back button is pressed if (!CollectionUtil.isCollectionEmpty(wizard.getConfig().getTracers())) { tracersSelect.setValue(wizard.getConfig().getTracers()); } //restore slaves if back button is pressed if (!CollectionUtil.isCollectionEmpty(wizard.getConfig().getSlaves())) { slavesSelect.setValue(wizard.getConfig().getSlaves()); } clusterNameTxtFld.setValue(wizard.getConfig().getInstanceName()); clusterNameTxtFld.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { wizard.getConfig().setClusterName(event.getProperty().getValue().toString().trim()); } }); instanceNameTxtFld.setValue(wizard.getConfig().getInstanceName()); instanceNameTxtFld.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { wizard.getConfig().setInstanceName(event.getProperty().getValue().toString().trim()); } }); passwordTxtFld.setValue(wizard.getConfig().getPassword()); passwordTxtFld.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { wizard.getConfig().setPassword(event.getProperty().getValue().toString().trim()); } }); //add value change handler tracersSelect.addValueChangeListener(new Property.ValueChangeListener() { public void valueChange(Property.ValueChangeEvent event) { if (event.getProperty().getValue() != null) { Set<String> nodes = new HashSet<>(); Set<EnvironmentContainerHost> nodeList = (Set<EnvironmentContainerHost>) event.getProperty() .getValue(); for (EnvironmentContainerHost host : nodeList) { nodes.add(host.getId()); } wizard.getConfig().setTracers(nodes); } } }); //add value change handler slavesSelect.addValueChangeListener(new Property.ValueChangeListener() { public void valueChange(Property.ValueChangeEvent event) { if (event.getProperty().getValue() != null) { Set<String> nodes = new HashSet<>(); Set<EnvironmentContainerHost> nodeList = (Set<EnvironmentContainerHost>) event.getProperty() .getValue(); for (EnvironmentContainerHost host : nodeList) { nodes.add(host.getId()); } wizard.getConfig().setSlaves(nodes); } } }); Button next = new Button("Next"); next.setId("confNext2"); next.addStyleName("default"); //check valid configuration next.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { if (Strings.isNullOrEmpty(wizard.getConfig().getClusterName())) { show("Please, enter cluster name"); } else if (Strings.isNullOrEmpty(wizard.getConfig().getZookeeperClusterName())) { show("Please, select Zookeeper cluster"); } else if (Strings.isNullOrEmpty(wizard.getConfig().getHadoopClusterName())) { show("Please, select Hadoop cluster"); } else if (wizard.getConfig().getMasterNode() == null) { show("Please, select master node"); } else if (Strings.isNullOrEmpty(wizard.getConfig().getInstanceName())) { show("Please, specify instance name"); } else if (Strings.isNullOrEmpty(wizard.getConfig().getPassword())) { show("Please, specify password"); } else if (wizard.getConfig().getGcNode() == null) { show("Please, select gc node"); } else if (wizard.getConfig().getMonitor() == null) { show("Please, select monitor"); } else if (CollectionUtil.isCollectionEmpty(wizard.getConfig().getTracers())) { show("Please, select tracer(s)"); } else if (CollectionUtil.isCollectionEmpty(wizard.getConfig().getSlaves())) { show("Please, select slave(s)"); } else { wizard.next(); } } }); Button back = new Button("Back"); back.setId("confBack2"); back.addStyleName("default"); back.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { wizard.back(); } }); setSizeFull(); VerticalLayout content = new VerticalLayout(); content.setSizeFull(); content.setSpacing(true); content.setMargin(true); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.addComponent(new Label("Please, specify installation settings")); layout.addComponent(content); HorizontalLayout masters = new HorizontalLayout(); masters.setMargin(new MarginInfo(true, false, false, false)); masters.setSpacing(true); masters.addComponent(hadoopClustersCombo); masters.addComponent(zkClustersCombo); masters.addComponent(masterNodeCombo); masters.addComponent(gcNodeCombo); masters.addComponent(monitorNodeCombo); HorizontalLayout credentials = new HorizontalLayout(); credentials.setMargin(new MarginInfo(true, false, false, false)); credentials.setSpacing(true); credentials.addComponent(clusterNameTxtFld); credentials.addComponent(instanceNameTxtFld); credentials.addComponent(passwordTxtFld); HorizontalLayout buttons = new HorizontalLayout(); buttons.setMargin(new MarginInfo(true, false, false, false)); buttons.setSpacing(true); buttons.addComponent(back); buttons.addComponent(next); content.addComponent(masters); content.addComponent(credentials); content.addComponent(tracersSelect); content.addComponent(slavesSelect); content.addComponent(buttons); setContent(layout); } }
From source file:jp.primecloud.auto.ui.LoadBalancerPanel.java
License:Open Source License
@Override public void attach() { setSizeFull();//from ww w . j a v a 2 s . 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.MainMenu.java
License:Open Source License
MainMenu(final Window mainWindow) { this.mainWindow = mainWindow; VerticalLayout layout = (VerticalLayout) getContent(); setSizeFull();//from w ww .j a va 2 s . c o m setStyleName("mainmenu"); addStyleName(Reindeer.PANEL_LIGHT); layout.setMargin(false); layout.setSpacing(true); layout.setSizeFull(); tree.setNullSelectionAllowed(false); final String[][] menus = new String[][] { new String[] { "MyCloud", "New", "Manage" }, new String[] { "Cloud?", "" } }; for (int i = 0; i < menus.length; i++) { String planet = (menus[i][0]); tree.addItem(planet); if (menus[i].length == 1) { // The planet has no moons so make it a leaf. tree.setChildrenAllowed(planet, false); } else { // Add children (moons) under the planets. for (int j = 1; j < menus[i].length; j++) { String moon = menus[i][j]; // Add the item as a regular item. tree.addItem(moon); // Set it to be a child. tree.setParent(moon, planet); // Make the moons look like leaves. tree.setChildrenAllowed(moon, false); } // Expand the subtree. tree.expandItemsRecursively(planet); } } layout.addComponent(tree); // VerticalLayout adlayout = new VerticalLayout(); adlayout.setSpacing(false); adlayout.setMargin(false); Label ad1 = new Label( "<a href='http://www.csk.com/systems/services/technology/index.html' target='_blank'><img width='147' alt='????' src='./VAADIN/themes/classy/images/technology_ttl.jpg'></a>"); ad1.setContentMode(Label.CONTENT_XHTML); adlayout.addComponent(ad1); Label ad2 = new Label( "<a href='http://www.csk.com/systems/services/technology/technology01.html' target='_blank'><img width='147' alt='??????????' src='./VAADIN/themes/classy/images/technology_menu1.jpg'></a>"); ad2.setContentMode(Label.CONTENT_XHTML); adlayout.addComponent(ad2); Label ad3 = new Label( "<a href='http://www.csk.com/systems/services/technology/technology02.html' target='_blank'><img width='147' alt='?????' src='./VAADIN/themes/classy/images/technology_menu2.jpg'></a>"); ad3.setContentMode(Label.CONTENT_XHTML); adlayout.addComponent(ad3); Label ad4 = new Label( "<a href='http://www.csk.com/systems/services/technology/technology03.html' target='_blank'><img width='147' alt='' src='./VAADIN/themes/classy/images/technology_menu3.jpg'></a>"); ad4.setContentMode(Label.CONTENT_XHTML); adlayout.addComponent(ad4); layout.addComponent(adlayout); layout.setComponentAlignment(adlayout, Alignment.MIDDLE_CENTER); // ?? ItemClickEvent.ItemClickListener listener = new ItemClickEvent.ItemClickListener() { @Override public void itemClick(ItemClickEvent event) { String click = (String) event.getItemId(); if ("Manage".equals(click)) { showCloudEditWindow(); } else if ("New".equals(click)) { showCloudAddWindow(); } else if ("".equals(click)) { String url = Config.getProperty("zabbix.url"); mainWindow.open(new ExternalResource(url), "_blank"); } } }; tree.addListener(listener); // ??? showFirst(); }
From source file:jp.primecloud.auto.ui.MainView.java
License:Open Source License
@Override public void attach() { setSizeFull();/*w ww . j ava 2 s .co 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.MyCloudTabs.java
License:Open Source License
MyCloudTabs() { // ??//*from w ww . j av a 2 s .c o 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:jp.primecloud.auto.ui.ServerPanel.java
License:Open Source License
@Override public void attach() { setSizeFull();/* w w w .ja v a 2 s .c om*/ addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("server-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); serverButtonsTop = new ServerButtonsTop(sender); upperLayout.addComponent(serverButtonsTop); serverTable = new ServerTable(sender); serverTable.setContainerDataSource(new InstanceDtoContainer()); upperLayout.addComponent(serverTable); serverTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); serverButtonsBottom = new ServerButtonsBottom(sender); upperLayout.addComponent(serverButtonsBottom); upperLayout.setExpandRatio(serverTable, 10); splitPanel.addComponent(upperLayout); // ? serverDesc = new ServerDesc(sender); splitPanel.addComponent(serverDesc); }
From source file:jp.primecloud.auto.ui.ServicePanel.java
License:Open Source License
@Override public void attach() { setSizeFull();// w w w . j av a 2 s.co m addStyleName(Reindeer.PANEL_LIGHT); VerticalLayout layout = (VerticalLayout) getContent(); layout.setSizeFull(); layout.addStyleName("service-tab"); layout.setSpacing(false); layout.setMargin(false); // ? SplitPanel splitPanel = new SplitPanel(); splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL); splitPanel.setSplitPosition(40); splitPanel.setSizeFull(); layout.addComponent(splitPanel); layout.setExpandRatio(splitPanel, 10); // ? VerticalLayout upperLayout = new VerticalLayout(); upperLayout.setSizeFull(); upperLayout.setSpacing(false); upperLayout.setMargin(false); serviceButtonsTop = new ServiceButtonsTop(sender); upperLayout.addComponent(serviceButtonsTop); serviceTable = new ServiceTable(sender); serviceTable.setContainerDataSource(new ComponentDtoContainer()); upperLayout.addComponent(serviceTable); serviceTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { tableRowSelected(event); } }); serviceButtonsBottom = new ServiceButtonsBottom(sender); upperLayout.addComponent(serviceButtonsBottom); upperLayout.setExpandRatio(serviceTable, 10); splitPanel.addComponent(upperLayout); // ? serviceDesc = new ServiceDesc(sender); splitPanel.addComponent(serviceDesc); }
From source file:kn.uni.gis.ui.GameApplication.java
License:Apache License
@Override public void init() { window = new Window("Fox and Hunter - Der Kohl sei mit euch!"); setMainWindow(window);//from ww w . ja v a2 s . c o m VerticalLayout verticalLayout = new VerticalLayout(); map = getMap(); window.setContent(verticalLayout); verticalLayout.setSizeFull(); verticalLayout.addComponent(map); verticalLayout.setExpandRatio(map, 1); window.addWindow(createGameWindow()); window.addWindow(createDownloadWindow()); pi.setIndeterminate(true); pi.setPollingInterval(1000 / FPS); pi.setVisible(false); }