public FormLayout() { super(); setSpacing(true); setMargin(new MarginInfo(true, false)); setWidth(100, UNITS_PERCENTAGE); }
private Component createComponent(VertexRef ref) { final FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); final BusinessService businessService = businessServiceManager.getBusinessServiceById(((BusinessServiceVertex) ref).getServiceId()); for (Map.Entry<String, String> e : businessService.getAttributes().entrySet()) { formLayout.addComponent(createLabel(e.getKey(), e.getValue())); } return formLayout; }
public DefaultFormLayoutBuilder() { super(new FormLayout()); getInstance().setSizeUndefined(); getInstance().setMargin(false); }
public PropertiesForm() { super(); mainLayout = new FormLayout(); mainLayout.setMargin(true); mainLayout.setSpacing(true); mainLayout.setSizeUndefined(); mainLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE); setLayout(mainLayout); }
private Component createComponent(BusinessServiceEdge ref) { FormLayout formLayout = new FormLayout(); formLayout.setMargin(false); formLayout.setSpacing(false); formLayout.addComponent(createLabel("Map Function", describeMapFunction(ref.getMapFunction()))); formLayout.addComponent(createLabel("Weight", Float.toString(ref.getWeight()))); return formLayout; }
public DefaultFormLayoutBuilder() { super(new FormLayout()); getInstance().setSizeUndefined(); getInstance().setMargin(false); getInstance().setSpacing(false); }
public void view3() { // tag::view3[] PropertyViewForm viewForm = Components.view.form(new FormLayout()).properties(PROPERTIES) // .initializer(layout -> layout.setMargin(true)) // <1> .composer((layout, source) -> { // <2> source.getValueComponents().forEach(c -> layout.addComponent(c.getComponent())); }) // .componentConfigurator(DESCRIPTION, cfg -> cfg.styleName("my-style")) // <3> .componentsWidthMode(ComponentsWidthMode.FULL) // <4> .build(); // end::view3[] }
public FileUploadComponent(I18NSource i18NSource) { this.i18NSource = i18NSource; uploadFile.addStyleName("default"); uploadFile.setButtonCaption(i18NSource.getMessage(UPLOAD_START)); uploadFile.addListener((FailedListener) this); uploadFile.addListener((FinishedListener) this); uploadFile.addListener((ProgressListener) this); uploadFile.addListener((StartedListener) this); uploadFile.addListener((SucceededListener) this); mainPanel.setMargin(true); initView(); setCompositionRoot(mainPanel); }
private Component createComponent(EdgeRef ref) { FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); if (ref instanceof AbstractEdge) { AbstractEdge edge = (AbstractEdge) ref; formLayout.addComponent(createLabel("Source", edge.getSource().getVertex().getLabel())); formLayout.addComponent(createLabel("Target", edge.getTarget().getVertex().getLabel())); } return formLayout; }
private Component createComponent(EdgeRef ref) { FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); if (ref instanceof AbstractEdge) { AbstractEdge edge = (AbstractEdge) ref; formLayout.addComponent(createLabel("Source", edge.getSource().getVertex().getLabel())); formLayout.addComponent(createLabel("Target", edge.getTarget().getVertex().getLabel())); } return formLayout; }
private Panel issuePanel() { TextField id = new TextField("Card id"); TextField amount = new TextField("Amount"); Button submit = new Button("Submit"); submit.addClickListener(evt -> { commandGateway.sendAndWait(new IssueCmd(id.getValue(), Integer.parseInt(amount.getValue()))); Notification.show("Success", Notification.Type.HUMANIZED_MESSAGE) .addCloseListener(e -> cardSummaryDataProvider.refreshAll()); }); FormLayout form = new FormLayout(); form.addComponents(id, amount, submit); form.setMargin(true); Panel panel = new Panel("Issue single card"); panel.setContent(form); return panel; }
private Panel redeemPanel() { TextField id = new TextField("Card id"); TextField amount = new TextField("Amount"); Button submit = new Button("Submit"); submit.addClickListener(evt -> { commandGateway.sendAndWait(new RedeemCmd(id.getValue(), Integer.parseInt(amount.getValue()))); Notification.show("Success", Notification.Type.HUMANIZED_MESSAGE) .addCloseListener(e -> cardSummaryDataProvider.refreshAll()); }); FormLayout form = new FormLayout(); form.addComponents(id, amount, submit); form.setMargin(true); Panel panel = new Panel("Redeem card"); panel.setContent(form); return panel; }
private Component createComponent(VertexRef ref) { FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Name", ref.getLabel())); formLayout.addComponent(createLabel("ID", String.format("%s:%s", ref.getNamespace(), ref.getId()))); if (ref instanceof AbstractVertex) { AbstractVertex vertex = (AbstractVertex) ref; formLayout.addComponent(createLabel("Icon Key", vertex.getIconKey())); if (vertex.getIpAddress() != null) { formLayout.addComponent(createLabel("IP Address", vertex.getIpAddress())); } } return formLayout; }
private Component createComponent(VertexRef ref) { FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Name", ref.getLabel())); formLayout.addComponent(createLabel("ID", String.format("%s:%s", ref.getNamespace(), ref.getId()))); if (ref instanceof AbstractVertex) { AbstractVertex vertex = (AbstractVertex) ref; formLayout.addComponent(createLabel("Icon Key", vertex.getIconKey())); if (vertex.getIpAddress() != null) { formLayout.addComponent(createLabel("IP Address", vertex.getIpAddress())); } } return formLayout; }
private Component createComponent(AbstractVertex ref) { Preconditions.checkState(ref.getNodeID() != null, "no Node ID defined."); OnmsNode node = nodeDao.get(ref.getNodeID()); FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Node ID", "" + node.getId())); final HorizontalLayout nodeButtonLayout = new HorizontalLayout(); Button nodeButton = createButton(node.getLabel(), null, null, event -> new NodeInfoWindow(ref.getNodeID()).open()); nodeButton.setStyleName(BaseTheme.BUTTON_LINK); nodeButtonLayout.addComponent(nodeButton); nodeButtonLayout.setCaption("Node Label"); formLayout.addComponent(nodeButtonLayout); if (!Strings.isNullOrEmpty(node.getSysObjectId())) { formLayout.addComponent(createLabel("Enterprise OID", node.getSysObjectId())); } return formLayout; }
private Component createComponent(AbstractVertex ref) { Preconditions.checkState(ref.getNodeID() != null, "no Node ID defined."); OnmsNode node = nodeDao.get(ref.getNodeID()); FormLayout formLayout = new FormLayout(); formLayout.setSpacing(false); formLayout.setMargin(false); formLayout.addComponent(createLabel("Node ID", "" + node.getId())); final HorizontalLayout nodeButtonLayout = new HorizontalLayout(); Button nodeButton = createButton(node.getLabel(), null, null, event -> new NodeInfoWindow(ref.getNodeID()).open()); nodeButton.setStyleName(BaseTheme.BUTTON_LINK); nodeButtonLayout.addComponent(nodeButton); nodeButtonLayout.setCaption("Node Label"); formLayout.addComponent(nodeButtonLayout); if (!Strings.isNullOrEmpty(node.getSysObjectId())) { formLayout.addComponent(createLabel("Enterprise OID", node.getSysObjectId())); } return formLayout; }
private Component createComponent(BusinessServiceEdge ref, GraphContainer container) { FormLayout formLayout = new FormLayout(); formLayout.setMargin(false); formLayout.setSpacing(false); formLayout.addStyleName("severity"); final BusinessServiceStateMachine stateMachine = SimulationAwareStateMachineFactory.createStateMachine(businessServiceManager, container.getCriteria()); final Status outgoingStatus = BusinessServicesStatusProvider.getStatus(stateMachine, ref); final Status incomingStatus = BusinessServicesStatusProvider.getStatus(stateMachine, ((AbstractBusinessServiceVertex) ref.getTarget() .getVertex())); formLayout.addComponent(createStatusLabel("Outgoing Severity", outgoingStatus)); formLayout.addComponent(createStatusLabel("Incoming Severity", incomingStatus)); return formLayout; }
/** * Instantiates a new system definition form. * * @param groupNames the group names */ public SystemDefForm(final List<String> groupNames) { setCaption("System Definition Detail"); systemDefLayout.setMargin(true); name.setRequired(true); name.setWidth("100%"); systemDefLayout.addComponent(name); systemDefChoice.setRequired(true); systemDefLayout.addComponent(systemDefChoice); collect = new CollectField("MIB Groups", groupNames); collect.setRequired(true); systemDefLayout.addComponent(collect); setSystemDef(createBasicSystemDef()); systemDefEditor.bind(name, "name"); systemDefEditor.bind(systemDefChoice, "systemDefChoice"); systemDefEditor.bind(collect, "collect"); setCompositionRoot(systemDefLayout); }
/** * Instantiates a new system definition form. * * @param groupNames the group names */ public SystemDefForm(final List<String> groupNames) { setCaption("System Definition Detail"); systemDefLayout.setMargin(true); name.setRequired(true); name.setWidth("100%"); systemDefLayout.addComponent(name); systemDefChoice.setRequired(true); systemDefLayout.addComponent(systemDefChoice); collect = new CollectField("MIB Groups", groupNames); collect.setRequired(true); systemDefLayout.addComponent(collect); setSystemDef(createBasicSystemDef()); systemDefEditor.bind(name, "name"); systemDefEditor.bind(systemDefChoice, "systemDefChoice"); systemDefEditor.bind(collect, "collect"); setCompositionRoot(systemDefLayout); }
/** * Instantiates a new resource type form. */ public ResourceTypeForm() { setCaption("Resource Type Detail"); resourceTypeLayout.setMargin(true); name.setRequired(true); name.setWidth("100%"); resourceTypeLayout.addComponent(name); label.setRequired(true); label.setWidth("100%"); resourceTypeLayout.addComponent(label); resourceLabel.setRequired(false); resourceLabel.setWidth("100%"); resourceTypeLayout.addComponent(resourceLabel); resourceTypeLayout.addComponent(storageStrategy); resourceTypeLayout.addComponent(persistenceSelectorStrategy); setResourceType(createBasicResourceType()); resourceTypeEditor.bind(name, "name"); resourceTypeEditor.bind(label, "label"); resourceTypeEditor.bind(resourceLabel, "resourceLabel"); resourceTypeEditor.bind(storageStrategy, "storageStrategy"); resourceTypeEditor.bind(persistenceSelectorStrategy, "persistenceSelectorStrategy"); setCompositionRoot(resourceTypeLayout); }