List of usage examples for com.vaadin.ui Panel Panel
public Panel()
From source file:de.decidr.ui.view.WorkflowInstanceComponent.java
License:Apache License
/** * This method initializes the components of the workflow instance * component./*from ww w .j a v a 2 s. c o m*/ */ private void init() { runningInstanceContainer = new RunningInstanceContainer(); completedInstanceContainer = new CompletedInstancesContainer(); verticalLayout = new VerticalLayout(); tableVerticalLayout = new VerticalLayout(); workflowInstanceLabel = new Label("<h2> Workflow instances </h2>"); workflowInstanceLabel.setContentMode(Label.CONTENT_XHTML); runningWorkflowInstanceLabel = new Label("<h3> Running workflow instances </h3>"); runningWorkflowInstanceLabel.setContentMode(Label.CONTENT_XHTML); completedWorkflowInstanceLabel = new Label("<h3> Completed workflow instances </h3>"); completedWorkflowInstanceLabel.setContentMode(Label.CONTENT_XHTML); runningInstanceTable = new RunningInstanceTable(runningInstanceContainer); searchPanel = new SearchPanel(runningInstanceTable); tablePanel = new Panel(); completedInstanceTable = new CompletedInstanceTable(completedInstanceContainer); setCompositionRoot(verticalLayout); initButtonPanel(); verticalLayout.setSpacing(true); verticalLayout.addComponent(workflowInstanceLabel); verticalLayout.addComponent(searchPanel); tablePanel.setContent(tableVerticalLayout); tablePanel.setScrollable(true); tableVerticalLayout.setSpacing(true); tableVerticalLayout.addComponent(runningWorkflowInstanceLabel); tableVerticalLayout.addComponent(runningInstanceTable); tableVerticalLayout.addComponent(new Button("Show", new ShowInstanceViewerAction(runningInstanceTable))); tableVerticalLayout.addComponent(completedWorkflowInstanceLabel); tableVerticalLayout.addComponent(completedInstanceTable); verticalLayout.addComponent(tablePanel); verticalLayout.addComponent(buttonPanel); }
From source file:de.escidoc.admintool.view.contentmodel.ContentModelAddView.java
License:Open Source License
public ContentModelAddView(final AdminToolApplication app, final Window mainWindow, final ResourceService contentModelService, final ContentModelContainerImpl contentModelContainerImpl, final PdpRequest pdpRequest) { super(new Panel()); Preconditions.checkNotNull(app, "app is null: %s", app); Preconditions.checkNotNull(mainWindow, "mainWindow is null: %s", mainWindow); Preconditions.checkNotNull(contentModelService, "contentModelService is null: %s", contentModelService); this.app = app; this.mainWindow = mainWindow; this.contentModelService = contentModelService; this.contentModelContainerImpl = contentModelContainerImpl; this.pdpRequest = pdpRequest; }
From source file:de.escidoc.admintool.view.context.ContextAddView.java
License:Open Source License
private void addAdminDescriptorField() { adminDescriptorAccordion = new Accordion(); adminDescriptorAccordion.setWidth(ViewConstants.FIELD_WIDTH); adminDescriptorAccordion.setSizeFull(); final Panel accordionPanel = new Panel(); accordionPanel.setContent(adminDescriptorAccordion); accordionPanel.setSizeFull();// w w w . j a v a 2 s . com accordionPanel.setWidth(ViewConstants.FIELD_WIDTH); final Button addButton = new Button(ViewConstants.ADD_LABEL); final Button editButton = new Button(ViewConstants.EDIT_LABEL); final Button delButton = new Button(ViewConstants.REMOVE_LABEL); addButton.setStyleName("small"); editButton.setStyleName("small"); delButton.setStyleName("small"); addButton.addListener(new NewAdminDescriptorListener(mainWindow, adminDescriptorAccordion)); editButton.addListener(new EditAdminDescriptorListener(mainWindow, adminDescriptorAccordion)); delButton.addListener(new RemoveAdminDescriptorListener(adminDescriptorAccordion)); panel.addComponent(LayoutHelper.create("Admin Descriptors", accordionPanel, LABEL_WIDTH + 2, 300, false, new Button[] { addButton, editButton, delButton })); }
From source file:de.escidoc.admintool.view.context.ContextEditForm.java
License:Open Source License
private void addAdminDescriptor() { adminDescriptorAccordion = new Accordion(); adminDescriptorAccordion.setWidth(ViewConstants.FIELD_WIDTH); adminDescriptorAccordion.setSizeFull(); final Panel accordionPanel = new Panel(); accordionPanel.setContent(adminDescriptorAccordion); accordionPanel.setSizeFull();//from w w w . ja v a 2 s. c o m accordionPanel.setWidth(ViewConstants.FIELD_WIDTH); addAdminDescButton.setStyleName(AppConstants.SMALL_BUTTON); editAdminDescButton.setStyleName(AppConstants.SMALL_BUTTON); delAdminDescButton.setStyleName(AppConstants.SMALL_BUTTON); addAdminDescButton.addListener(new NewAdminDescriptorListener(mainWindow, adminDescriptorAccordion)); editAdminDescButton.addListener(new EditAdminDescriptorListener(mainWindow, adminDescriptorAccordion)); delAdminDescButton.addListener(new RemoveAdminDescriptorListener(adminDescriptorAccordion)); form.addComponent(LayoutHelper.create("Admin Descriptors", accordionPanel, LABEL_WIDTH, 300, false, new Button[] { addAdminDescButton, editAdminDescButton, delAdminDescButton })); }
From source file:de.escidoc.admintool.view.util.LayoutHelper.java
License:Open Source License
/** * Helper method. Puts a blank in front of a component. * /*from w w w. j ava 2 s .co m*/ * @param label * The label in front of the control. * @param accordion * The accordion to display. * @param width * the fixed size of the label. The parameter has to be in CSS style, i.e. 400px for instance. * @param height * @param required * should it be marked with an asterisk. * @return The component in an horizontal layout. A blank in front and afterwards is inserted. */ public static synchronized HorizontalLayout create(final String label, final Accordion accordion, final int width, final int height, final boolean required) { final HorizontalLayout hor = new HorizontalLayout(); hor.setHeight(height + Constants.PX); hor.addComponent(new Label(" ")); final String text = Constants.P_ALIGN_RIGHT + label + Constants.P; Label l; hor.addComponent(l = new Label(text, Label.CONTENT_XHTML)); l.setSizeUndefined(); l.setWidth(width + Constants.PX); hor.setComponentAlignment(l, Alignment.MIDDLE_RIGHT); if (required) { hor.addComponent(new Label( " <span style=\"color:red; position:relative; top:" + (height / 2 - 13) + "px;\">*</span>", Label.CONTENT_XHTML)); } else { hor.addComponent(new Label(" ", Label.CONTENT_XHTML)); } final Panel pan = new Panel(); pan.setSizeFull(); // Have it take all space available in the layout. accordion.setSizeFull(); // Some components to put in the Accordion. final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<root>\n\t<X>\n\t\t<today>\n\t\t</today>\n\t\t<today/>\n\t\t<today/>\n\t</X>\n</root>"; for (int i = 0; i < 30; i++) { accordion.addTab(new Label(xml, Label.CONTENT_PREFORMATTED), "Tab" + i, null); } pan.addComponent(accordion); // pan.setSizeUndefined(); pan.setWidth(accordion.getWidth() + Constants.PX); // pan.setHeight("500px"); pan.setStyleName(Reindeer.PANEL_LIGHT); hor.addComponent(pan); hor.setComponentAlignment(pan, Alignment.MIDDLE_RIGHT); hor.addComponent(new Label(" ")); hor.setSpacing(false); return hor; }
From source file:de.gedoplan.webclients.vaadin.VaadinDemoUi.java
public Panel createFooter() { Panel footer = new Panel(); footer.setStyleName(ValoTheme.PANEL_WELL); footer.setHeight(75, Unit.PIXELS);//from w w w . j a v a 2 s.com Label footerText = new Label(" 2016 gedoplan.de"); footerText.setSizeUndefined(); VerticalLayout footerLayout = new VerticalLayout(); footerLayout.setSizeFull(); footerLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); footerLayout.addComponent(footerText); footer.setContent(footerLayout); return footer; }
From source file:de.gedoplan.webclients.vaadin.views.CustomerDetailView.java
public void init() { Double discount = customerService.calculateCustomerDiscount(customer.getCustomerID()).getDiscount(); Label name = new Label(new PropertyFormatter(form.getProperty(Customer_.companyName)) { @Override//from w ww . jav a 2s. c om public String format(Object value) { return value + " (" + customer.getCustomerID() + ")"; } @Override public Object parse(String formattedValue) throws Exception { throw new UnsupportedOperationException("Not supported yet."); } }); name.setStyleName(ValoTheme.LABEL_BOLD); Label rabattLabel = new Label(Messages.customer_discount.value()); rabattLabel.setStyleName(ValoTheme.LABEL_BOLD); rabattLabel.setSizeUndefined(); Label rabatt = new Label(new DecimalFormat("#0.00").format(discount) + "%"); rabatt.setSizeUndefined(); rabatt.addStyleName(ValoTheme.LABEL_COLORED); rabatt.addStyleName(ValoTheme.LABEL_BOLD); HorizontalLayout headline = new HorizontalLayout(name, rabattLabel, rabatt); headline.setComponentAlignment(rabatt, Alignment.TOP_RIGHT); headline.setExpandRatio(name, 1); headline.setWidth(100, Unit.PERCENTAGE); headline.setSpacing(true); headline.setStyleName(ValoTheme.LAYOUT_WELL); headline.setMargin(new MMarginInfo(false, true)); Panel panel = new Panel(); panel.setContent(form); setMargin(true); setSpacing(true); addComponents(headline, panel); }
From source file:de.mendelson.comm.as2.webclient2.AboutDialog.java
/**Could be overwritten, contains the content to display*/ @Override/*from w ww . j a v a 2 s . co m*/ public AbstractComponent getContentPanel() { int maxX = 7; Panel panel = new Panel(); GridLayout gridLayout = new GridLayout(maxX, 17); gridLayout.setSizeFull(); Embedded logComm = new Embedded("", new ThemeResource("images/logocommprotocols.gif")); logComm.setType(Embedded.TYPE_IMAGE); VerticalLayout gapLayout = new VerticalLayout(); gapLayout.setMargin(false, true, true, false); gapLayout.addComponent(logComm); gridLayout.addComponent(gapLayout, 0, 0, 1, 3); gridLayout.addComponent( new Label("<strong>" + AS2ServerVersion.getFullProductName() + "</strong>", Label.CONTENT_XHTML), 2, 1, maxX - 1, 1); gridLayout.addComponent(new Label(AS2ServerVersion.getLastModificationDate()), 2, 2, maxX - 1, 2); gridLayout.addComponent(new Label("<hr/>", Label.CONTENT_XHTML), 0, 4, maxX - 1, 4); gridLayout.addComponent(new Label(Copyright.getCopyrightMessage(), Label.CONTENT_XHTML), 0, 5, maxX - 1, 5); gridLayout.addComponent(new Label(AS2ServerVersion.getStreet(), Label.CONTENT_XHTML), 0, 6, maxX - 1, 6); gridLayout.addComponent(new Label(AS2ServerVersion.getZip(), Label.CONTENT_XHTML), 0, 7, maxX - 1, 7); gridLayout.addComponent(new Label(AS2ServerVersion.getTelephone(), Label.CONTENT_XHTML), 0, 8, maxX - 1, 8); gridLayout.addComponent(new Label(AS2ServerVersion.getInfoEmail(), Label.CONTENT_XHTML), 0, 9, maxX - 1, 9); gridLayout.addComponent(new Label("<hr/>", Label.CONTENT_XHTML), 0, 10, 6, 10); gridLayout.addComponent( new Link("http://www.mendelson.de", new ExternalResource("http://www.mendelson.de")), 0, 11, maxX - 1, 11); gridLayout.addComponent( new Link("http://www.mendelson-e-c.com", new ExternalResource("http://www.mendelson-e-c.com")), 0, 12, maxX - 1, 12); gridLayout.addComponent(new Label("<hr/>", Label.CONTENT_XHTML), 0, 13, maxX - 1, 13); gridLayout.addComponent(new Label("<br/>", Label.CONTENT_XHTML), 0, 14, maxX - 1, 14); gridLayout.addComponent( new Label("[Based on VAADIN " + com.vaadin.terminal.gwt.server.ApplicationServlet.VERSION + "]"), 0, 16, maxX - 1, 16); panel.addComponent(gridLayout); return (panel); }
From source file:de.mendelson.comm.as2.webclient2.OkDialog.java
/**Could be overwritten, contains the content to display*/ public AbstractComponent getContentPanel() { Panel panel = new Panel(); return (panel); }
From source file:de.mendelson.comm.as2.webclient2.StateDialog.java
/** * Could be overwritten, contains the content to display */// ww w. j ava2 s. c om @Override public AbstractComponent getContentPanel() { DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); Panel panel = new Panel(); StringBuilder sourceBuffer = new StringBuilder(); boolean processingUnitUp = false; AnonymousTextClient client = null; try { client = new AnonymousTextClient(); PreferencesAS2 preferences = new PreferencesAS2(); client.connect("localhost", preferences.getInt(PreferencesAS2.CLIENTSERVER_COMM_PORT), 30000); ServerInfoResponse response = (ServerInfoResponse) client.sendSync(new ServerInfoRequest(), 30000); long startTime = new Long(response.getProperties().getProperty(ServerInfoResponse.SERVER_START_TIME)) .longValue(); sourceBuffer.append("<p>The AS2 processing unit <strong>" + response.getProperties().getProperty(ServerInfoResponse.SERVER_PRODUCT_NAME) + " " + response.getProperties().getProperty(ServerInfoResponse.SERVER_VERSION) + " " + response.getProperties().getProperty(ServerInfoResponse.SERVER_BUILD) + "</strong> is up and running since <strong>" + format.format(startTime) + "</strong></p>."); processingUnitUp = true; } catch (Exception e) { sourceBuffer.append("Error connecting to AS2 processing unit: "); sourceBuffer.append(e.getMessage()); } finally { if (client != null && client.isConnected()) { client.disconnect(); } } sourceBuffer.append("<br><br>"); if (processingUnitUp) { sourceBuffer.append( "<strong><font color='green'>System status is fine.</font></strong><br><br><br>Please send your AS2 messages now to <a href=\"/as2/HttpReceiver\" target=\"_new\"><strong>HttpReceiver</strong></a>."); } else { sourceBuffer.append( "<strong><font color='red'>Errors encounted.</font></strong><br>Please fix them before sending messages to <a href=\"/as2/HttpReceiver\" target=\"_new\"><strong>HttpReceiver</strong></a>."); } sourceBuffer.append( "<br><br><br><hr><p>If you are running into any problem please visit the forum at <a href=\"http://community.mendelson-e-c.com\"><strong>community.mendelson-e-c.com</strong></a> or contact the mendelson team by sending a mail to <a href=\"mailto: info@mendelson.de\"><strong>info@mendelson.de</strong></a>.</p>"); Label label = new Label(sourceBuffer.toString(), Label.CONTENT_XHTML); panel.addComponent(label); return (panel); }