List of usage examples for com.vaadin.ui GridLayout GridLayout
public GridLayout(int columns, int rows)
From source file:gov.va.ehtac.appsonfhir.ui.FHIRChart.java
public FHIRChart() { session = ((HealthElementsTouchKitUI) UI.getCurrent()).getSessionAttributes(); setCaption("TriCare Portal"); //final VerticalComponentGroup vert = new VerticalComponentGroup(); GridLayout layout = new GridLayout(3, 2); layout.setMargin(true);//from w ww .java 2 s . c om layout.setWidth("80%"); layout.setHeight("100%"); Panel problemListPanel = getProblemList(); Panel medicationPanel = getMedications(); Panel encountersPanel = getEncounters(); Panel allergiesPanel = getAllergies(); Panel testsPanel = getTests(); Panel carePanel = getCarePlan(); layout.addComponent(problemListPanel, 0, 0); layout.setComponentAlignment(problemListPanel, Alignment.TOP_LEFT); layout.addComponent(medicationPanel, 1, 0); layout.setComponentAlignment(medicationPanel, Alignment.TOP_LEFT); layout.addComponent(encountersPanel, 2, 0); layout.setComponentAlignment(encountersPanel, Alignment.TOP_LEFT); layout.addComponent(allergiesPanel, 0, 1); layout.setComponentAlignment(allergiesPanel, Alignment.TOP_LEFT); layout.addComponent(testsPanel, 1, 1); layout.setComponentAlignment(testsPanel, Alignment.TOP_LEFT); layout.addComponent(carePanel, 2, 1); layout.setComponentAlignment(carePanel, Alignment.TOP_LEFT); //vert.addComponent(layout); setContent(new CssLayout(layout)); }
From source file:gov.va.ehtac.myappsonfhir.ui.FitnessWellness.java
private GridLayout getChartLayout() { getChartData(-6);/* ww w.j a v a2 s. c o m*/ Button b1 = new Button("See More"); Button b2 = new Button("See More"); Button b3 = new Button("See More"); Button b4 = new Button("See More"); b1.setImmediate(true); b2.setImmediate(true); b3.setImmediate(true); b4.setImmediate(true); b1.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { dRequest = "raw"; refresh(); } }); b2.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { dRequest = "raw"; refresh(); } }); b3.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { dRequest = "raw"; refresh(); } }); b4.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { dRequest = "raw"; refresh(); } }); GridLayout grid = new GridLayout(2, 2); grid.setMargin(true); grid.setWidth("100%"); Panel p1 = new Panel("Heart Rate Activity"); p1.setHeight("100px"); VerticalComponentGroup v = new VerticalComponentGroup(); //v.addComponent(hChart.getChart()); v.addComponent(hChart.getChart()); v.addComponent(b1); grid.addComponent(v, 0, 0); Panel p2 = new Panel("Distance - Miles"); p2.setHeight("100px"); VerticalComponentGroup v2 = new VerticalComponentGroup(); //v2.addComponent(dChart.getChart()); v2.addComponent(dChart.getChart(results)); v2.addComponent(b2); grid.addComponent(v2, 1, 0); Panel p3 = new Panel("Calories Burned"); p3.setHeight("100px"); VerticalComponentGroup v3 = new VerticalComponentGroup(); //v3.addComponent(cChart.getChart()); v3.addComponent(cChart.getChart(results)); v3.addComponent(b3); grid.addComponent(v3, 0, 1); Panel p4 = new Panel("Steps Taken"); p4.setHeight("100px"); VerticalComponentGroup v4 = new VerticalComponentGroup(); //v4.addComponent(sChart.getChart()); v4.addComponent(sChart.getChart(results)); v4.addComponent(b4); grid.addComponent(v4, 1, 1); return grid; }
From source file:io.subutai.plugin.accumulo.ui.manager.AddNodeWindow.java
public AddNodeWindow(final Accumulo accumulo, final ExecutorService executorService, final Tracker tracker, final AccumuloClusterConfig accumuloClusterConfig, Set<EnvironmentContainerHost> nodes, final NodeType nodeType) { super("Add New Node"); setModal(true);//from w w w . j a v a2 s . c om setWidth(650, Unit.PIXELS); setHeight(450, Unit.PIXELS); GridLayout content = new GridLayout(1, 3); content.setSizeFull(); content.setMargin(true); content.setSpacing(true); HorizontalLayout topContent = new HorizontalLayout(); topContent.setSpacing(true); content.addComponent(topContent); topContent.addComponent(new Label("Nodes:")); final ComboBox hadoopNodes = new ComboBox(); hadoopNodes.setId("HadoopNodesCb"); hadoopNodes.setImmediate(true); hadoopNodes.setTextInputAllowed(false); hadoopNodes.setNullSelectionAllowed(false); hadoopNodes.setRequired(true); hadoopNodes.setWidth(200, Unit.PIXELS); for (EnvironmentContainerHost node : nodes) { hadoopNodes.addItem(node); hadoopNodes.setItemCaption(node, node.getHostname()); } if (nodes.size() == 0) { return; } hadoopNodes.setValue(nodes.iterator().next()); topContent.addComponent(hadoopNodes); final Button addNodeBtn = new Button("Add"); addNodeBtn.setId("AddSelectedNode"); topContent.addComponent(addNodeBtn); final Button ok = new Button("Ok"); addNodeBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { addNodeBtn.setEnabled(false); ok.setEnabled(false); showProgress(); EnvironmentContainerHost containerHost = (EnvironmentContainerHost) hadoopNodes.getValue(); final UUID trackID = accumulo.addNode(accumuloClusterConfig.getClusterName(), containerHost.getHostname(), nodeType); executorService.execute(new Runnable() { public void run() { while (track) { TrackerOperationView po = tracker.getTrackerOperation(AccumuloClusterConfig.PRODUCT_KEY, trackID); if (po != null) { setOutput(po.getDescription() + "\nState: " + po.getState() + "\nLogs:\n" + po.getLog()); if (po.getState() != OperationState.RUNNING) { hideProgress(); ok.setEnabled(true); break; } } else { setOutput("Product operation not found. Check logs"); break; } try { Thread.sleep(1000); } catch (InterruptedException ex) { break; } } } }); } }); outputTxtArea = new TextArea("Operation output"); outputTxtArea.setId("outputTxtArea"); outputTxtArea.setRows(13); outputTxtArea.setColumns(43); outputTxtArea.setImmediate(true); outputTxtArea.setWordwrap(true); content.addComponent(outputTxtArea); indicator = new Label(); indicator.setId("indicator"); indicator.setIcon(new ThemeResource("img/spinner.gif")); indicator.setContentMode(ContentMode.HTML); indicator.setHeight(11, Unit.PIXELS); indicator.setWidth(50, Unit.PIXELS); indicator.setVisible(false); ok.setId("btnOk"); ok.setStyleName("default"); ok.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { //close window track = false; close(); } }); HorizontalLayout bottomContent = new HorizontalLayout(); bottomContent.addComponent(indicator); bottomContent.setComponentAlignment(indicator, Alignment.MIDDLE_RIGHT); bottomContent.addComponent(ok); content.addComponent(bottomContent); content.setComponentAlignment(bottomContent, Alignment.MIDDLE_RIGHT); setContent(content); }
From source file:io.subutai.plugin.accumulo.ui.wizard.VerificationStep.java
public VerificationStep(final Accumulo accumulo, final Hadoop hadoop, final ExecutorService executorService, final Tracker tracker, EnvironmentManager environmentManager, final Wizard wizard) { setSizeFull();//w w w . ja va 2 s .c o m GridLayout grid = new GridLayout(1, 5); grid.setSpacing(true); grid.setMargin(true); grid.setSizeFull(); Label confirmationLbl = new Label("<strong>Please verify the installation settings " + "(you may change them by clicking on Back button)</strong><br/>"); confirmationLbl.setContentMode(ContentMode.HTML); ConfigView cfgView = new ConfigView("Installation configuration"); cfgView.addStringCfg("Cluster Name", wizard.getConfig().getClusterName()); cfgView.addStringCfg("Instance name", wizard.getConfig().getInstanceName()); cfgView.addStringCfg("Password", wizard.getConfig().getPassword()); cfgView.addStringCfg("Hadoop cluster", wizard.getConfig().getHadoopClusterName()); cfgView.addStringCfg("Zookeeper cluster", wizard.getConfig().getZookeeperClusterName()); if (wizard.getConfig().getSetupType() == SetupType.OVER_HADOOP_N_ZK) { try { Environment hadoopEnvironment = environmentManager.loadEnvironment( hadoop.getCluster(wizard.getConfig().getHadoopClusterName()).getEnvironmentId()); EnvironmentContainerHost master = hadoopEnvironment .getContainerHostById(wizard.getConfig().getMasterNode()); EnvironmentContainerHost gc = hadoopEnvironment .getContainerHostById(wizard.getConfig().getGcNode()); EnvironmentContainerHost monitor = hadoopEnvironment .getContainerHostById(wizard.getConfig().getMonitor()); Set<EnvironmentContainerHost> tracers = hadoopEnvironment .getContainerHostsByIds(wizard.getConfig().getTracers()); Set<EnvironmentContainerHost> slaves = hadoopEnvironment .getContainerHostsByIds(wizard.getConfig().getSlaves()); cfgView.addStringCfg("Master node", master.getHostname()); cfgView.addStringCfg("GC node", gc.getHostname()); cfgView.addStringCfg("Monitor node", monitor.getHostname()); for (EnvironmentContainerHost containerHost : tracers) { cfgView.addStringCfg("Tracers", containerHost.getHostname()); } for (EnvironmentContainerHost containerHost : slaves) { cfgView.addStringCfg("Slaves", containerHost.getHostname()); } } catch (EnvironmentNotFoundException | ContainerHostNotFoundException e) { LOGGER.error("Error applying operations on environment/container", e); } } else { cfgView.addStringCfg("Number of Hadoop slaves", wizard.getHadoopClusterConfig().getCountOfSlaveNodes() + ""); cfgView.addStringCfg("Hadoop replication factor", wizard.getHadoopClusterConfig().getReplicationFactor() + ""); cfgView.addStringCfg("Hadoop domain name", wizard.getHadoopClusterConfig().getDomainName() + ""); cfgView.addStringCfg("Number of tracers", wizard.getConfig().getNumberOfTracers() + ""); cfgView.addStringCfg("Number of slaves", wizard.getConfig().getNumberOfSlaves() + ""); } Button install = new Button("Install"); install.setId("installBtn"); install.addStyleName("default"); install.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { UUID trackID; if (wizard.getConfig().getSetupType() == SetupType.OVER_HADOOP_N_ZK) { trackID = accumulo.installCluster(wizard.getConfig()); } else { trackID = accumulo.installCluster(wizard.getConfig()); } ProgressWindow window = new ProgressWindow(executorService, tracker, trackID, AccumuloClusterConfig.PRODUCT_KEY); window.getWindow().addCloseListener(new Window.CloseListener() { @Override public void windowClose(Window.CloseEvent closeEvent) { wizard.init(); } }); getUI().addWindow(window.getWindow()); } }); Button back = new Button("Back"); back.setId("verBack"); back.addStyleName("default"); back.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { wizard.back(); } }); HorizontalLayout buttons = new HorizontalLayout(); buttons.addComponent(back); buttons.addComponent(install); grid.addComponent(confirmationLbl, 0, 0); grid.addComponent(cfgView.getCfgTable(), 0, 1, 0, 3); grid.addComponent(buttons, 0, 4); setContent(grid); }
From source file:io.subutai.plugin.accumulo.ui.wizard.WelcomeStep.java
public WelcomeStep(final Wizard wizard) { setSizeFull();/*www .ja va 2s . co m*/ GridLayout grid = new GridLayout(10, 6); grid.setSpacing(true); grid.setMargin(true); grid.setSizeFull(); Label welcomeMsg = new Label("<center><h2>Welcome to Accumulo Installation Wizard!</h2>"); welcomeMsg.setContentMode(ContentMode.HTML); grid.addComponent(welcomeMsg, 3, 1, 6, 2); Label logoImg = new Label(); // Image as a file resource logoImg.setIcon(new FileResource(FileUtil.getFile(AccumuloPortalModule.MODULE_IMAGE, this))); logoImg.setContentMode(ContentMode.HTML); logoImg.setHeight(56, Unit.PIXELS); logoImg.setWidth(220, Unit.PIXELS); grid.addComponent(logoImg, 1, 3, 2, 5); Button startOverHadoopNZK = new Button("Start over Hadoop & ZK installation"); startOverHadoopNZK.setId("startOverHadoopNZK"); startOverHadoopNZK.addStyleName("default"); grid.addComponent(startOverHadoopNZK, 4, 4, 4, 4); grid.setComponentAlignment(startOverHadoopNZK, Alignment.BOTTOM_RIGHT); startOverHadoopNZK.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { wizard.init(); wizard.getConfig().setSetupType(SetupType.OVER_HADOOP_N_ZK); wizard.next(); } }); setContent(grid); }
From source file:io.subutai.plugin.accumulo.ui.wizard.Wizard.java
public Wizard(ExecutorService executorService, Accumulo accumulo, Hadoop hadoop, Zookeeper zookeeper, Tracker tracker, EnvironmentManager environmentManager) throws NamingException { this.executorService = executorService; this.accumulo = accumulo; this.hadoop = hadoop; this.zookeeper = zookeeper; this.tracker = tracker; this.environmentManager = environmentManager; grid = new GridLayout(1, 20); grid.setMargin(true);/*w w w . jav a2s .c o m*/ grid.setSizeFull(); putForm(); }
From source file:it.vige.greenarea.bpm.custom.ui.home.HomePage.java
License:Apache License
@Override protected void addMainLayout() { if (loginPageEnabled) { grid = new GridLayout(3, 3); grid.setColumnExpandRatio(0, .25f); grid.setColumnExpandRatio(1, .52f); grid.setColumnExpandRatio(2, .23f); } else {//from w ww. jav a2 s . c o m grid = new GridLayout(2, 3); grid.setColumnExpandRatio(0, .18f); grid.setColumnExpandRatio(1, .82f); } grid.addStyleName(SPLITPANEL_SMALL); grid.setSizeFull(); // Height division grid.setRowExpandRatio(2, 1.0f); setCompositionRoot(grid); }
From source file:kn.uni.gis.ui.DownloadWindow.java
License:Apache License
private Component downloadComponent() { GridLayout layout = new GridLayout(2, 2); String baseUrl = getApplication().getURL().toString(); StringBuilder b = new StringBuilder(getApplication().getURL().toString()); b.replace(baseUrl.lastIndexOf("ui"), baseUrl.lastIndexOf("ui") + 2, "game"); QRCode code = new QRCode("", b.toString()); layout.addComponent(code);//from w w w .jav a2 s . c o m return layout; }
From source file:life.qbic.components.qOfferManager.java
License:Open Source License
private void init() { DBManager.setCredentials();/*from ww w.jav a 2s .c om*/ DBManager.getDatabaseInstance(); db = Database.Instance; managerTabs = new TabSheet(); /* System.out.println(ft.format(dNow) + " INFO Offer Manager accessed! - User: " + LiferayAndVaadinUtils.getUser().getScreenName());*/ managerTabs.addStyleName(ValoTheme.TABSHEET_FRAMED); managerTabs.addStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS); final GridLayout gridLayout = new GridLayout(6, 6); gridLayout.setMargin(true); gridLayout.setSpacing(true); try { managerTabs.addTab(createOfferGeneratorTab(), "Offer Generator"); managerTabs.addTab(createOfferManagerTab(), "Offer Manager"); managerTabs.addTab(createPackageManagerTab(), "Package Manager"); managerTabs.setSelectedTab(1); // show the offer manager first, since this will probably be mostly in use // TODO: make this more elegant // if one changes the tab e.g. from the offer manager to the package manager, creates a new package and goes // back to the offer manager tab, the package won't be updated -> workaround: // since the selected offer in the offer manager grid won't requery the database for the information needed, we // deselect the current offer (if any has been selected), so the user has to select the offer again -> information // for the database is queried again and e.g. the newly created packages are shown properly) managerTabs.addSelectedTabChangeListener((TabSheet.SelectedTabChangeListener) event -> { OfferManagerTab.getOfferManagerGrid().deselectAll(); OfferManagerTab.getDetailsLayout().removeAllComponents(); }); } catch (SQLException e1) { e1.printStackTrace(); } try { gridLayout.addComponent(managerTabs, 0, 1, 5, 1); } catch (OverlapsException | OutOfBoundsException e) { e.printStackTrace(); } gridLayout.setSizeFull(); setCompositionRoot(gridLayout); }
From source file:lu.uni.lassy.excalibur.examples.icrash.dev.web.java.views.AdminAuthView.java
License:Open Source License
public AdminAuthView() { setSizeFull();// w w w . j a v a2 s .c om VerticalLayout header = new VerticalLayout(); header.setSizeFull(); HorizontalLayout content = new HorizontalLayout(); content.setSizeFull(); addComponents(header, content); setExpandRatio(header, 1); setExpandRatio(content, 6); welcomeText.setValue("<h1>Welcome to the iCrash Administrator console!</h1>"); welcomeText.setContentMode(ContentMode.HTML); welcomeText.setSizeUndefined(); header.addComponent(welcomeText); header.setComponentAlignment(welcomeText, Alignment.MIDDLE_CENTER); Panel controlPanel = new Panel("Administrator control panel"); controlPanel.setSizeUndefined(); Panel addCoordPanel = new Panel("Create a new coordinator"); addCoordPanel.setSizeUndefined(); Panel messagesPanel = new Panel("Administrator messages"); messagesPanel.setWidth("580px"); Table adminMessagesTable = new Table(); adminMessagesTable.setContainerDataSource(actAdmin.getMessagesDataSource()); adminMessagesTable.setColumnWidth("inputEvent", 180); adminMessagesTable.setSizeFull(); VerticalLayout controlLayout = new VerticalLayout(controlPanel); controlLayout.setSizeFull(); controlLayout.setMargin(false); controlLayout.setComponentAlignment(controlPanel, Alignment.TOP_CENTER); VerticalLayout coordOperationsLayout = new VerticalLayout(addCoordPanel); coordOperationsLayout.setSizeFull(); coordOperationsLayout.setMargin(false); coordOperationsLayout.setComponentAlignment(addCoordPanel, Alignment.TOP_CENTER); /******************************************/ coordOperationsLayout.setVisible(true); // main layout in the middle addCoordPanel.setVisible(false); // ...which contains the panel "Create a new coordinator" /******************************************/ HorizontalLayout messagesExternalLayout = new HorizontalLayout(messagesPanel); VerticalLayout messagesInternalLayout = new VerticalLayout(adminMessagesTable); messagesExternalLayout.setSizeFull(); messagesExternalLayout.setMargin(false); messagesExternalLayout.setComponentAlignment(messagesPanel, Alignment.TOP_CENTER); messagesInternalLayout.setMargin(false); messagesInternalLayout.setSizeFull(); messagesInternalLayout.setComponentAlignment(adminMessagesTable, Alignment.TOP_CENTER); messagesPanel.setContent(messagesInternalLayout); TextField idCoordAdd = new TextField(); TextField loginCoord = new TextField(); PasswordField pwdCoord = new PasswordField(); Label idCaptionAdd = new Label("ID"); Label loginCaption = new Label("Login"); Label pwdCaption = new Label("Password"); idCaptionAdd.setSizeUndefined(); idCoordAdd.setSizeUndefined(); loginCaption.setSizeUndefined(); loginCoord.setSizeUndefined(); pwdCaption.setSizeUndefined(); pwdCoord.setSizeUndefined(); Button validateNewCoord = new Button("Validate"); validateNewCoord.setClickShortcut(KeyCode.ENTER); validateNewCoord.setStyleName(ValoTheme.BUTTON_PRIMARY); GridLayout addCoordinatorLayout = new GridLayout(2, 4); addCoordinatorLayout.setSpacing(true); addCoordinatorLayout.setMargin(true); addCoordinatorLayout.setSizeFull(); addCoordinatorLayout.addComponents(idCaptionAdd, idCoordAdd, loginCaption, loginCoord, pwdCaption, pwdCoord); addCoordinatorLayout.addComponent(validateNewCoord, 1, 3); addCoordinatorLayout.setComponentAlignment(idCaptionAdd, Alignment.MIDDLE_LEFT); addCoordinatorLayout.setComponentAlignment(idCoordAdd, Alignment.MIDDLE_LEFT); addCoordinatorLayout.setComponentAlignment(loginCaption, Alignment.MIDDLE_LEFT); addCoordinatorLayout.setComponentAlignment(loginCoord, Alignment.MIDDLE_LEFT); addCoordinatorLayout.setComponentAlignment(pwdCaption, Alignment.MIDDLE_LEFT); addCoordinatorLayout.setComponentAlignment(pwdCoord, Alignment.MIDDLE_LEFT); addCoordPanel.setContent(addCoordinatorLayout); content.addComponents(controlLayout, coordOperationsLayout, messagesExternalLayout); content.setComponentAlignment(messagesExternalLayout, Alignment.TOP_CENTER); content.setComponentAlignment(controlLayout, Alignment.TOP_CENTER); content.setComponentAlignment(messagesExternalLayout, Alignment.TOP_CENTER); content.setExpandRatio(controlLayout, 20); content.setExpandRatio(coordOperationsLayout, 10); content.setExpandRatio(messagesExternalLayout, 28); Button addCoordinator = new Button("Add coordinator"); Button deleteCoordinator = new Button("Delete coordinator"); addCoordinator.addStyleName(ValoTheme.BUTTON_HUGE); deleteCoordinator.addStyleName(ValoTheme.BUTTON_HUGE); logoutBtn.addStyleName(ValoTheme.BUTTON_HUGE); VerticalLayout buttons = new VerticalLayout(); buttons.setMargin(true); buttons.setSpacing(true); buttons.setSizeFull(); buttons.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); controlPanel.setContent(buttons); buttons.addComponents(addCoordinator, deleteCoordinator, logoutBtn); /******* DELETE COORDINATOR PANEL BEGIN *********/ Label idCaptionDel = new Label("ID"); TextField idCoordDel = new TextField(); Panel delCoordPanel = new Panel("Delete a coordinator"); coordOperationsLayout.addComponent(delCoordPanel); delCoordPanel.setVisible(false); coordOperationsLayout.setComponentAlignment(delCoordPanel, Alignment.TOP_CENTER); delCoordPanel.setSizeUndefined(); GridLayout delCoordinatorLayout = new GridLayout(2, 2); delCoordinatorLayout.setSpacing(true); delCoordinatorLayout.setMargin(true); delCoordinatorLayout.setSizeFull(); Button deleteCoordBtn = new Button("Delete"); deleteCoordBtn.setClickShortcut(KeyCode.ENTER); deleteCoordBtn.setStyleName(ValoTheme.BUTTON_PRIMARY); delCoordinatorLayout.addComponents(idCaptionDel, idCoordDel); delCoordinatorLayout.addComponent(deleteCoordBtn, 1, 1); delCoordinatorLayout.setComponentAlignment(idCaptionDel, Alignment.MIDDLE_LEFT); delCoordinatorLayout.setComponentAlignment(idCoordDel, Alignment.MIDDLE_LEFT); delCoordPanel.setContent(delCoordinatorLayout); /******* DELETE COORDINATOR PANEL END *********/ /************************************************* MAIN BUTTONS LOGIC BEGIN *************************************************/ addCoordinator.addClickListener(event -> { if (!addCoordPanel.isVisible()) { delCoordPanel.setVisible(false); addCoordPanel.setVisible(true); idCoordAdd.focus(); } else addCoordPanel.setVisible(false); }); deleteCoordinator.addClickListener(event -> { if (!delCoordPanel.isVisible()) { addCoordPanel.setVisible(false); delCoordPanel.setVisible(true); idCoordDel.focus(); } else delCoordPanel.setVisible(false); }); /************************************************* MAIN BUTTONS LOGIC END *************************************************/ /************************************************* ADD COORDINATOR FORM LOGIC BEGIN *************************************************/ validateNewCoord.addClickListener(event -> { String currentURL = Page.getCurrent().getLocation().toString(); int strIndexCreator = currentURL.lastIndexOf(AdministratorLauncher.adminPageName); String iCrashURL = currentURL.substring(0, strIndexCreator); String googleShebang = "#!"; String coordURL = iCrashURL + CoordinatorServlet.coordinatorsName + googleShebang; try { sys.oeAddCoordinator(new DtCoordinatorID(new PtString(idCoordAdd.getValue())), new DtLogin(new PtString(loginCoord.getValue())), new DtPassword(new PtString(pwdCoord.getValue()))); // open new browser tab with the newly created coordinator console... // "_blank" instructs the browser to open a new tab instead of a new window... // unhappily not all browsers interpret it correctly, // some versions of some browsers might still open a new window instead (notably Firefox)! Page.getCurrent().open(coordURL + idCoordAdd.getValue(), "_blank"); } catch (Exception e) { e.printStackTrace(); } idCoordAdd.setValue(""); loginCoord.setValue(""); pwdCoord.setValue(""); idCoordAdd.focus(); }); /************************************************* ADD COORDINATOR FORM LOGIC END *************************************************/ /************************************************* DELETE COORDINATOR FORM LOGIC BEGIN *************************************************/ deleteCoordBtn.addClickListener(event -> { IcrashSystem sys = IcrashSystem.getInstance(); try { sys.oeDeleteCoordinator(new DtCoordinatorID(new PtString(idCoordDel.getValue()))); } catch (Exception e) { e.printStackTrace(); } idCoordDel.setValue(""); idCoordDel.focus(); }); /************************************************* DELETE COORDINATOR FORM LOGIC END *************************************************/ }