List of usage examples for com.vaadin.ui Panel setSizeFull
@Override public void setSizeFull()
From source file:org.ikasan.dashboard.ui.administration.panel.UserDirectoriesPanel.java
License:BSD License
protected void init() { Label userDirectories = new Label("User Directories"); userDirectories.setStyleName(ValoTheme.LABEL_HUGE); Label parapraphOne = new Label(); parapraphOne.setCaptionAsHtml(true); parapraphOne.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " The table below shows the user directories currently configured for Ikasan."); parapraphOne.addStyleName(ValoTheme.LABEL_TINY); parapraphOne.addStyleName(ValoTheme.LABEL_LIGHT); Label parapraphTwo = new Label(); parapraphTwo.setCaptionAsHtml(true); parapraphTwo.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " The order of the directory is the order in which it will be searched for users and groups." + " It is recommended that each user exists in a single directory."); parapraphTwo.addStyleName(ValoTheme.LABEL_TINY); parapraphTwo.addStyleName(ValoTheme.LABEL_LIGHT); this.mainLayout.setWidth("100%"); this.mainLayout.setSpacing(true); this.mainLayout.addComponent(userDirectories); this.mainLayout.addComponent(parapraphOne); this.mainLayout.addComponent(parapraphTwo); Button newDirectoryButton = new Button("Add Directory"); newDirectoryButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { final UserDirectoryManagementPanel authMethodPanel = new UserDirectoryManagementPanel( new AuthenticationMethod(), securityService, authenticationProviderFactory, ldapService); Window window = new Window("Configure User Directory"); window.setModal(true);//from www. j a v a 2s. c om window.setHeight("90%"); window.setWidth("90%"); window.setContent(authMethodPanel); UI.getCurrent().addWindow(window); window.addCloseListener(new Window.CloseListener() { @Override public void windowClose(Window.CloseEvent e) { populateAll(); } }); } }); this.mainLayout.addComponent(newDirectoryButton); this.setWidth("100%"); this.setHeight("100%"); this.directoryTable = new Table(); this.directoryTable.setWidth("100%"); this.directoryTable.setHeight("600px"); this.directoryTable.setCellStyleGenerator(new IkasanCellStyleGenerator()); this.directoryTable.addContainerProperty("Directory Name", String.class, null); this.directoryTable.addContainerProperty("Type", String.class, null); this.directoryTable.addContainerProperty("Order", Layout.class, null); this.directoryTable.addContainerProperty("Operations", Layout.class, null); this.directoryTable.setColumnExpandRatio("Directory Name", 25); this.directoryTable.setColumnExpandRatio("Type", 25); this.directoryTable.setColumnAlignment("Order", Align.CENTER); this.directoryTable.setColumnExpandRatio("Order", 10); this.directoryTable.setColumnAlignment("Operations", Align.CENTER); this.directoryTable.setColumnWidth("Operations", 300); this.mainLayout.addComponent(this.directoryTable); this.mainLayout.setMargin(true); Panel wrapperPanel = new Panel(); wrapperPanel.addStyleName(ValoTheme.PANEL_BORDERLESS); wrapperPanel.setSizeFull(); wrapperPanel.setContent(this.mainLayout); HorizontalLayout wrapperLayout = new HorizontalLayout(); wrapperLayout.setSizeFull(); wrapperLayout.setMargin(true); wrapperLayout.addComponent(wrapperPanel); this.setContent(wrapperLayout); }
From source file:org.ikasan.dashboard.ui.monitor.component.MonitorPanel.java
License:BSD License
public Component buildServerComponent() { Panel component = new Panel(); component.setSizeFull(); component.addStyleName(ValoTheme.PANEL_BORDERLESS); GridLayout layout = new GridLayout(2, 4); layout.setSizeFull();/*from w w w. j a va 2s. c o m*/ layout.setMargin(true); Label serverNameLabel = new Label(server.getName()); serverNameLabel.setStyleName(ValoTheme.LABEL_LARGE); serverNameLabel.setWidth("100%"); Label serverDescriptionLabel = new Label(server.getDescription()); serverDescriptionLabel.setWidth("100%"); serverDescriptionLabel.setStyleName(ValoTheme.LABEL_LARGE); Label serverUrlLabel = new Label(server.getUrl() + ":" + server.getPort()); serverUrlLabel.setStyleName(ValoTheme.LABEL_LARGE); serverUrlLabel.setWidth("100%"); layout.addComponent(serverNameLabel, 0, 0); layout.addComponent(serverDescriptionLabel, 0, 1); layout.addComponent(serverUrlLabel, 0, 2); statusLabel.setCaptionAsHtml(true); MonitorIcons icon = MonitorIcons.SERVER; icon.setSizePixels(64); Label serverLabel = new Label(); serverLabel.setCaption(icon.getHtml()); serverLabel.setCaptionAsHtml(true); layout.addComponent(serverLabel, 1, 0, 1, 2); layout.setComponentAlignment(serverLabel, Alignment.MIDDLE_CENTER); layout.addComponent(statusLabel, 0, 3, 1, 3); layout.setComponentAlignment(statusLabel, Alignment.MIDDLE_CENTER); buildFilterTable(); component.setContent(layout); Component contentWrapper = createContentWrapper(component, buildFilterTable()); contentWrapper.addStyleName("top10-revenue"); return contentWrapper; }
From source file:org.ikasan.dashboard.ui.topology.window.ActionedExclusionEventViewWindow.java
License:BSD License
protected Panel createExclusionEventDetailsPanel() { Panel exclusionEventDetailsPanel = new Panel(); exclusionEventDetailsPanel.setSizeFull(); exclusionEventDetailsPanel.setStyleName("dashboard"); GridLayout layout = new GridLayout(4, 7); layout.setSpacing(true);/*from w ww . j ava2s.co m*/ layout.setColumnExpandRatio(0, .10f); layout.setColumnExpandRatio(1, .30f); layout.setColumnExpandRatio(2, .05f); layout.setColumnExpandRatio(3, .30f); layout.setWidth("100%"); Label exclusionEvenDetailsLabel = new Label("Actioned Exclusion Event Details"); exclusionEvenDetailsLabel.setStyleName(ValoTheme.LABEL_HUGE); layout.addComponent(exclusionEvenDetailsLabel, 0, 0, 3, 0); Label label = new Label("Module Name:"); label.setSizeUndefined(); layout.addComponent(label, 0, 1); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf1 = new TextField(); tf1.setValue(this.action.getModuleName()); tf1.setReadOnly(true); tf1.setWidth("80%"); layout.addComponent(tf1, 1, 1); label = new Label("Flow Name:"); label.setSizeUndefined(); layout.addComponent(label, 0, 2); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf2 = new TextField(); tf2.setValue(this.action.getFlowName()); tf2.setReadOnly(true); tf2.setWidth("80%"); layout.addComponent(tf2, 1, 2); label = new Label("Event Id:"); label.setSizeUndefined(); layout.addComponent(label, 0, 3); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf3 = new TextField(); tf3.setValue(this.errorOccurrence.getEventLifeIdentifier()); tf3.setReadOnly(true); tf3.setWidth("80%"); layout.addComponent(tf3, 1, 3); label = new Label("Date/Time:"); label.setSizeUndefined(); layout.addComponent(label, 0, 4); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf4 = new TextField(); tf4.setValue(new Date(this.action.getTimestamp()).toString()); tf4.setReadOnly(true); tf4.setWidth("80%"); layout.addComponent(tf4, 1, 4); label = new Label("Error URI:"); label.setSizeUndefined(); layout.addComponent(label, 0, 5); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf5 = new TextField(); tf5.setValue(this.action.getErrorUri()); tf5.setReadOnly(true); tf5.setWidth("80%"); layout.addComponent(tf5, 1, 5); label = new Label("Action:"); label.setSizeUndefined(); layout.addComponent(label, 2, 1); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); final TextField tf6 = new TextField(); if (this.action != null) { tf6.setValue(action.getAction()); } tf6.setReadOnly(true); tf6.setWidth("80%"); layout.addComponent(tf6, 3, 1); label = new Label("Actioned By:"); label.setSizeUndefined(); layout.addComponent(label, 2, 2); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); final TextField tf7 = new TextField(); if (this.action != null) { tf7.setValue(action.getActionedBy()); } tf7.setReadOnly(true); tf7.setWidth("80%"); layout.addComponent(tf7, 3, 2); label = new Label("Actioned Time:"); label.setSizeUndefined(); layout.addComponent(label, 2, 3); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); final TextField tf8 = new TextField(); if (this.action != null) { tf8.setValue(new Date(action.getTimestamp()).toString()); } tf8.setReadOnly(true); tf8.setWidth("80%"); layout.addComponent(tf8, 3, 3); AceEditor eventEditor = new AceEditor(); eventEditor.setCaption("Event Payload"); Object event = this.serialiserFactory.getDefaultSerialiser().deserialise(this.action.getEvent()); eventEditor.setValue(event.toString()); eventEditor.setReadOnly(true); eventEditor.setMode(AceMode.java); eventEditor.setTheme(AceTheme.eclipse); eventEditor.setWidth("100%"); eventEditor.setHeight(600, Unit.PIXELS); HorizontalLayout eventEditorLayout = new HorizontalLayout(); eventEditorLayout.setSizeFull(); eventEditorLayout.setMargin(true); eventEditorLayout.addComponent(eventEditor); AceEditor errorEditor = new AceEditor(); errorEditor.setCaption("Error Details"); errorEditor.setValue(this.errorOccurrence.getErrorDetail()); errorEditor.setReadOnly(true); errorEditor.setMode(AceMode.xml); errorEditor.setTheme(AceTheme.eclipse); errorEditor.setWidth("100%"); errorEditor.setHeight(600, Unit.PIXELS); HorizontalLayout errorEditorLayout = new HorizontalLayout(); errorEditorLayout.setSizeFull(); errorEditorLayout.setMargin(true); errorEditorLayout.addComponent(errorEditor); VerticalSplitPanel splitPanel = new VerticalSplitPanel(); splitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE); splitPanel.setWidth("100%"); splitPanel.setHeight(800, Unit.PIXELS); splitPanel.setFirstComponent(eventEditorLayout); splitPanel.setSecondComponent(errorEditorLayout); HorizontalLayout formLayout = new HorizontalLayout(); formLayout.setWidth("100%"); formLayout.setHeight(220, Unit.PIXELS); formLayout.addComponent(layout); GridLayout wrapperLayout = new GridLayout(1, 4); wrapperLayout.setMargin(true); wrapperLayout.setWidth("100%"); wrapperLayout.addComponent(formLayout); wrapperLayout.addComponent(splitPanel); exclusionEventDetailsPanel.setContent(wrapperLayout); return exclusionEventDetailsPanel; }
From source file:org.ikasan.dashboard.ui.topology.window.ExclusionEventViewWindow.java
License:BSD License
protected Panel createExclusionEventDetailsPanel() { Panel exclusionEventDetailsPanel = new Panel(); exclusionEventDetailsPanel.setSizeFull(); exclusionEventDetailsPanel.setStyleName("dashboard"); GridLayout layout = new GridLayout(4, 7); layout.setSpacing(true);//from w w w . j av a 2 s . com layout.setColumnExpandRatio(0, .10f); layout.setColumnExpandRatio(1, .30f); layout.setColumnExpandRatio(2, .05f); layout.setColumnExpandRatio(3, .30f); layout.setWidth("100%"); Label exclusionEvenDetailsLabel = new Label("Exclusion Event Details"); exclusionEvenDetailsLabel.setStyleName(ValoTheme.LABEL_HUGE); layout.addComponent(exclusionEvenDetailsLabel, 0, 0, 3, 0); Label label = new Label("Module Name:"); label.setSizeUndefined(); layout.addComponent(label, 0, 1); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf1 = new TextField(); tf1.setValue(this.exclusionEvent.getModuleName()); tf1.setReadOnly(true); tf1.setWidth("80%"); layout.addComponent(tf1, 1, 1); label = new Label("Flow Name:"); label.setSizeUndefined(); layout.addComponent(label, 0, 2); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf2 = new TextField(); tf2.setValue(this.exclusionEvent.getFlowName()); tf2.setReadOnly(true); tf2.setWidth("80%"); layout.addComponent(tf2, 1, 2); label = new Label("Event Id:"); label.setSizeUndefined(); layout.addComponent(label, 0, 3); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf3 = new TextField(); tf3.setValue(this.errorOccurrence.getEventLifeIdentifier()); tf3.setReadOnly(true); tf3.setWidth("80%"); layout.addComponent(tf3, 1, 3); label = new Label("Date/Time:"); label.setSizeUndefined(); layout.addComponent(label, 0, 4); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf4 = new TextField(); tf4.setValue(new Date(this.exclusionEvent.getTimestamp()).toString()); tf4.setReadOnly(true); tf4.setWidth("80%"); layout.addComponent(tf4, 1, 4); label = new Label("Error URI:"); label.setSizeUndefined(); layout.addComponent(label, 0, 5); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); TextField tf5 = new TextField(); tf5.setValue(exclusionEvent.getErrorUri()); tf5.setReadOnly(true); tf5.setWidth("80%"); layout.addComponent(tf5, 1, 5); label = new Label("Action:"); label.setSizeUndefined(); layout.addComponent(label, 2, 1); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); final TextField tf6 = new TextField(); if (this.action != null) { tf6.setValue(action.getAction()); } tf6.setReadOnly(true); tf6.setWidth("80%"); layout.addComponent(tf6, 3, 1); label = new Label("Actioned By:"); label.setSizeUndefined(); layout.addComponent(label, 2, 2); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); final TextField tf7 = new TextField(); if (this.action != null) { tf7.setValue(action.getActionedBy()); } tf7.setReadOnly(true); tf7.setWidth("80%"); layout.addComponent(tf7, 3, 2); label = new Label("Actioned Time:"); label.setSizeUndefined(); layout.addComponent(label, 2, 3); layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT); final TextField tf8 = new TextField(); if (this.action != null) { tf8.setValue(new Date(action.getTimestamp()).toString()); } tf8.setReadOnly(true); tf8.setWidth("80%"); layout.addComponent(tf8, 3, 3); final Button resubmitButton = new Button("Re-submit"); final Button ignoreButton = new Button("Ignore"); resubmitButton.addClickListener(new Button.ClickListener() { @SuppressWarnings("unchecked") public void buttonClick(ClickEvent event) { IkasanAuthentication authentication = (IkasanAuthentication) VaadinService.getCurrentRequest() .getWrappedSession().getAttribute(DashboardSessionValueConstants.USER); HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(authentication.getName(), (String) authentication.getCredentials()); ClientConfig clientConfig = new ClientConfig(); clientConfig.register(feature); Client client = ClientBuilder.newClient(clientConfig); Module module = topologyService.getModuleByName(exclusionEvent.getModuleName()); if (module == null) { Notification .show("Unable to find server information for module we are attempting to re-submit to: " + exclusionEvent.getModuleName(), Type.ERROR_MESSAGE); return; } Server server = module.getServer(); String url = "http://" + server.getUrl() + ":" + server.getPort() + module.getContextRoot() + "/rest/resubmission/resubmit/" + exclusionEvent.getModuleName() + "/" + exclusionEvent.getFlowName() + "/" + exclusionEvent.getErrorUri(); logger.info("Resubmission Url: " + url); WebTarget webTarget = client.target(url); Response response = webTarget.request() .put(Entity.entity(exclusionEvent.getEvent(), MediaType.APPLICATION_OCTET_STREAM)); if (response.getStatus() != 200) { response.bufferEntity(); String responseMessage = response.readEntity(String.class); Notification.show("An error was received trying to resubmit event: " + responseMessage, Type.ERROR_MESSAGE); } else { Notification.show("Event resumitted successfully."); resubmitButton.setVisible(false); ignoreButton.setVisible(false); ExclusionEventAction action = hospitalManagementService .getExclusionEventActionByErrorUri(exclusionEvent.getErrorUri()); tf6.setReadOnly(false); tf7.setReadOnly(false); tf8.setReadOnly(false); tf6.setValue(action.getAction()); tf7.setValue(action.getActionedBy()); tf8.setValue(new Date(action.getTimestamp()).toString()); tf6.setReadOnly(true); tf7.setReadOnly(true); tf8.setReadOnly(true); } } }); ignoreButton.addClickListener(new Button.ClickListener() { @SuppressWarnings("unchecked") public void buttonClick(ClickEvent event) { IkasanAuthentication authentication = (IkasanAuthentication) VaadinService.getCurrentRequest() .getWrappedSession().getAttribute(DashboardSessionValueConstants.USER); HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(authentication.getName(), (String) authentication.getCredentials()); ClientConfig clientConfig = new ClientConfig(); clientConfig.register(feature); Client client = ClientBuilder.newClient(clientConfig); Module module = topologyService.getModuleByName(exclusionEvent.getModuleName()); if (module == null) { Notification .show("Unable to find server information for module we are submitting the ignore to: " + exclusionEvent.getModuleName(), Type.ERROR_MESSAGE); return; } Server server = module.getServer(); String url = "http://" + server.getUrl() + ":" + server.getPort() + module.getContextRoot() + "/rest/resubmission/ignore/" + exclusionEvent.getModuleName() + "/" + exclusionEvent.getFlowName() + "/" + exclusionEvent.getErrorUri(); logger.info("Ignore Url: " + url); WebTarget webTarget = client.target(url); Response response = webTarget.request() .put(Entity.entity(exclusionEvent.getEvent(), MediaType.APPLICATION_OCTET_STREAM)); if (response.getStatus() != 200) { response.bufferEntity(); String responseMessage = response.readEntity(String.class); Notification.show("An error was received trying to resubmit event: " + responseMessage, Type.ERROR_MESSAGE); } else { Notification.show("Event ignored successfully."); resubmitButton.setVisible(false); ignoreButton.setVisible(false); ExclusionEventAction action = hospitalManagementService .getExclusionEventActionByErrorUri(exclusionEvent.getErrorUri()); tf6.setReadOnly(false); tf7.setReadOnly(false); tf8.setReadOnly(false); tf6.setValue(action.getAction()); tf7.setValue(action.getActionedBy()); tf8.setValue(new Date(action.getTimestamp()).toString()); tf6.setReadOnly(true); tf7.setReadOnly(true); tf8.setReadOnly(true); } } }); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setHeight("100%"); buttonLayout.setSpacing(true); buttonLayout.setWidth(200, Unit.PIXELS); buttonLayout.setMargin(true); buttonLayout.addComponent(resubmitButton); buttonLayout.addComponent(ignoreButton); if (this.action == null) { layout.addComponent(buttonLayout, 0, 6, 3, 6); layout.setComponentAlignment(buttonLayout, Alignment.MIDDLE_CENTER); } final IkasanAuthentication authentication = (IkasanAuthentication) VaadinService.getCurrentRequest() .getWrappedSession().getAttribute(DashboardSessionValueConstants.USER); if (authentication != null && (!authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) && !authentication.hasGrantedAuthority(SecurityConstants.ACTION_EXCLUSIONS_AUTHORITY))) { resubmitButton.setVisible(false); ignoreButton.setVisible(false); } AceEditor eventEditor = new AceEditor(); eventEditor.setCaption("Event Payload"); logger.info("Setting exclusion event to: " + new String(this.exclusionEvent.getEvent())); Object event = this.serialiserFactory.getDefaultSerialiser().deserialise(this.exclusionEvent.getEvent()); eventEditor.setValue(event.toString()); eventEditor.setReadOnly(true); eventEditor.setMode(AceMode.java); eventEditor.setTheme(AceTheme.eclipse); eventEditor.setWidth("100%"); eventEditor.setHeight(600, Unit.PIXELS); HorizontalLayout eventEditorLayout = new HorizontalLayout(); eventEditorLayout.setSizeFull(); eventEditorLayout.setMargin(true); eventEditorLayout.addComponent(eventEditor); AceEditor errorEditor = new AceEditor(); errorEditor.setCaption("Error Details"); errorEditor.setValue(this.errorOccurrence.getErrorDetail()); errorEditor.setReadOnly(true); errorEditor.setMode(AceMode.xml); errorEditor.setTheme(AceTheme.eclipse); errorEditor.setWidth("100%"); errorEditor.setHeight(600, Unit.PIXELS); HorizontalLayout errorEditorLayout = new HorizontalLayout(); errorEditorLayout.setSizeFull(); errorEditorLayout.setMargin(true); errorEditorLayout.addComponent(errorEditor); VerticalSplitPanel splitPanel = new VerticalSplitPanel(); splitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE); splitPanel.setWidth("100%"); splitPanel.setHeight(800, Unit.PIXELS); HorizontalLayout h1 = new HorizontalLayout(); h1.setSizeFull(); h1.setMargin(true); h1.addComponent(eventEditorLayout); splitPanel.setFirstComponent(eventEditorLayout); HorizontalLayout h2 = new HorizontalLayout(); h2.setSizeFull(); h2.setMargin(true); h2.addComponent(errorEditorLayout); splitPanel.setSecondComponent(errorEditorLayout); HorizontalLayout formLayout = new HorizontalLayout(); formLayout.setWidth("100%"); formLayout.setHeight(240, Unit.PIXELS); formLayout.addComponent(layout); GridLayout wrapperLayout = new GridLayout(1, 4); wrapperLayout.setMargin(true); wrapperLayout.setWidth("100%"); wrapperLayout.addComponent(formLayout); wrapperLayout.addComponent(splitPanel); exclusionEventDetailsPanel.setContent(wrapperLayout); return exclusionEventDetailsPanel; }
From source file:org.ikasan.dashboard.ui.topology.window.WiretapPayloadViewWindow.java
License:BSD License
protected Panel createWiretapDetailsPanel() { Panel errorOccurrenceDetailsPanel = new Panel(); errorOccurrenceDetailsPanel.setSizeFull(); errorOccurrenceDetailsPanel.setStyleName("dashboard"); GridLayout layout = new GridLayout(2, 6); layout.setSizeFull();/* w ww. ja va2s . c o m*/ layout.setSpacing(true); layout.setColumnExpandRatio(0, 0.2f); layout.setColumnExpandRatio(1, 0.8f); Label wiretapDetailsLabel = new Label("Wiretap Details"); wiretapDetailsLabel.setStyleName(ValoTheme.LABEL_HUGE); layout.addComponent(wiretapDetailsLabel); Label moduleNameLabel = new Label("Module Name:"); moduleNameLabel.setSizeUndefined(); layout.addComponent(moduleNameLabel, 0, 1); layout.setComponentAlignment(moduleNameLabel, Alignment.MIDDLE_RIGHT); TextField moduleName = new TextField(); moduleName.setValue(this.wiretapEvent.getModuleName()); moduleName.setReadOnly(true); moduleName.setWidth("80%"); layout.addComponent(moduleName, 1, 1); Label flowNameLabel = new Label("Flow Name:"); flowNameLabel.setSizeUndefined(); layout.addComponent(flowNameLabel, 0, 2); layout.setComponentAlignment(flowNameLabel, Alignment.MIDDLE_RIGHT); TextField tf2 = new TextField(); tf2.setValue(this.wiretapEvent.getFlowName()); tf2.setReadOnly(true); tf2.setWidth("80%"); layout.addComponent(tf2, 1, 2); Label componentNameLabel = new Label("Component Name:"); componentNameLabel.setSizeUndefined(); layout.addComponent(componentNameLabel, 0, 3); layout.setComponentAlignment(componentNameLabel, Alignment.MIDDLE_RIGHT); TextField tf3 = new TextField(); tf3.setValue(this.wiretapEvent.getComponentName()); tf3.setReadOnly(true); tf3.setWidth("80%"); layout.addComponent(tf3, 1, 3); Label dateTimeLabel = new Label("Date/Time:"); dateTimeLabel.setSizeUndefined(); layout.addComponent(dateTimeLabel, 0, 4); layout.setComponentAlignment(dateTimeLabel, Alignment.MIDDLE_RIGHT); TextField tf4 = new TextField(); tf4.setValue(new Date(this.wiretapEvent.getTimestamp()).toString()); tf4.setReadOnly(true); tf4.setWidth("80%"); layout.addComponent(tf4, 1, 4); Label eventIdLabel = new Label("Event Id:"); eventIdLabel.setSizeUndefined(); layout.addComponent(eventIdLabel, 0, 5); layout.setComponentAlignment(eventIdLabel, Alignment.MIDDLE_RIGHT); TextField tf5 = new TextField(); tf5.setValue(((WiretapFlowEvent) wiretapEvent).getEventId()); tf5.setReadOnly(true); tf5.setWidth("80%"); layout.addComponent(tf5, 1, 5); GridLayout wrapperLayout = new GridLayout(1, 4); wrapperLayout.setWidth("100%"); // wrapperLayout.setMargin(true); // wrapperLayout.setSizeFull(); AceEditor editor = new AceEditor(); editor.setCaption("Event"); editor.setValue(this.wiretapEvent.getEvent()); editor.setReadOnly(true); editor.setMode(AceMode.xml); editor.setTheme(AceTheme.eclipse); editor.setWidth("100%"); editor.setHeight(550, Unit.PIXELS); // HorizontalLayout formLayout = new HorizontalLayout(); // formLayout.setWidth("100%"); // formLayout.setHeight(120, Unit.PIXELS); // formLayout.addComponent(layout); wrapperLayout.addComponent(layout, 0, 0); wrapperLayout.addComponent(editor, 0, 2); wrapperLayout.setComponentAlignment(editor, Alignment.TOP_LEFT); errorOccurrenceDetailsPanel.setContent(wrapperLayout); return errorOccurrenceDetailsPanel; }
From source file:org.jpos.qi.QIEntityView.java
License:Open Source License
public void showSpecificView(final String parameter) { Object o = null;//from ww w.ja va 2 s. c om String[] params = parameter.split("/|\\?"); if (params.length > 0) { if ("new".equals(params[0]) && canAdd()) { o = createNewEntity(); newView = true; } else { o = getEntityByParam(params[0]); } if (parameter.contains("?")) { //Has query params. String[] queryParams = params[params.length - 1].split(","); for (String queryParam : queryParams) { String[] keyValue = queryParam.split("="); if (keyValue.length > 0 && "back".equals(keyValue[0])) { setGeneralRoute("/" + keyValue[1].replace(".", "/")); } } } } if (o == null) { getApp().getNavigator().navigateTo(""); getApp().displayNotification(getApp().getMessage("errorMessage.notExists", "<strong>" + getEntityName().toUpperCase() + "</strong>: " + params[0])); return; } Layout header = createHeader(title + ": " + getHeaderSpecificTitle(o)); addComponent(header); Panel panel = new Panel(); panel.setSizeFull(); addComponent(panel); final Layout formLayout = createForm(o, params, "new".equals(params[0])); panel.setContent(formLayout); setExpandRatio(panel, 1); if (!"new".equals(params[0]) && isShowRevisionHistoryButton()) { final Button showRevision = new Button(getApp().getMessage("showRevisionHistory")); showRevision.setStyleName(ValoTheme.BUTTON_LINK); showRevision.addClickListener(event -> { if (getApp().getMessage("showRevisionHistory").equals(event.getButton().getCaption())) { event.getButton().setCaption(getApp().getMessage("hideRevisionHistory")); loadRevisionHistory(formLayout, getEntityName().toLowerCase() + "." + params[0]); } else { event.getButton().setCaption(getApp().getMessage("showRevisionHistory")); formLayout.removeComponent(revisionsPanel); } }); formLayout.addComponent(showRevision); } }
From source file:org.jumpmind.metl.ui.mapping.EditMappingPanel.java
License:Open Source License
protected void buildUI() { if (!readOnly) { ButtonBar buttonBar = new ButtonBar(); addComponent(buttonBar);/* ww w. j ava 2s .com*/ Button autoMapButton = buttonBar.addButton("Auto Map", FontAwesome.FLASH); removeButton = buttonBar.addButton("Remove", FontAwesome.TRASH_O); removeButton.setEnabled(false); autoMapButton.addClickListener(new AutoMapListener()); removeButton.addClickListener(new RemoveListener()); } HorizontalLayout titleHeader = new HorizontalLayout(); titleHeader.setSpacing(true); titleHeader.setMargin(new MarginInfo(false, true, false, true)); titleHeader.setWidth(100f, Unit.PERCENTAGE); titleHeader.addComponent(new Label( "<b>Input Model:</b> " + (component.getInputModel() != null ? component.getInputModel().getName() : "?"), ContentMode.HTML)); titleHeader.addComponent(new Label( "<b>Output Model:</b> " + (component.getOutputModel() != null ? component.getOutputModel().getName() : "?"), ContentMode.HTML)); addComponent(titleHeader); HorizontalLayout filterHeader = new HorizontalLayout(); filterHeader.setSpacing(true); filterHeader.setMargin(new MarginInfo(true, true, true, true)); filterHeader.setWidth(100f, Unit.PERCENTAGE); HorizontalLayout srcFilterHeader = new HorizontalLayout(); srcFilterHeader.setSpacing(true); srcFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); filterHeader.addComponent(srcFilterHeader); HorizontalLayout dstFilterHeader = new HorizontalLayout(); dstFilterHeader.setSpacing(true); dstFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); filterHeader.addComponent(dstFilterHeader); addComponent(filterHeader); srcTextFilter = new TextField(); srcTextFilter.setInputPrompt("Filter"); srcTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); srcTextFilter.setIcon(FontAwesome.SEARCH); srcTextFilter.setImmediate(true); srcTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY); srcTextFilter.setTextChangeTimeout(200); srcTextFilter.addTextChangeListener(new FilterInputTextListener()); srcFilterHeader.addComponent(srcTextFilter); srcMapFilter = new CheckBox("Mapped Only"); srcMapFilter.addValueChangeListener(new FilterSrcMapListener()); srcFilterHeader.addComponent(srcMapFilter); dstTextFilter = new TextField(); dstTextFilter.setInputPrompt("Filter"); dstTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); dstTextFilter.setIcon(FontAwesome.SEARCH); dstTextFilter.setImmediate(true); dstTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY); dstTextFilter.setTextChangeTimeout(200); dstTextFilter.addTextChangeListener(new FilterOutputTextListener()); dstFilterHeader.addComponent(dstTextFilter); dstMapFilter = new CheckBox("Mapped Only"); dstMapFilter.addValueChangeListener(new FilterDstMapListener()); dstFilterHeader.addComponent(dstMapFilter); Panel panel = new Panel(); VerticalLayout vlay = new VerticalLayout(); vlay.setSizeFull(); diagram = new MappingDiagram(context, component, readOnly); diagram.setSizeFull(); vlay.addComponent(diagram); panel.setContent(vlay); panel.setSizeFull(); addComponent(panel); setExpandRatio(panel, 1.0f); diagram.addListener(new EventListener()); }
From source file:org.jumpmind.metl.ui.views.deploy.FlowSelectWindow.java
License:Open Source License
@SuppressWarnings({ "serial" }) public FlowSelectWindow(ApplicationContext context, String caption, String introText, boolean includeTestFlows) { super(caption); this.context = context; tree.setMultiSelect(true);// w w w . j ava2 s . c om tree.addContainerProperty("name", String.class, ""); tree.setItemCaptionPropertyId("name"); tree.setItemCaptionMode(ItemCaptionMode.PROPERTY); tree.addExpandListener(new ExpandListener() { public void nodeExpand(ExpandEvent event) { Object itemId = event.getItemId(); if (itemId instanceof ProjectVersion) { addFlowsToVersion((ProjectVersion) itemId, includeTestFlows); } } }); addProjects(); setWidth(600.0f, Unit.PIXELS); setHeight(600.0f, Unit.PIXELS); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(new Label(introText)); Panel scrollable = new Panel(); scrollable.addStyleName(ValoTheme.PANEL_BORDERLESS); scrollable.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR); scrollable.setSizeFull(); scrollable.setContent(tree); layout.addComponent(scrollable); layout.setExpandRatio(scrollable, 1.0f); addComponent(layout, 1); Button cancelButton = new Button("Cancel"); Button selectButton = new Button("Select"); addComponent(buildButtonFooter(cancelButton, selectButton)); cancelButton.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { close(); } }); selectButton.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { Collection<FlowName> flowCollection = getFlowCollection(includeTestFlows); listener.selected(flowCollection); close(); } }); }
From source file:org.jumpmind.metl.ui.views.design.TableColumnSelectWindow.java
License:Open Source License
public TableColumnSelectWindow(ApplicationContext context, Model model) { super("Import from Database into Model"); this.context = context; this.model = model; setWidth(600.0f, Unit.PIXELS);//from w w w . j av a 2s . c o m setHeight(600.0f, Unit.PIXELS); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(new Label("Select tables and columns to import into the model.")); Panel scrollable = new Panel(); scrollable.addStyleName(ValoTheme.PANEL_BORDERLESS); scrollable.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR); scrollable.setSizeFull(); provider = new DbProvider(context); dbTree = new DbTree(provider, new DefaultSettingsProvider(context.getConfigDir())); scrollable.setContent(dbTree); layout.addComponent(scrollable); layout.setExpandRatio(scrollable, 1.0f); addComponent(layout, 1); Button refreshButton = new Button("Refresh"); Button cancelButton = new Button("Cancel"); Button selectButton = new Button("Import"); addComponent(buildButtonFooter(refreshButton, cancelButton, selectButton)); cancelButton.addClickListener(event -> close()); selectButton.addClickListener(event -> select()); refreshButton.addClickListener(event -> refresh()); }
From source file:org.jumpmind.vaadin.ui.sqlexplorer.SqlExplorer.java
License:Open Source License
public SqlExplorer(String configDir, IDbProvider databaseProvider, ISettingsProvider settingsProvider, String user, float leftSplitSize, IDbMenuItem... additionalMenuItems) { this.databaseProvider = databaseProvider; this.settingsProvider = settingsProvider; this.savedSplitPosition = leftSplitSize; this.additionalMenuItems = additionalMenuItems; setSizeFull();/*from w ww.j a va 2s. co m*/ addStyleName("sqlexplorer"); VerticalLayout leftLayout = new VerticalLayout(); leftLayout.setSizeFull(); leftLayout.addStyleName(ValoTheme.MENU_ROOT); leftLayout.addComponent(buildLeftMenu()); Panel scrollable = new Panel(); scrollable.setSizeFull(); dbTree = buildDbTree(); scrollable.setContent(dbTree); leftLayout.addComponent(scrollable); leftLayout.setExpandRatio(scrollable, 1); VerticalLayout rightLayout = new VerticalLayout(); rightLayout.setSizeFull(); VerticalLayout rightMenuWrapper = new VerticalLayout(); rightMenuWrapper.setWidth(100, Unit.PERCENTAGE); rightMenuWrapper.addStyleName(ValoTheme.MENU_ROOT); contentMenuBar = new MenuBar(); contentMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS); contentMenuBar.setWidth(100, Unit.PERCENTAGE); addShowButton(contentMenuBar); rightMenuWrapper.addComponent(contentMenuBar); rightLayout.addComponent(rightMenuWrapper); contentTabs = new SqlExplorerTabPanel(); contentTabs.addSelectedTabChangeListener(new SelectedTabChangeListener() { private static final long serialVersionUID = 1L; @Override public void selectedTabChange(SelectedTabChangeEvent event) { selectContentTab((IContentTab) contentTabs.getSelectedTab()); } }); rightLayout.addComponent(contentTabs); rightLayout.setExpandRatio(contentTabs, 1); addComponents(leftLayout, rightLayout); setSplitPosition(savedSplitPosition, Unit.PIXELS); }