List of usage examples for com.vaadin.ui VerticalLayout setSpacing
@Override public void setSpacing(boolean spacing)
From source file:com.skysql.manager.ui.GeneralSettings.java
License:Open Source License
/** * Time layout.// w w w. j a va 2 s .co m * * @return the vertical layout */ private VerticalLayout timeLayout() { VerticalLayout layout = new VerticalLayout(); layout.setWidth("100%"); layout.setSpacing(true); layout.setMargin(new MarginInfo(false, true, false, true)); HorizontalLayout titleLayout = new HorizontalLayout(); titleLayout.setSpacing(true); layout.addComponent(titleLayout); final Label title = new Label("<h3>Date & Time Presentation</h3>", ContentMode.HTML); title.setSizeUndefined(); titleLayout.addComponent(title); Embedded info = new Embedded(null, new ThemeResource("img/info.png")); info.addStyleName("infoButton"); info.setDescription( "Determines if date & time stamps are displayed in the originally recorded format or adjusted to the local timezone.<br/>The format can be customized by using the following Java 6 SimpleDateFormat patterns:" + "</blockquote>" + " <table border=0 cellspacing=3 cellpadding=0 summary=\"Chart shows pattern letters, date/time component, presentation, and examples.\">\n" + " <tr bgcolor=\"#ccccff\">\n" + " <th align=left>Letter\n" + " <th align=left>Date or Time Component\n" + " <th align=left>Presentation\n" + " <th align=left>Examples\n" + " <tr>\n" + " <td><code>G</code>\n" + " <td>Era designator\n" + " <td><a href=\"#text\">Text</a>\n" + " <td><code>AD</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>y</code>\n" + " <td>Year\n" + " <td><a href=\"#year\">Year</a>\n" + " <td><code>1996</code>; <code>96</code>\n" + " <tr>\n" + " <td><code>M</code>\n" + " <td>Month in year\n" + " <td><a href=\"#month\">Month</a>\n" + " <td><code>July</code>; <code>Jul</code>; <code>07</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>w</code>\n" + " <td>Week in year\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>27</code>\n" + " <tr>\n" + " <td><code>W</code>\n" + " <td>Week in month\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>2</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>D</code>\n" + " <td>Day in year\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>189</code>\n" + " <tr>\n" + " <td><code>d</code>\n" + " <td>Day in month\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>10</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>F</code>\n" + " <td>Day of week in month\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>2</code>\n" + " <tr>\n" + " <td><code>E</code>\n" + " <td>Day in week\n" + " <td><a href=\"#text\">Text</a>\n" + " <td><code>Tuesday</code>; <code>Tue</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>a</code>\n" + " <td>Am/pm marker\n" + " <td><a href=\"#text\">Text</a>\n" + " <td><code>PM</code>\n" + " <tr>\n" + " <td><code>H</code>\n" + " <td>Hour in day (0-23)\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>0</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>k</code>\n" + " <td>Hour in day (1-24)\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>24</code>\n" + " <tr>\n" + " <td><code>K</code>\n" + " <td>Hour in am/pm (0-11)\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>0</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>h</code>\n" + " <td>Hour in am/pm (1-12)\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>12</code>\n" + " <tr>\n" + " <td><code>m</code>\n" + " <td>Minute in hour\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>30</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>s</code>\n" + " <td>Second in minute\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>55</code>\n" + " <tr>\n" + " <td><code>S</code>\n" + " <td>Millisecond\n" + " <td><a href=\"#number\">Number</a>\n" + " <td><code>978</code>\n" + " <tr bgcolor=\"#eeeeff\">\n" + " <td><code>z</code>\n" + " <td>Time zone\n" + " <td><a href=\"#timezone\">General time zone</a>\n" + " <td><code>Pacific Standard Time</code>; <code>PST</code>; <code>GMT-08:00</code>\n" + " <tr>\n" + " <td><code>Z</code>\n" + " <td>Time zone\n" + " <td><a href=\"#rfc822timezone\">RFC 822 time zone</a>\n" + " <td><code>-0800</code>\n" + " </table>\n" + " </blockquote>\n" + ""); titleLayout.addComponent(info); titleLayout.setComponentAlignment(info, Alignment.MIDDLE_CENTER); final DateConversion dateConversion = VaadinSession.getCurrent().getAttribute(DateConversion.class); OptionGroup option = new OptionGroup("Display options"); option.addItem(false); option.setItemCaption(false, "Show time in UTC/GMT"); option.addItem(true); option.setItemCaption(true, "Adjust to local timezone (" + dateConversion.getClientTZname() + ")"); String propertyTimeAdjust = userObject.getProperty(UserObject.PROPERTY_TIME_ADJUST); option.select(propertyTimeAdjust == null ? DEFAULT_TIME_ADJUST : Boolean.valueOf(propertyTimeAdjust)); option.setNullSelectionAllowed(false); option.setHtmlContentAllowed(true); option.setImmediate(true); layout.addComponent(option); final HorizontalLayout defaultLayout = new HorizontalLayout(); defaultLayout.setSpacing(true); layout.addComponent(defaultLayout); final Form form = new Form(); form.setFooter(null); final TextField timeFormat = new TextField("Format"); form.addField("timeFormat", timeFormat); defaultLayout.addComponent(form); option.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent event) { boolean value = (Boolean) event.getProperty().getValue(); dateConversion.setAdjustedToLocal(value); userObject.setProperty(UserObject.PROPERTY_TIME_ADJUST, String.valueOf(value)); settingsDialog.setRefresh(true); if (value == false) { timeFormat.removeAllValidators(); timeFormat.setComponentError(null); form.setComponentError(null); form.setValidationVisible(false); settingsDialog.setClose(true); } else { timeFormat.addValidator(new TimeFormatValidator()); timeFormat.setInputPrompt(DateConversion.DEFAULT_TIME_FORMAT); //timeFormat.setClickShortcut(KeyCode.ENTER); } } }); String propertyTimeFormat = userObject.getProperty(UserObject.PROPERTY_TIME_FORMAT); propertyTimeFormat = (propertyTimeFormat == null ? DateConversion.DEFAULT_TIME_FORMAT : String.valueOf(propertyTimeFormat)); timeFormat.setColumns(16); timeFormat.setValue(propertyTimeFormat); timeFormat.setImmediate(true); timeFormat.setRequired(true); timeFormat.setRequiredError("Format cannot be empty."); timeFormat.addValidator(new TimeFormatValidator()); timeFormat.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent event) { String value = (String) event.getProperty().getValue(); try { form.setComponentError(null); form.commit(); timeFormat.setComponentError(null); form.setValidationVisible(false); dateConversion.setFormat(value); userObject.setProperty(UserObject.PROPERTY_TIME_FORMAT, value); settingsDialog.setClose(true); settingsDialog.setRefresh(true); } catch (InvalidValueException e) { settingsDialog.setClose(false); timeFormat.setComponentError(new UserError("Invalid Format (Java SimpleDateFormat).")); timeFormat.focus(); } } }); Button defaultButton = new Button("Restore Default"); defaultLayout.addComponent(defaultButton); defaultLayout.setComponentAlignment(defaultButton, Alignment.MIDDLE_LEFT); defaultButton.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void buttonClick(Button.ClickEvent event) { timeFormat.setValue(DateConversion.DEFAULT_TIME_FORMAT); } }); return layout; }
From source file:com.skysql.manager.ui.GeneralSettings.java
License:Open Source License
/** * Commands layout./*from w ww . j a v a2 s . c o m*/ * * @return the vertical layout */ private VerticalLayout commandsLayout() { VerticalLayout layout = new VerticalLayout(); layout.setWidth("100%"); layout.setSpacing(true); layout.setMargin(new MarginInfo(false, true, true, true)); final Label title = new Label("<h3>Commands Execution</h3>", ContentMode.HTML); title.setSizeUndefined(); layout.addComponent(title); final Label explanation = new Label( "Determines if the command you selected will be executed only if the original steps displayed at the time of selection are still applicable, or if a suitable variation (depending on node state) can be substituted when you press \"Run\"."); explanation.setSizeFull(); layout.addComponent(explanation); OptionGroup option = new OptionGroup("Select an option"); option.addItem(false); option.setItemCaption(false, "Strict - only original steps"); option.addItem(true); option.setItemCaption(true, "Loose - any variation"); String propertyCommandExecution = userObject.getProperty(UserObject.PROPERTY_COMMAND_EXECUTION); option.select(propertyCommandExecution == null ? DEFAULT_COMMAND_EXECUTION : Boolean.valueOf(propertyCommandExecution)); option.setNullSelectionAllowed(false); option.setHtmlContentAllowed(true); option.setImmediate(true); layout.addComponent(option); option.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent event) { Object value = event.getProperty().getValue(); userObject.setProperty(UserObject.PROPERTY_COMMAND_EXECUTION, String.valueOf(value)); } }); return layout; }
From source file:com.skysql.manager.ui.LoginView.java
License:Open Source License
/** * Instantiates a new login view./*from w w w . j a v a 2 s .com*/ * * @param aboutRecord the about record */ public LoginView() { setSizeFull(); setMargin(true); setSpacing(true); addStyleName("loginView"); VerticalLayout logoLayout = new VerticalLayout(); addComponent(logoLayout); setComponentAlignment(logoLayout, Alignment.BOTTOM_CENTER); setExpandRatio(logoLayout, 1.0f); Embedded logo = new Embedded(null, new ThemeResource("img/loginlogo.png")); logoLayout.addComponent(logo); logoLayout.setComponentAlignment(logo, Alignment.BOTTOM_CENTER); Label releaseInfo = new Label("Version " + ManagerUI.GUI_RELEASE); releaseInfo.setSizeUndefined(); releaseInfo.addStyleName("releaseInfo"); logoLayout.addComponent(releaseInfo); logoLayout.setComponentAlignment(releaseInfo, Alignment.TOP_CENTER); VerticalLayout spacer = new VerticalLayout(); spacer.setHeight("20px"); logoLayout.addComponent(spacer); VerticalLayout loginBox = new VerticalLayout(); loginBox.addStyleName("loginBox"); loginBox.setSizeUndefined(); loginBox.setMargin(true); loginBox.setSpacing(true); addComponent(loginBox); setComponentAlignment(loginBox, Alignment.MIDDLE_CENTER); VerticalLayout loginFormLayout = new VerticalLayout(); loginFormLayout.addStyleName("loginForm"); loginFormLayout.setMargin(true); loginFormLayout.setSpacing(true); loginBox.addComponent(loginFormLayout); // userName.focus(); userName.setStyleName("loginControl"); userName.setInputPrompt("Username"); userName.setImmediate(true); userName.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void valueChange(ValueChangeEvent event) { password.focus(); login.setClickShortcut(KeyCode.ENTER); } }); loginFormLayout.addComponent(userName); loginFormLayout.setComponentAlignment(userName, Alignment.MIDDLE_CENTER); // spacer loginFormLayout.addComponent(new Label("")); password.setStyleName("loginControl"); password.setInputPrompt("Password"); password.setImmediate(true); password.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void valueChange(ValueChangeEvent event) { login.focus(); } }); loginFormLayout.addComponent(password); loginFormLayout.setComponentAlignment(password, Alignment.MIDDLE_CENTER); // spacer loginFormLayout.addComponent(new Label(" ")); login.setStyleName("loginControl"); login.setEnabled(false); loginFormLayout.addComponent(login); loginFormLayout.setComponentAlignment(login, Alignment.BOTTOM_CENTER); VerticalLayout filler = new VerticalLayout(); addComponent(filler); setExpandRatio(filler, 1.0f); preload(); }
From source file:com.skysql.manager.ui.ModalWindow.java
License:Open Source License
/** * Instantiates a new modal window./* ww w. j av a 2 s . c o m*/ * * @param caption the caption * @param width the width */ public ModalWindow(String caption, String width) { setModal(true); if (width != null) { setWidth(width); } center(); setCaption(caption); VerticalLayout layout = new VerticalLayout(); setContent(layout); layout.setSpacing(true); layout.setMargin(true); }
From source file:com.skysql.manager.ui.MonitorsSettings.java
License:Open Source License
/** * Monitor form./* w ww .ja va 2s. c om*/ * * @param monitor the monitor * @param title the title * @param description the description * @param button the button */ public void monitorForm(final MonitorRecord monitor, String title, String description, String button) { final TextField monitorName = new TextField("Monitor Name"); final TextField monitorDescription = new TextField("Description"); final TextField monitorUnit = new TextField("Measurement Unit"); final TextArea monitorSQL = new TextArea("SQL Statement"); final CheckBox monitorDelta = new CheckBox("Is Delta"); final CheckBox monitorAverage = new CheckBox("Is Average"); final NativeSelect validationTarget = new NativeSelect("Validate SQL on"); final NativeSelect monitorInterval = new NativeSelect("Sampling interval"); final NativeSelect monitorChartType = new NativeSelect("Default display"); secondaryDialog = new ModalWindow(title, null); UI.getCurrent().addWindow(secondaryDialog); secondaryDialog.addCloseListener(this); final VerticalLayout formContainer = new VerticalLayout(); formContainer.setMargin(new MarginInfo(true, true, false, true)); formContainer.setSpacing(false); final Form form = new Form(); formContainer.addComponent(form); form.setImmediate(false); form.setFooter(null); form.setDescription(description); String value; if ((value = monitor.getName()) != null) { monitorName.setValue(value); } form.addField("monitorName", monitorName); form.getField("monitorName").setRequired(true); form.getField("monitorName").setRequiredError("Monitor Name is missing"); monitorName.focus(); monitorName.setImmediate(true); monitorName.addValidator(new MonitorNameValidator(monitor.getName())); if ((value = monitor.getDescription()) != null) { monitorDescription.setValue(value); } monitorDescription.setWidth("24em"); form.addField("monitorDescription", monitorDescription); if ((value = monitor.getUnit()) != null) { monitorUnit.setValue(value); } form.addField("monitorUnit", monitorUnit); if ((value = monitor.getSql()) != null) { monitorSQL.setValue(value); } monitorSQL.setWidth("24em"); monitorSQL.addValidator(new SQLValidator()); form.addField("monitorSQL", monitorSQL); final String noValidation = "None - Skip Validation"; validationTarget.setImmediate(true); validationTarget.setNullSelectionAllowed(false); validationTarget.addItem(noValidation); validationTarget.select(noValidation); OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class); ArrayList<NodeInfo> nodes = overviewPanel.getNodes(); if (nodes == null || nodes.isEmpty()) { SystemInfo systemInfo = VaadinSession.getCurrent().getAttribute(SystemInfo.class); String systemID = systemInfo.getCurrentID(); String systemType = systemInfo.getCurrentSystem().getSystemType(); if (systemID.equals(SystemInfo.SYSTEM_ROOT)) { ClusterComponent clusterComponent = VaadinSession.getCurrent().getAttribute(ClusterComponent.class); systemID = clusterComponent.getID(); systemType = clusterComponent.getSystemType(); } nodes = new ArrayList<NodeInfo>(); for (String nodeID : systemInfo.getSystemRecord(systemID).getNodes()) { NodeInfo nodeInfo = new NodeInfo(systemID, systemType, nodeID); nodes.add(nodeInfo); } } for (NodeInfo node : nodes) { validationTarget.addItem(node.getID()); validationTarget.setItemCaption(node.getID(), node.getName()); } validationTarget.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void valueChange(ValueChangeEvent event) { nodeID = (String) event.getProperty().getValue(); validateSQL = nodeID.equals(noValidation) ? false : true; } }); form.addField("validationTarget", validationTarget); monitorDelta.setValue(monitor.isDelta()); form.addField("monitorDelta", monitorDelta); monitorAverage.setValue(monitor.isAverage()); form.addField("monitorAverage", monitorAverage); SettingsValues intervalValues = new SettingsValues(SettingsValues.SETTINGS_MONITOR_INTERVAL); String[] intervals = intervalValues.getValues(); for (String interval : intervals) { monitorInterval.addItem(Integer.parseInt(interval)); } Collection<?> validIntervals = monitorInterval.getItemIds(); if (validIntervals.contains(monitor.getInterval())) { monitorInterval.select(monitor.getInterval()); } else { SystemInfo systemInfo = getSession().getAttribute(SystemInfo.class); String defaultInterval = systemInfo.getSystemRecord(systemID).getProperties() .get(SystemInfo.PROPERTY_DEFAULTMONITORINTERVAL); if (defaultInterval != null && validIntervals.contains(Integer.parseInt(defaultInterval))) { monitorInterval.select(Integer.parseInt(defaultInterval)); } else if (!validIntervals.isEmpty()) { monitorInterval.select(validIntervals.toArray()[0]); } else { new ErrorDialog(null, "No set of permissible monitor intervals found"); } monitorInterval.setNullSelectionAllowed(false); form.addField("monitorInterval", monitorInterval); } for (UserChart.ChartType type : UserChart.ChartType.values()) { monitorChartType.addItem(type.name()); } monitorChartType .select(monitor.getChartType() == null ? UserChart.ChartType.values()[0] : monitor.getChartType()); monitorChartType.setNullSelectionAllowed(false); form.addField("monitorChartType", monitorChartType); HorizontalLayout buttonsBar = new HorizontalLayout(); buttonsBar.setStyleName("buttonsBar"); buttonsBar.setSizeFull(); buttonsBar.setSpacing(true); buttonsBar.setMargin(true); buttonsBar.setHeight("49px"); Label filler = new Label(); buttonsBar.addComponent(filler); buttonsBar.setExpandRatio(filler, 1.0f); Button cancelButton = new Button("Cancel"); buttonsBar.addComponent(cancelButton); buttonsBar.setComponentAlignment(cancelButton, Alignment.MIDDLE_RIGHT); cancelButton.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void buttonClick(ClickEvent event) { form.discard(); secondaryDialog.close(); } }); Button okButton = new Button(button); okButton.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void buttonClick(ClickEvent event) { try { form.setComponentError(null); form.commit(); monitor.setName(monitorName.getValue()); monitor.setDescription(monitorDescription.getValue()); monitor.setUnit(monitorUnit.getValue()); monitor.setSql(monitorSQL.getValue()); monitor.setDelta(monitorDelta.getValue()); monitor.setAverage(monitorAverage.getValue()); monitor.setInterval((Integer) monitorInterval.getValue()); monitor.setChartType((String) monitorChartType.getValue()); String ID; if ((ID = monitor.getID()) == null) { if (Monitors.setMonitor(monitor)) { ID = monitor.getID(); select.addItem(ID); select.select(ID); Monitors.reloadMonitors(); monitorsAll = Monitors.getMonitorsList(systemType); } } else { Monitors.setMonitor(monitor); ChartProperties chartProperties = getSession().getAttribute(ChartProperties.class); chartProperties.setDirty(true); settingsDialog.setRefresh(true); } if (ID != null) { select.setItemCaption(ID, monitor.getName()); displayMonitorRecord(ID); secondaryDialog.close(); } } catch (EmptyValueException e) { return; } catch (InvalidValueException e) { return; } catch (Exception e) { ManagerUI.error(e.getMessage()); return; } } }); buttonsBar.addComponent(okButton); buttonsBar.setComponentAlignment(okButton, Alignment.MIDDLE_RIGHT); VerticalLayout windowLayout = (VerticalLayout) secondaryDialog.getContent(); windowLayout.setSpacing(false); windowLayout.setMargin(false); windowLayout.addComponent(formContainer); windowLayout.addComponent(buttonsBar); }
From source file:com.skysql.manager.ui.NodeDialog.java
License:Open Source License
/** * Instantiates a new node dialog.//from w w w . ja v a 2 s . c om * * @param nodeInfo the node info * @param button the button */ public NodeDialog(NodeInfo nodeInfo, ComponentButton button) { this.button = button; String windowTitle = (nodeInfo != null) ? "Edit Node: " + nodeInfo.getName() : "Add Node"; dialogWindow = new ModalWindow(windowTitle, (nodeInfo != null) ? "350px" : "650px"); dialogWindow.addCloseListener(this); UI.getCurrent().addWindow(dialogWindow); buttonsBar = new HorizontalLayout(); buttonsBar.setStyleName("buttonsBar"); buttonsBar.setSizeFull(); buttonsBar.setSpacing(true); buttonsBar.setMargin(true); buttonsBar.setHeight("49px"); Label filler = new Label(); buttonsBar.addComponent(filler); buttonsBar.setExpandRatio(filler, 1.0f); if (nodeInfo == null) { SystemInfo systemInfo = VaadinSession.getCurrent().getAttribute(SystemInfo.class); this.nodeInfo = new NodeInfo(systemInfo.getCurrentID(), systemInfo.getCurrentSystem().getSystemType()); nodeForm = new NodeForm(this.nodeInfo, "Add a Node to the System: " + systemInfo.getCurrentSystem().getName()); saveNode("Add Node"); } else { this.nodeInfo = nodeInfo; nodeForm = new NodeForm(nodeInfo, "Edit an existing Node"); saveNode("Save Changes"); } VerticalLayout windowLayout = (VerticalLayout) dialogWindow.getContent(); windowLayout.setSpacing(false); windowLayout.setMargin(false); windowLayout.addComponent(nodeForm); windowLayout.addComponent(buttonsBar); }
From source file:com.skysql.manager.ui.PanelTools.java
License:Open Source License
/** * Instantiates a new panel tools.//from w w w. j ava 2 s . c o m */ PanelTools() { // thisTab.setSizeFull(); // thisTab.setWidth(Sizeable.SIZE_UNDEFINED, 0); // Default setHeight("200px"); setSpacing(true); // External Tools Vertical Module SystemInfo systemInfo = getSession().getAttribute(SystemInfo.class); LinkedHashMap<String, String> properties = systemInfo.getCurrentSystem().getProperties(); if (properties != null) { VerticalLayout externalsLayout = new VerticalLayout(); externalsLayout.setWidth("150px"); externalsLayout.addStyleName("externalsLayout"); externalsLayout.setSpacing(true); String EIP = properties.get(SystemInfo.PROPERTY_EIP); String MONyog = properties.get(SystemInfo.PROPERTY_MONYOG); if (EIP != null && MONyog != null) { String url = "http://" + EIP + MONyog; monyogLink = new Link("MONyog", new ExternalResource(url)); monyogLink.setTargetName("_blank"); monyogLink.setDescription("Open MONyog for the whole system"); monyogLink.setIcon(new ThemeResource("img/externalLink.png")); monyogLink.addStyleName("icon-after-caption"); externalsLayout.addComponent(monyogLink); externalsLayout.setComponentAlignment(monyogLink, Alignment.BOTTOM_CENTER); } phpUrl = properties.get(SystemInfo.PROPERTY_PHPMYADMIN); if (phpUrl != null) { phpLink = new Link("phpMyAdmin", null); phpLink.setTargetName("_blank"); phpLink.setDescription("Open phpMyAdmin for the selected node"); phpLink.setIcon(new ThemeResource("img/externalLink.png")); phpLink.addStyleName("icon-after-caption"); externalsLayout.addComponent(phpLink); externalsLayout.setComponentAlignment(phpLink, Alignment.BOTTOM_CENTER); } addComponent(externalsLayout); setComponentAlignment(externalsLayout, Alignment.MIDDLE_CENTER); } { Label spacer = new Label(); spacer.setWidth("40px"); addComponent(spacer); } // Scripting layout placeholder VerticalLayout placeholderLayout = new VerticalLayout(); placeholderLayout.addStyleName("placeholderLayout"); placeholderLayout.setSizeUndefined(); Label placeholderLabel = new Label("Links to external tools"); placeholderLabel.addStyleName("instructions"); placeholderLayout.addComponent(placeholderLabel); addComponent(placeholderLayout); setComponentAlignment(placeholderLayout, Alignment.MIDDLE_CENTER); }
From source file:com.skysql.manager.ui.SetupDialog.java
License:Open Source License
/** * Instantiates a new setup dialog./*from w w w. j a v a 2 s .c o m*/ */ public SetupDialog() { dialogWindow = new ModalWindow("Initial System Setup", "350px"); dialogWindow.addCloseListener(this); UI.getCurrent().addWindow(dialogWindow); wrapper = new HorizontalLayout(); wrapper.setWidth("100%"); wrapper.setMargin(true); wrapper.addComponent(currentForm); buttonsBar = new HorizontalLayout(); buttonsBar.setStyleName("buttonsBar"); buttonsBar.setSizeFull(); buttonsBar.setSpacing(true); buttonsBar.setMargin(true); buttonsBar.setHeight("49px"); Label filler = new Label(); buttonsBar.addComponent(filler); buttonsBar.setExpandRatio(filler, 1.0f); VerticalLayout windowLayout = (VerticalLayout) dialogWindow.getContent(); windowLayout.setSpacing(false); windowLayout.setMargin(false); windowLayout.addComponent(wrapper); windowLayout.addComponent(buttonsBar); nextForm(); }
From source file:com.skysql.manager.ui.SystemDialog.java
License:Open Source License
/** * Instantiates a new system dialog./*from w ww.jav a 2 s . c o m*/ * * @param systemRecord the system record * @param button the button */ public SystemDialog(final SystemRecord systemRecord, final ComponentButton button) { this.button = button; String windowTitle = (systemRecord != null) ? "Edit System: " + systemRecord.getName() : "Add System"; dialogWindow = new ModalWindow(windowTitle, "350px"); dialogWindow.addCloseListener(this); UI.getCurrent().addWindow(dialogWindow); HorizontalLayout wrapper = new HorizontalLayout(); wrapper.setWidth("100%"); wrapper.setMargin(true); buttonsBar = new HorizontalLayout(); buttonsBar.setStyleName("buttonsBar"); buttonsBar.setSizeFull(); buttonsBar.setSpacing(true); buttonsBar.setMargin(true); buttonsBar.setHeight("49px"); Label filler = new Label(); buttonsBar.addComponent(filler); buttonsBar.setExpandRatio(filler, 1.0f); VerticalLayout windowLayout = (VerticalLayout) dialogWindow.getContent(); windowLayout.setSpacing(false); windowLayout.setMargin(false); windowLayout.addComponent(wrapper); windowLayout.addComponent(buttonsBar); commitButton = new Button(); if (systemRecord == null) { this.systemRecord = new SystemRecord(SystemInfo.SYSTEM_ROOT); systemForm = new SystemForm(this.systemRecord, "Add a System", commitButton); saveSystem("Add System"); } else { this.systemRecord = systemRecord; systemForm = new SystemForm(systemRecord, "Edit an existing System", commitButton); saveSystem("Save Changes"); } wrapper.addComponent(systemForm); }
From source file:com.skysql.manager.ui.UserDialog.java
License:Open Source License
/** * Instantiates a new user dialog./* ww w .j a v a2s. c om*/ * * @param userInfo the user info * @param userObject the user object * @param usersSettings the users settings */ public UserDialog(final UserInfo userInfo, final UserObject userObject, final UsersSettings usersSettings) { this.userInfo = userInfo; this.usersSettings = usersSettings; String windowTitle = (userObject != null) ? "Edit User: " + userObject.getName() : "Add User"; dialogWindow = new ModalWindow(windowTitle, "350px"); dialogWindow.addCloseListener(this); UI.getCurrent().addWindow(dialogWindow); HorizontalLayout wrapper = new HorizontalLayout(); wrapper.setWidth("100%"); wrapper.setMargin(true); buttonsBar = new HorizontalLayout(); buttonsBar.setStyleName("buttonsBar"); buttonsBar.setSizeFull(); buttonsBar.setSpacing(true); buttonsBar.setMargin(true); buttonsBar.setHeight("49px"); Label filler = new Label(); buttonsBar.addComponent(filler); buttonsBar.setExpandRatio(filler, 1.0f); VerticalLayout windowLayout = (VerticalLayout) dialogWindow.getContent(); windowLayout.setSpacing(false); windowLayout.setMargin(false); windowLayout.addComponent(wrapper); windowLayout.addComponent(buttonsBar); commitButton = new Button(); if (userObject == null) { isAdding = true; this.userObject = new UserObject(); userForm = new UserForm(userInfo, this.userObject, "Add a new User", commitButton); saveUser("Add User"); } else { this.userObject = userObject; userForm = new UserForm(userInfo, userObject, "Edit an existing User", commitButton); saveUser("Save Changes"); } wrapper.addComponent(userForm); }