public Widget asWidget() { LayoutPanel layout = new LayoutPanel(); VerticalPanel panel = new VerticalPanel(); panel.setStyleName("rhs-content-panel"); ScrollPanel scroll = new ScrollPanel(panel); layout.add(scroll); layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT); serverName = new HTML("Replace me"); serverName.setStyleName("content-header-label"); panel.add(serverName); panel.add(new ContentDescription(Console.CONSTANTS.subsys_messaging_jms_provider_desc())); form = new Form(MessagingProvider.class); form.setNumColumns(2); CheckBoxItem persistenceItem = new CheckBoxItem("persistenceEnabled", "Persistence enabled?"); CheckBoxItem securityItem = new CheckBoxItem("securityEnabled", "Security enabled?"); CheckBoxItem messageCounterItem = new CheckBoxItem("messageCounterEnabled", "Message Counter enabled?"); // TextItem connector = new TextItem("connectorBinding", "Connector Binding"); // TextItem acceptor = new TextItem("acceptorBinding", "Acceptor Binding"); form.setFields(persistenceItem, securityItem, messageCounterItem); // form.setFieldsInGroup("Connections", new DisclosureGroupRenderer(), acceptor, connector); FormToolStrip<MessagingProvider> toolStrip = new FormToolStrip<MessagingProvider>( form, new FormToolStrip.FormCallback<MessagingProvider>() { @Override public void onSave(Map<String, Object> changeset) { presenter.onSaveProviderConfig(changeset); } @Override public void onDelete(MessagingProvider entity) {} }); toolStrip.providesDeleteOp(false); panel.add(toolStrip.asWidget()); FormHelpPanel helpPanel = new FormHelpPanel( new FormHelpPanel.AddressCallback() { @Override public ModelNode getAddress() { ModelNode address = Baseadress.get(); address.add("subsystem", "messaging"); address.add("hornetq-server", "*"); return address; } }, form); panel.add(helpPanel.asWidget()); Widget formWidget = form.asWidget(); panel.add(formWidget); formWidget.getElement().setAttribute("style", "padding-bottom:20px;"); // ------ TabPanel bottomLayout = new TabPanel(); bottomLayout.addStyleName("default-tabpanel"); secDetails = new SecurityDetails(presenter); bottomLayout.add(secDetails.asWidget(), "Security"); addrDetails = new AddressingDetails(presenter); bottomLayout.add(addrDetails.asWidget(), "Addressing"); bottomLayout.selectTab(0); panel.add(bottomLayout); bottomLayout.getElement().setAttribute("style", "padding-top:10px"); return layout; }
public void setSecurityConfig(List<SecurityPattern> patterns) { secDetails.setSecurityConfig(patterns); }