List of usage examples for com.vaadin.ui Alignment TOP_LEFT
Alignment TOP_LEFT
To view the source code for com.vaadin.ui Alignment TOP_LEFT.
Click Source Link
From source file:com.purebred.core.view.ResultsConnectedEntityForm.java
License:Open Source License
private HorizontalLayout createNavigationFormLayout() { HorizontalLayout navigationFormLayout = new HorizontalLayout(); navigationFormLayout.setSizeUndefined(); VerticalLayout previousButtonLayout = new VerticalLayout(); previousButtonLayout.setSizeUndefined(); previousButtonLayout.setMargin(false); previousButtonLayout.setSpacing(false); Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML); spaceLabel.setSizeUndefined();/*from ww w .ja v a 2s .co m*/ previousButtonLayout.addComponent(spaceLabel); previousButton = new Button(null, this, "previousItem"); previousButton.setDescription(entityForm.uiMessageSource.getMessage("entityForm.previous.description")); previousButton.setSizeUndefined(); previousButton.addStyleName("borderless"); previousButton.setIcon(new ThemeResource("icons/16/previous.png")); if (entityForm.getViewableToManyRelationships().size() == 0) { HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout(); previousButtonHorizontalLayout.setSizeUndefined(); Label horizontalSpaceLabel = new Label(" ", Label.CONTENT_XHTML); horizontalSpaceLabel.setSizeUndefined(); previousButtonHorizontalLayout.addComponent(previousButton); previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel); previousButtonLayout.addComponent(previousButtonHorizontalLayout); } else { previousButtonLayout.addComponent(previousButton); } navigationFormLayout.addComponent(previousButtonLayout); navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT); navigationFormLayout.addComponent(entityForm); VerticalLayout nextButtonLayout = new VerticalLayout(); nextButtonLayout.setSizeUndefined(); nextButtonLayout.setMargin(false); nextButtonLayout.setSpacing(false); spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML); spaceLabel.setSizeUndefined(); previousButtonLayout.addComponent(spaceLabel); nextButtonLayout.addComponent(spaceLabel); nextButton = new Button(null, this, "nextItem"); nextButton.setDescription(entityForm.uiMessageSource.getMessage("entityForm.next.description")); nextButton.setSizeUndefined(); nextButton.addStyleName("borderless"); nextButton.setIcon(new ThemeResource("icons/16/next.png")); HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout(); nextButtonHorizontalLayout.setSizeUndefined(); Label horizontalSpaceLabel = new Label(" ", Label.CONTENT_XHTML); horizontalSpaceLabel.setSizeUndefined(); nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel); nextButtonHorizontalLayout.addComponent(nextButton); nextButtonLayout.addComponent(nextButtonHorizontalLayout); navigationFormLayout.addComponent(nextButtonLayout); navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT); navigationFormLayout.setSpacing(false); navigationFormLayout.setMargin(false); return navigationFormLayout; }
From source file:com.skysql.manager.ui.components.ComponentButton.java
License:Open Source License
/** * Instantiates a new component button./*from w w w. ja v a 2 s. com*/ * * @param componentInfo the component info */ public ComponentButton(ClusterComponent componentInfo) { thisButton = this; this.componentInfo = componentInfo; addStyleName("componentButton"); componentInfo.setButton(this); setData(componentInfo); setHeight(COMPONENT_HEIGHT + 4, Unit.PIXELS); float componentWidth = (componentInfo.getType() == ClusterComponent.CCType.system) ? SYSTEM_WIDTH : NODE_WIDTH; setWidth(componentWidth + 8, Unit.PIXELS); imageLayout = new VerticalLayout(); imageLayout.setHeight(COMPONENT_HEIGHT + 4, Unit.PIXELS); imageLayout.setWidth(componentWidth, Unit.PIXELS); //imageLayout.setMargin(new MarginInfo(true, true, false, true)); imageLayout.setImmediate(true); if (componentInfo.getParentID() != null) { String icon = null; switch (componentInfo.getType()) { case system: icon = "system"; break; case node: icon = NodeStates.getNodeIcon(componentInfo.getSystemType(), componentInfo.getState()); break; default: // unknown component type break; } imageLayout.addStyleName(icon); //imageLayout.addStyleName(componentInfo.getType().toString()); commandLabel = new Label(); commandLabel.setSizeUndefined(); imageLayout.addComponent(commandLabel); imageLayout.setComponentAlignment(commandLabel, Alignment.TOP_LEFT); //imageLayout.setExpandRatio(commandLabel, 1.0f); // NodeInfo nodeInfo = (NodeInfo) componentInfo; // TaskRecord taskRecord = nodeInfo.getTask(); // setCommandLabel(taskRecord); Label padding = new Label(""); imageLayout.addComponent(padding); imageLayout.setComponentAlignment(padding, Alignment.MIDDLE_CENTER); HorizontalLayout iconsStrip = new HorizontalLayout(); iconsStrip.addStyleName("componentInfo"); iconsStrip.setWidth(componentInfo.getType() == ClusterComponent.CCType.node ? "60px" : "76px"); imageLayout.addComponent(iconsStrip); imageLayout.setComponentAlignment(iconsStrip, Alignment.MIDDLE_CENTER); info = new Embedded(null, new ThemeResource("img/info.png")); iconsStrip.addComponent(info); iconsStrip.setComponentAlignment(info, Alignment.MIDDLE_LEFT); alert = new Embedded(); alert.setVisible(false); iconsStrip.addComponent(alert); iconsStrip.setComponentAlignment(alert, Alignment.MIDDLE_RIGHT); nameLabel = new Label(componentInfo.getName()); nameLabel.setStyleName("componentName"); nameLabel.setSizeUndefined(); imageLayout.addComponent(nameLabel); imageLayout.setComponentAlignment(nameLabel, Alignment.BOTTOM_CENTER); } addComponent(imageLayout); setComponentAlignment(imageLayout, Alignment.TOP_CENTER); setExpandRatio(imageLayout, 1.0f); }
From source file:com.skysql.manager.ui.ErrorDialog.java
License:Open Source License
/** * Instantiates a new error dialog.//from w ww . j av a 2 s . c om * * @param e the exception * @param humanizedError the humanized error */ public ErrorDialog(Exception e, String humanizedError) { if (e != null) { ManagerUI.error(e.getMessage()); } dialogWindow = new ModalWindow("An Error has occurred", "775px"); dialogWindow.setHeight("340px"); dialogWindow.addCloseListener(this); UI current = UI.getCurrent(); if (current.getContent() == null) { current.setContent(new ErrorView(Notification.Type.ERROR_MESSAGE, null)); } current.addWindow(dialogWindow); HorizontalLayout wrapper = new HorizontalLayout(); wrapper.setSizeFull(); wrapper.setMargin(true); VerticalLayout iconLayout = new VerticalLayout(); iconLayout.setWidth("100px"); wrapper.addComponent(iconLayout); Embedded image = new Embedded(null, new ThemeResource("img/error.png")); iconLayout.addComponent(image); VerticalLayout textLayout = new VerticalLayout(); textLayout.setHeight("100%"); textLayout.setSpacing(true); wrapper.addComponent(textLayout); wrapper.setExpandRatio(textLayout, 1.0f); if (humanizedError != null || e != null) { String error = (humanizedError != null) ? humanizedError : e.toString(); ManagerUI.error(error); Label label = new Label(error, ContentMode.HTML); label.addStyleName("warning"); textLayout.addComponent(label); textLayout.setComponentAlignment(label, Alignment.TOP_CENTER); } if (e != null) { TextArea stackTrace = new TextArea("Error Log"); stackTrace.setSizeFull(); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); stackTrace.setValue(sw.toString()); textLayout.addComponent(stackTrace); textLayout.setComponentAlignment(stackTrace, Alignment.TOP_LEFT); textLayout.setExpandRatio(stackTrace, 1.0f); } 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("Close"); 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) { dialogWindow.close(); //UI.getCurrent().close(); } }); Button okButton = new Button("Send Error"); okButton.setEnabled(false); okButton.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 0x4C656F6E6172646FL; public void buttonClick(ClickEvent event) { dialogWindow.close(); } }); buttonsBar.addComponent(okButton); buttonsBar.setComponentAlignment(okButton, Alignment.MIDDLE_RIGHT); VerticalLayout windowLayout = (VerticalLayout) dialogWindow.getContent(); windowLayout.setHeight("100%"); windowLayout.setSpacing(false); windowLayout.setMargin(false); windowLayout.addComponent(wrapper); windowLayout.setExpandRatio(wrapper, 1.0f); windowLayout.addComponent(buttonsBar); }
From source file:com.skysql.manager.ui.RunningTask.java
License:Open Source License
/** * Instantiates a new running task.//from w w w .ja v a 2 s . co m * * @param command the command * @param nodeInfo the node info * @param commandSelect the command select */ RunningTask(String command, NodeInfo nodeInfo, ListSelect commandSelect) { this.command = command; this.nodeInfo = nodeInfo; this.commandSelect = commandSelect; ManagerUI.log("RunningTask - command: " + command + ", node: " + nodeInfo.getName()); if (command == null) { observerMode = true; taskRecord = nodeInfo.getTask(); command = taskRecord.getCommand(); this.command = command; } nodeInfo.setCommandTask(this); containerLayout = new VerticalLayout(); containerLayout.addStyleName("containerLayout"); containerLayout.setSizeFull(); scriptingLayout = new HorizontalLayout(); scriptingLayout.setSpacing(true); scriptingLayout.setSizeFull(); containerLayout.addComponent(scriptingLayout); containerLayout.setComponentAlignment(scriptingLayout, Alignment.MIDDLE_LEFT); // COLUMN 1. PARAMETERS Commands.Command commandEnum = Commands.Command.valueOf(command); switch (commandEnum) { case backup: case connect: case restore: if (observerMode) { // parametersLayout = new HorizontalLayout(); // parametersLayout.addComponent(new Label("Parameters: " + taskRecord.getParams())); // scriptingLayout.addComponent(parametersLayout); // scriptingLayout.setComponentAlignment(parametersLayout, Alignment.MIDDLE_LEFT); } else { parametersLayout = new ParametersLayout(this, nodeInfo, commandEnum); scriptingLayout.addComponent(parametersLayout); scriptingLayout.setComponentAlignment(parametersLayout, Alignment.TOP_LEFT); } break; default: break; } // COLUMN 2. CONTROLS // controls = taskRun.getControls(); this is for when they are server-side driven scriptingControlsLayout = new ScriptingControlsLayout(this, new Controls[] { Controls.Run, Controls.Stop }); scriptingLayout.addComponent(scriptingControlsLayout); scriptingLayout.setComponentAlignment(scriptingControlsLayout, Alignment.MIDDLE_LEFT); // TODO: this needs to be done properly if (observerMode) { scriptingControlsLayout.enableControls(true, Controls.Stop); } else { if (parametersLayout == null || parametersLayout.isParameterReady()) { scriptingControlsLayout.enableControls(true, Controls.Run); } } // COLUMN 3. PROGRESS & RESULT scriptingProgressLayout = new ScriptingProgressLayout(this, observerMode); scriptingLayout.addComponent(scriptingProgressLayout); scriptingLayout.setComponentAlignment(scriptingProgressLayout, Alignment.MIDDLE_LEFT); if (observerMode) { scriptingProgressLayout.buildProgress(taskRecord, command, taskRecord.getSteps()); activateTimer(); } else { scriptingProgressLayout.buildProgress(taskRecord, command, nodeInfo.getCommands().getSteps(command)); } }
From source file:com.squadd.UI.HeaderLayout.java
public HeaderLayout() { configureHeader(); setSizeFull(); addComponents(header); setComponentAlignment(header, Alignment.TOP_LEFT); }
From source file:com.studiodojo.qwikinvoice.QwikInvoiceApplication.java
License:Apache License
@Override public void init() { this.mainWindow = new Window( "QwikInvoice CRM Tools - Developed by StudioDojo. Engineered by Vaadin. Powered by Google."); setMainWindow(mainWindow);/*w w w.ja v a 2 s . co m*/ // // Check if a user is logged in // UserService us = UserServiceFactory.getUserService(); this.logoutURL = us.createLogoutURL(super.getURL().toExternalForm()); if (us.getCurrentUser() == null || us.getCurrentUser().getEmail() == null) { super.setLogoutURL(logoutURL); super.close(); return; } String login = us.getCurrentUser().getEmail(); this.userKey = KeyFactory.createKey(TokenBean.class.getSimpleName(), us.getCurrentUser().getEmail()); // Key ucKey = KeyFactory.createKey(UserCompanyBean.class.getSimpleName(), us.getCurrentUser().getEmail()); UserCompanyBean ucBean = UserDAO.getUserCompanyBean(us.getCurrentUser().getEmail()); this.theSession = new SessionBean(login, ucBean); // // SETUP WORKING AREA // HorizontalLayout appLayout = new HorizontalLayout(); appLayout.setSizeFull(); // The Main Layout VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setWidth(APP_WIDTH); mainLayout.setHeight(APP_HEIGHT); appLayout.addComponent(mainLayout); appLayout.setComponentAlignment(mainLayout, Alignment.TOP_CENTER); appLayout.setExpandRatio(mainLayout, 2); // // Setup Header (Welcome Message) // Label welcome = new Label( "<h1>QWIK!NVOICE</h1> You are " + (us.isUserLoggedIn() ? "logged in" : "logged out") + " as <b>" + us.getCurrentUser().getNickname() + "</b>", Label.CONTENT_XHTML); mainLayout.addComponent(welcome); mainLayout.setComponentAlignment(welcome, Alignment.TOP_LEFT); // // Menu Bar // MenuBar menuBar = new MenuBar(); menuBar.setWidth(APP_WIDTH); MenuBar.MenuItem fileMenuItem = menuBar.addItem("File", null, null); MenuItem newMenuItem = fileMenuItem.addItem("New...", null, null); newMenuItem.addItem("Invoice/Quote", new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { QwikInvoiceApplication.this.showPanel(InvoiceApplicationPanel.class); } catch (Exception e) { Log.log(Level.SEVERE, "Error loading panel", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); newMenuItem.addItem("Order", new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { QwikInvoiceApplication.this.showPanel(FFOrderApplicationPanel.class); } catch (Exception e) { Log.log(Level.SEVERE, "Error loading panel", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); /** SAVE */ fileMenuItem.addItem("Save", new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { TokenBean userTokenBean = TokenStore.getToken(QwikInvoiceApplication.this.userKey); // User must have an OAuth AUTH Token to access Google Doc service if (userTokenBean != null) { /* GDocFileWindow saveWindow = new GDocFileWindow("Save As..."); saveWindow.init(QwikInvoiceApplication.this, PdfWriter.getFilename(QwikInvoiceApplication.this.theSession)); QwikInvoiceApplication.this.mainWindow.addWindow(saveWindow); */ QwikInvoiceApplication.this.activePanel.validate(); QwikInvoiceApplication.this.activePanel.onSave(); } else { AuthSubWindow authsubWindow = new AuthSubWindow("Service Authorization Required"); authsubWindow.init(QwikInvoiceApplication.this.userKey); QwikInvoiceApplication.this.mainWindow.addWindow(authsubWindow); } } catch (Exception e) { Log.log(Level.SEVERE, "Error Saving file", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); /** * SETTINGS */ fileMenuItem.addSeparator(); MenuItem settingsMenuItem = fileMenuItem.addItem("Settings...", null, null); settingsMenuItem.addItem("Profile", new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { UserCompanySetupWindow aWindow = new UserCompanySetupWindow(); aWindow.init(QwikInvoiceApplication.this); QwikInvoiceApplication.this.mainWindow.addWindow(aWindow); } catch (Exception e) { Log.log(Level.SEVERE, "Error Saving Profile", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); fileMenuItem.addSeparator(); fileMenuItem.addItem("Logout", new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { QwikInvoiceApplication.this.setLogoutURL(logoutURL); QwikInvoiceApplication.this.close(); } }); /** * Products */ MenuBar.MenuItem productsMenuItem = menuBar.addItem("Products", null, null); productsMenuItem.addItem("Products", null, new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { QwikInvoiceApplication.this.showPanel(ProductApplicationPanel.class); } catch (Exception e) { Log.log(Level.SEVERE, "Error loading products", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); productsMenuItem.addItem("Categories", null, new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { ProductCategorySettingsWindow window = new ProductCategorySettingsWindow(); window.setCaption("Product Category"); window.init(QwikInvoiceApplication.this.theSession, QwikInvoiceApplication.this); QwikInvoiceApplication.this.mainWindow.addWindow(window); } catch (Exception e) { Log.log(Level.SEVERE, "Error Loading Products", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); productsMenuItem.addItem("Catalogs", null, new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { try { QwikInvoiceApplication.this.showPanel(CatalogApplicationPanel.class); } catch (Exception e) { Log.log(Level.SEVERE, "Error loading catalogs", e); QwikInvoiceApplication.this.mainWindow.showNotification("Error", e.getMessage(), Notification.TYPE_ERROR_MESSAGE); } } }); /** * Help */ MenuBar.MenuItem helpMenuItem = menuBar.addItem("Help", null, new MenuBar.Command() { public void menuSelected(MenuItem selectedItem) { AboutWindow aboutWindow = new AboutWindow(); aboutWindow.init(); QwikInvoiceApplication.this.mainWindow.addWindow(aboutWindow); } }); helpMenuItem.addItem("About...", null, null); mainLayout.addComponent(menuBar); mainLayout.setComponentAlignment(menuBar, Alignment.TOP_CENTER); // // Load Main Panel // IApplicationPanel invoiceApplicationPanel = (IApplicationPanel) this.map.get(InvoiceApplicationPanel.class); try { invoiceApplicationPanel.init(this.theSession, this); mainLayout.addComponent((Component) invoiceApplicationPanel); mainLayout.setComponentAlignment((Component) invoiceApplicationPanel, Alignment.TOP_CENTER); this.activePanel = invoiceApplicationPanel; } catch (Exception e) { } // // Setup Footer // //Label footerMessage = new Label("QwikInvoice <b>version "+_VERSION_+"</b>. This service is provided as is. E&O accepted. Developed by <a href='mailto:public@studiodojo.com?subject=QwikInvoice' target='_blank'>StudioDojo</a>. Engineered by Vaadin. Powered by Google. Apache License 2.0", Label.CONTENT_XHTML); //mainLayout.addComponent(footerMessage); //mainLayout.setComponentAlignment(footerMessage, Alignment.TOP_CENTER); Panel mainPanel = new Panel(); mainPanel.setScrollable(true); mainPanel.setContent(appLayout); this.mainWindow.setContent(mainPanel); }
From source file:com.swifta.mats.web.usermanagement.UserDetailsModule.java
private HorizontalLayout getLC() { VerticalLayout cAgentInfo = new VerticalLayout(); cAgentInfo.setMargin(new MarginInfo(true, true, true, true)); cAgentInfo.setStyleName("c_details_test"); final VerticalLayout cLBody = new VerticalLayout(); cLBody.setStyleName("c_body_visible"); tb = new Table("Linked child accounts"); addLinksTable();// ww w . j a v a2 s.c o m cLBody.addComponent(tb); tb.setSelectable(true); cAgentInfo.addComponent(cLBody); btnLink = new Button("Add New Link"); btnLink.setIcon(FontAwesome.LINK); btnLink.setDescription("Link new account."); cLBody.addComponent(btnLink); cLBody.setComponentAlignment(btnLink, Alignment.TOP_LEFT); btnLink.addClickListener(new LinkClickHandler()); cPlaceholder.setVisible(false); addLinkUserContainer(); cPlaceholder.setWidth("100%"); cLBody.addComponent(cPlaceholder); cLBody.setComponentAlignment(cPlaceholder, Alignment.TOP_CENTER); HorizontalLayout c = new HorizontalLayout(); c.addComponent(cAgentInfo); return c; }
From source file:com.swifta.mats.web.usermanagement.UserDetailsModule.java
private void addLinkUserContainer() { VerticalLayout cDeletePrompt = new VerticalLayout(); cPlaceholder.addComponent(cDeletePrompt); cPlaceholder.setComponentAlignment(cDeletePrompt, Alignment.MIDDLE_CENTER); // cDeletePrompt.setWidth("100%"); cDeletePrompt.setStyleName("c_link"); cDeletePrompt.setSpacing(true);//from w w w . ja v a2 s . c o m String username = curUser; Label lbActivationPrompt = new Label( "<span style='text-align: center;'>Please enter Child Username to link to " + username + "'s Account</span>"); lbActivationPrompt.setContentMode(ContentMode.HTML); lbActivationPrompt.setWidth("300px"); lbActivationPrompt.setStyleName("lb_link_user"); cDeletePrompt.addComponent(lbActivationPrompt); cDeletePrompt.setComponentAlignment(lbActivationPrompt, Alignment.TOP_LEFT); VerticalLayout frmDeleteReason = new VerticalLayout(); frmDeleteReason.setSizeUndefined(); frmDeleteReason.setSpacing(true); frmDeleteReason.setMargin(true); cDeletePrompt.addComponent(frmDeleteReason); cDeletePrompt.setComponentAlignment(frmDeleteReason, Alignment.TOP_CENTER); tFU = new TextField("Child Username"); tFU.setRequired(true); final ComboBox comboUProf = new ComboBox("Select Profile"); comboUProf.setNullSelectionAllowed(false); comboUProf.setRequired(true); comboUProf.addItem(8); comboUProf.setItemCaption(8, "DEPOSIT_ONLY"); comboUProf.addItem(9); comboUProf.setItemCaption(9, "DEPOSIT_AND_WITHDRAWAL"); comboUProf.select(8); final TextField tFP = new TextField("Parent Account ID"); tFP.setValue(username); tFP.setEnabled(false); final TextField tFInitUser = new TextField("Initiating User"); tFInitUser.setValue(UI.getCurrent().getSession().getAttribute("user").toString()); tFInitUser.focus(); tFInitUser.setEnabled(false); frmDeleteReason.addComponent(tFU); frmDeleteReason.addComponent(comboUProf); frmDeleteReason.addComponent(tFP); frmDeleteReason.addComponent(tFInitUser); HorizontalLayout cPopupBtns = new HorizontalLayout(); cPopupBtns.setSizeUndefined(); cPopupBtns.setSpacing(true); final Button btnCancel = new Button(); btnCancel.setIcon(FontAwesome.UNDO); btnCancel.setStyleName("btn_link"); btnCancel.setDescription("Cancel"); final Button btnSet = new Button("Link"); btnSet.setDescription("Link specified account."); btnSet.setIcon(FontAwesome.LINK); cPopupBtns.addComponent(btnSet); cPopupBtns.addComponent(btnCancel); frmDeleteReason.addComponent(cPopupBtns); cDeletePrompt.setComponentAlignment(frmDeleteReason, Alignment.MIDDLE_CENTER); btnSet.setClickShortcut(KeyCode.ENTER, null); btnSet.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = -6318666715385643538L; @Override public void buttonClick(ClickEvent event) { tFU.validate(); btnSet.setEnabled(false); btnCancel.setEnabled(false); Button btn = event.getButton(); if (ums == null) ums = new UserManagementService(); btn.setEnabled(false); String strResponse = null; try { strResponse = UserManagementService.linkUser(tFP.getValue(), new Integer(comboUProf.getValue().toString()), tFInitUser.getValue(), tFU.getValue()); if (strResponse.equals("The operation was successful and completed")) { updateLinksTable(tFU.getValue()); cPlaceholder.setVisible(false); tFU.setValue(""); btnLink.setVisible(true); NotifCustom.show("Link", strResponse); } else { NotifCustom.show("Link", strResponse); } } catch (RemoteException e) { e.printStackTrace(); } btnSet.setEnabled(true); btnCancel.setEnabled(true); } }); btnCancel.addClickListener(new ClickListener() { private static final long serialVersionUID = 7161821652386306043L; @Override public void buttonClick(ClickEvent event) { btnLink.setVisible(true); cPlaceholder.setVisible(false); } }); }
From source file:com.trender.user.ProfilePageView.java
@Override public void enter(ViewChangeListener.ViewChangeEvent event) { verticalLayout = new VerticalLayout(); Component header = new Header().intitUserPageComponent("? 1"); verticalLayout.addComponent(header); verticalLayout.setComponentAlignment(header, Alignment.TOP_LEFT); verticalLayout.setExpandRatio(header, 12); Component form = new UserForm().ProfilForm(); verticalLayout.addComponent(form);/*from ww w . j ava 2 s . com*/ verticalLayout.setComponentAlignment(form, Alignment.TOP_CENTER); verticalLayout.setExpandRatio(form, 88); verticalLayout.setSizeFull(); setCompositionRoot(verticalLayout); setSizeFull(); }
From source file:com.wintindustries.pfserver.interfaces.view.dashboard.ErrorView.java
public void displayErrorMessage(Exception ex, String title, String message) { VerticalLayout info = new VerticalLayout(); errorInfo.addComponent(info);/*from w w w . j av a2s . c om*/ errorInfo.setComponentAlignment(info, Alignment.TOP_LEFT); info.setStyleName("error-page-information"); if (title != null) { } if (message != null) { } if (ex != null) { Label label = new Label(); label.setContentMode(Label.CONTENT_XHTML); label.setCaption(ex.getLocalizedMessage()); info.addComponent(label); Label stacktraceLabel = new Label("Stacktrace"); info.addComponent(stacktraceLabel); Label stacktrace = new Label(); stacktrace.setWidth("50%"); stacktrace.setStyleName("error-page-stacktrace"); stacktrace.setCaptionAsHtml(true); StringWriter errors = new StringWriter(); ex.printStackTrace(new PrintWriter(errors)); stacktrace.setCaption(errors.toString()); info.addComponent(stacktrace); } }