List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setSpacing
public void setSpacing(int spacing)
From source file:com.qut.middleware.esoemanager.client.ui.nodes.NodeConfigurationUI.java
License:Apache License
public void createInterface(ServiceNodeConfiguration nodeConfig) { this.addStyleName(CSSConstants.esoeManagerNode); final VerticalPanel content = new VerticalPanel(); HorizontalPanel banner = new HorizontalPanel(); banner.addStyleName(CSSConstants.esoeManagerNodeBanner); banner.setSpacing(5); StyledButton showContent = new StyledButton("application", ""); showContent.addClickListener(new ClickListener() { public void onClick(Widget sender) { content.setVisible(!content.isVisible()); }/*from w ww.j a v a2 s . c o m*/ }); banner.add(showContent); banner.add(new Label("Node - ")); banner.add(new Label(nodeConfig.getServiceHost())); this.keystorePassword = new IntegratedLabel("keystorePassword", nodeConfig.getKeystorePassword()); this.spepKeyAlias = new IntegratedLabel("spepKeyAlias", nodeConfig.getSpepKeyAlias()); this.spepKeyPassword = new IntegratedLabel("spepKeyPassword", nodeConfig.getSpepKeyPassword()); this.esoeIdentifier = new IntegratedLabel("esoeIdentifier", nodeConfig.getEsoeIdentifier()); this.spepIdentifier = new IntegratedLabel("spepIdentifier", nodeConfig.getSpepIdentifier()); this.metadataURL = new IntegratedLabel("metadataURL", nodeConfig.getMetadataURL()); this.serverInfo = new IntegratedLabel("serverInfo", "A human readable description of the service"); this.nodeIdentifier = new IntegratedLabel("nodeIdentifier", nodeConfig.getNodeIdentifier()); this.attributeConsumingServiceIndex = new IntegratedLabel("attributeConsumingServiceIndex", nodeConfig.getNodeIdentifier()); this.assertionConsumerServiceIndex = new IntegratedLabel("assertionConsumerServiceIndex", nodeConfig.getNodeIdentifier()); this.authzCacheIndex = new IntegratedLabel("authzCacheIndex", nodeConfig.getNodeIdentifier()); this.serviceHost = new IntegratedLabel("serviceHost", nodeConfig.getServiceHost()); this.ipAddress = new IntegratedLabel("ipAddress", "The IP address which this service node accepts connections on"); this.defaultURL = new IntegratedLabel("defaultURL", "The default URL that end users access when using this service"); FlexibleTable nodeConfigs = new FlexibleTable(5, 5); nodeConfigs.insertWidget(this.keystorePassword.getTitle()); nodeConfigs.insertWidget(this.keystorePassword.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.spepKeyAlias.getTitle()); nodeConfigs.insertWidget(this.spepKeyAlias.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.spepKeyPassword.getTitle()); nodeConfigs.insertWidget(this.spepKeyPassword.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.esoeIdentifier.getTitle()); nodeConfigs.insertWidget(this.esoeIdentifier.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.spepIdentifier.getTitle()); nodeConfigs.insertWidget(this.spepIdentifier.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.metadataURL.getTitle()); nodeConfigs.insertWidget(this.metadataURL.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.serverInfo.getTitle()); nodeConfigs.insertWidget(this.serverInfo.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.nodeIdentifier.getTitle()); nodeConfigs.insertWidget(this.nodeIdentifier.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.attributeConsumingServiceIndex.getTitle()); nodeConfigs.insertWidget(this.attributeConsumingServiceIndex.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.assertionConsumerServiceIndex.getTitle()); nodeConfigs.insertWidget(this.assertionConsumerServiceIndex.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.authzCacheIndex.getTitle()); nodeConfigs.insertWidget(this.authzCacheIndex.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.serviceHost.getTitle()); nodeConfigs.insertWidget(this.serviceHost.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.ipAddress.getTitle()); nodeConfigs.insertWidget(this.ipAddress.getContent()); nodeConfigs.nextRow(); nodeConfigs.insertWidget(this.defaultURL.getTitle()); nodeConfigs.insertWidget(this.defaultURL.getContent()); nodeConfigs.nextRow(); content.add(nodeConfigs); content.setVisible(false); this.add(banner); this.add(content); }
From source file:com.qut.middleware.esoemanager.client.ui.nodes.NodeUI.java
License:Apache License
public void createInterface() { this.addStyleName(CSSConstants.esoeManagerNode); this.content = new VerticalPanel(); HorizontalPanel banner = new HorizontalPanel(); banner.addStyleName(CSSConstants.esoeManagerNodeBanner); banner.setSpacing(5); final HorizontalPanel subBanner = new HorizontalPanel(); subBanner.addStyleName(CSSConstants.esoeManagerNodeSubBanner); subBanner.setSpacing(5);//from www . j ava 2 s . co m StyledButton showContent = new StyledButton("application", ""); showContent.addClickListener(new ClickListener() { public void onClick(Widget sender) { content.setVisible(!content.isVisible()); } }); banner.add(showContent); banner.add(new Label("Node - ")); try { banner.add(new Label(this.nodeURL.getText())); } catch (InvalidContentException e) { } this.save = new ConfirmationStyledButton("Save node changes?", "save", "Save"); this.save.addClickListener(new ClickListener() { public void onClick(Widget sender) { try { EsoeManager.contentService.saveServiceNodeConfiguration(serviceIdentifier, getNodeIdentifier(), getNodeURL(), getNodeACS(), getNodeSLS(), getNodeCCS(), new ConfigChangeHandler(NodeUI.this.loader)); } catch (InvalidContentException e) { } } }); subBanner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); subBanner.add(this.save); this.toggleState = new ConfirmationStyledButton("Change node state?", "toggle", ""); this.toggleState.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (NodeUI.this.isActive()) EsoeManager.contentService.toggleServiceNodeState(NodeUI.this.serviceIdentifier, getNodeIdentifier(), true, new StateHandler(NodeUI.this.loader)); else EsoeManager.contentService.toggleServiceNodeState(NodeUI.this.serviceIdentifier, getNodeIdentifier(), false, new StateHandler(NodeUI.this.loader)); } }); FlexibleTable layout = new FlexibleTable(5, 5); layout.insertWidget(this.nodeIdentifier.getTitle()); layout.insertWidget(this.nodeIdentifier.getContent()); layout.nextRow(); layout.insertWidget(this.nodeURL.getTitle()); layout.insertWidget(this.nodeURL.getContent()); layout.nextRow(); Label stateLbl = new Label("Active State"); stateLbl.addStyleName(CSSConstants.serviceValueTitle); layout.insertWidget(stateLbl); HorizontalPanel statePanel = new HorizontalPanel(); statePanel.setSpacing(5); statePanel.add(this.state); statePanel.add(this.toggleState); layout.insertWidget(statePanel); layout.nextRow(); layout.insertWidget(this.nodeACS.getTitle()); layout.insertWidget(this.nodeACS.getContent()); layout.nextRow(); layout.insertWidget(this.nodeSLS.getTitle()); layout.insertWidget(this.nodeSLS.getContent()); layout.nextRow(); layout.insertWidget(this.nodeCCS.getTitle()); layout.insertWidget(this.nodeCCS.getContent()); layout.nextRow(); this.content.add(subBanner); this.content.add(layout); this.content.setVisible(false); this.add(banner); this.add(this.content); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.AttributesPanel.java
License:Apache License
private void createInterface() { this.codePanel = new SimplePanel(); this.codePanel.addStyleName(CSSConstants.attributePolicyPanel); this.elem = this.codePanel.getElement(); HorizontalPanel controls = new HorizontalPanel(); controls.setSpacing(5); ConfirmationStyledButton saveAttributes = new ConfirmationStyledButton("Save this attribute policy?", "save", "Save"); controls.add(saveAttributes);//from w ww . j a v a2 s.c o m saveAttributes.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (codePanel != null) EsoeManager.contentService.saveAttributePolicyXML(AttributesPanel.this.getCode(), new AttributeSaveHandler()); } }); ConfirmationStyledButton reloadAttributes = new ConfirmationStyledButton( "Refresh this attribute policy? Changes will be lost", "toggle", "Refresh"); controls.add(reloadAttributes); reloadAttributes.addClickListener(new ClickListener() { public void onClick(Widget sender) { EsoeManager.contentService.getAttributePolicyXML(new AttributeRetrievalHandler()); } }); this.add(controls); this.add(this.codePanel); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.CryptoPanel.java
License:Apache License
private void createInterface() { this.loader = new Loader(); this.keyTable = new FlexibleTable(5, 5); this.keyTable.insertHeading(0, "Name"); this.keyTable.insertHeading(1, "Passphrase"); this.keyTable.insertHeading(2, "Keystore Passphrase"); this.keyTable.insertHeading(3, "Expiry Date"); this.expiredKeyTable = new FlexibleTable(5, 5); this.expiredKeyTable.insertHeading(0, "Name"); this.expiredKeyTable.insertHeading(1, "Passphrase"); this.expiredKeyTable.insertHeading(2, "Keystore Passphrase"); this.expiredKeyTable.insertHeading(3, "Expiry Date"); EsoeManager.contentService.retrieveServiceKeys(this.serviceIdentifier, new KeysRetrievalHandler(this.loader)); final ConfirmationStyledButton addKey = new ConfirmationStyledButton( "Are you sure you wish to create a new key for this service?", "add", "Add Key"); addKey.addClickListener(new ClickListener() { public void onClick(Widget sender) { CryptoPanel.this.loader.setVisible(true); EsoeManager.contentService.createServiceKey(serviceIdentifier, new KeyCreationHandler(CryptoPanel.this.loader)); }/*from w w w . jav a 2s . c o m*/ }); Label title = new Label("Valid Keys"); title.addStyleName(CSSConstants.esoeManagerSubSectionTitle); Label expiredTitle = new Label("Expired Keys"); expiredTitle.addStyleName(CSSConstants.esoeManagerSubSectionTitle); HorizontalPanel banner = new HorizontalPanel(); banner.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); banner.setSpacing(5); banner.add(title); banner.add(this.loader); this.add(banner); this.add(addKey); this.add(this.keyTable); this.add(expiredTitle); this.add(this.expiredKeyTable); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.DashboardPanel.java
License:Apache License
private void createInterface() { HorizontalPanel importantKeyDetails = new HorizontalPanel(); importantKeyDetails.setSpacing(5); importantKeyDetails.setVerticalAlignment(ALIGN_TOP); this.esoeDash = new VerticalPanel(); this.esoeDash.addStyleName(CSSConstants.esoeDash); this.metadataDash = new VerticalPanel(); this.metadataDash.addStyleName(CSSConstants.metadataDash); this.serviceDash = new VerticalPanel(); this.serviceDash.addStyleName(CSSConstants.serviceDash); this.startupDash = new VerticalPanel(); this.startupDash.addStyleName(CSSConstants.startupDash); VerticalPanel col1 = new VerticalPanel(); VerticalPanel col2 = new VerticalPanel(); col1.add(this.esoeDash); col1.add(this.startupDash); col2.add(this.serviceDash); importantKeyDetails.add(col1);//from www .j a v a 2 s .c o m importantKeyDetails.add(col2); // This disabled on purpose until more MD data can be retrieved // this.createMetadataDashboard(); this.createESOEDashboard(); this.createServicesDashboard(); this.createStartupDashboard(); this.add(importantKeyDetails); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.DescriptivePanel.java
License:Apache License
private void createInterface() { this.clear(); this.addStyleName(CSSConstants.esoeManagerDescription); this.content = new VerticalPanel(); Label title = new Label("Service Description"); title.addStyleName(CSSConstants.esoeManagerSubSectionTitle); FlexibleTable details = new FlexibleTable(5, 5); this.serviceName = new HiddenIntegratedTextBox(this, 1, this.serviceNameRegex, "Service name must have 1 character", "Name", this.areaID); this.serviceName.addTableRow(details); this.serviceURL = new HiddenIntegratedTextBox(this, 1, this.serviceURLRegex, "ServiceURL must be in a URL format", "URL", this.areaID); this.serviceURL.addTableRow(details); this.toggle = new ConfirmationStyledButton("Are you sure you wish to change the state of this service?", "toggle", ""); this.toggle.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (activeState.isActive()) contentService.toggleServiceState(serviceIdentifier, true, new StateHandler(loader)); else/* w ww . j a v a 2s .co m*/ contentService.toggleServiceState(serviceIdentifier, false, new StateHandler(loader)); loader.setVisible(true); } }); Label stateLbl = new Label("Active Status"); stateLbl.addStyleName(CSSConstants.serviceValueTitle); this.activeState = new ActiveState(); details.insertWidget(stateLbl); HorizontalPanel statePanel = new HorizontalPanel(); statePanel.setSpacing(5); statePanel.add(this.activeState); statePanel.add(this.toggle); details.insertWidget(statePanel); details.nextRow(); this.serviceDescription = new HiddenIntegratedTextArea(this, 1, this.serviceDescriptionRegex, "Description", "Service description must be completed", this.areaID); this.serviceDescription.addTableRow(details); this.serviceAccessDeniedMessage = new HiddenIntegratedTextArea(this, 0, this.serviceAccessDeniedRegex, "Access Denied Message", "Service access denied message must be completed", this.areaID); this.serviceAccessDeniedMessage.addTableRow(details); this.content.add(title); this.content.add(details); // display our loader until we get some data back this.loader = new Loader(); this.add(this.loader); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.MetadataPanel.java
License:Apache License
private void createInterface() { this.codePanel = new SimplePanel(); this.codePanel.addStyleName(CSSConstants.metadataPanel); this.elem = this.codePanel.getElement(); HorizontalPanel controls = new HorizontalPanel(); controls.setSpacing(5); StyledButton reloadMetadata = new StyledButton("toggle", "Refresh"); controls.add(reloadMetadata);//from w w w . j a v a2 s . com reloadMetadata.addClickListener(new ClickListener() { public void onClick(Widget sender) { EsoeManager.contentService.getMetadataXML(new MetadataRetrievalHandler()); } }); this.add(controls); this.add(this.codePanel); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.PolicyEditorPanel.java
License:Apache License
private void createInterface() { this.policies = new ArrayList<com.qut.middleware.esoemanager.client.ui.policy.PolicyUI>(); this.policiesPanel = new VerticalPanel(); HorizontalPanel heading = new HorizontalPanel(); heading.setSpacing(5); heading.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); Label title = new Label("Policies governing access to service resources"); title.addStyleName(CSSConstants.esoeManagerSubSectionTitle); StyledButton addPolicy = new StyledButton("add", "Add Policy"); addPolicy.addClickListener(new ClickListener() { public void onClick(Widget sender) { PolicyUI policyUI = new PolicyUI(PolicyEditorPanel.this.serviceIdentifier, true); PolicyEditorPanel.this.policies.add(policyUI); PolicyEditorPanel.this.policiesPanel.add(policyUI); }/*w ww .j av a 2 s . c om*/ }); // display loader until data returns this.loader = new Loader(); heading.add(this.loader); heading.add(addPolicy); this.add(title); this.add(heading); this.add(this.policiesPanel); }
From source file:com.qut.middleware.esoemanager.client.ui.panels.ServiceMetadataPanel.java
License:Apache License
private void createInterface() { this.codePanel = new SimplePanel(); this.codePanel.addStyleName(CSSConstants.attributePolicyPanel); this.elem = this.codePanel.getElement(); HorizontalPanel controls = new HorizontalPanel(); controls.setSpacing(5); StyledButton reloadDescriptor = new StyledButton("toggle", "Refresh"); controls.add(reloadDescriptor);//from ww w .java 2 s . c o m reloadDescriptor.addClickListener(new ClickListener() { public void onClick(Widget sender) { EsoeManager.contentService.retrieveServiceDescriptor(serviceIdentifier, new DescriptorRetrievalHandler()); } }); this.add(controls); this.add(this.codePanel); }
From source file:com.qut.middleware.esoemanager.client.ui.policy.PolicyUI.java
License:Apache License
private void createInterface() { this.graphicalEditor = new VerticalPanel(); this.graphicalEditor.setVisible(false); this.xmlEditor = new VerticalPanel(); this.xmlEditor.setVisible(false); this.activeEditor = this.graphicalEditor; this.addStyleName(CSSConstants.esoeManagerPolicy); createGraphicalInterface();//from w w w . j av a 2 s . c o m createXMLInterface(); banner = new HorizontalPanel(); banner.addStyleName(CSSConstants.esoeManagerPolicyBanner); banner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); subBanner = new HorizontalPanel(); subBanner.setVisible(false); subBanner.addStyleName(CSSConstants.esoeManagerPolicySubBanner); this.graphicalMode = new ConfirmationStyledButton( "If you have unsaved changes these will be lost when switching to the graphical editor, continue?", "toggle", "Graphical Editor"); this.xmlMode = new ConfirmationStyledButton( "If you have unsaved changes these will be lost when switching to the xml editor, continue?", "toggle", "XML Editor"); graphicalMode.setVisible(false); graphicalMode.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (!PolicyUI.this.graphicalEditor.isVisible()) { if (!newPolicy) { EventController.executeEvent( new PolicyUpdateEvent(EventConstants.updatePolicy, PolicyUI.this.getPolicyID())); } graphicalMode.setVisible(false); xmlMode.setVisible(true); PolicyUI.this.graphicalEditor.setVisible(true); PolicyUI.this.xmlEditor.setVisible(false); PolicyUI.this.activeEditor = PolicyUI.this.graphicalEditor; } } }); xmlMode.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (!PolicyUI.this.xmlEditor.isVisible()) { graphicalMode.setVisible(true); xmlMode.setVisible(false); PolicyUI.this.graphicalEditor.setVisible(false); PolicyUI.this.xmlEditor.setVisible(true); PolicyUI.this.activeEditor = PolicyUI.this.xmlEditor; if (PolicyUI.this.newPolicy) PolicyUI.this.policyXMLUI.enableXMLEditor(); else { PolicyUI.this.policyXMLUI.enableXMLEditor(PolicyUI.this.id.getText()); } } } }); StyledButton showContent = new StyledButton("application", ""); showContent.addClickListener(new ClickListener() { public void onClick(Widget sender) { subBanner.setVisible(!subBanner.isVisible()); PolicyUI.this.activeEditor.setVisible(!PolicyUI.this.activeEditor.isVisible()); } }); final ConfirmationStyledButton savePolicy = new ConfirmationStyledButton( "Are you sure you wish to save this policy?", "save", "Save"); savePolicy.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (PolicyUI.this.activeEditor == PolicyUI.this.graphicalEditor) { saveGraphicalPolicy(); } else { saveXMLPolicy(); } } }); final ConfirmationStyledButton deletePolicy = new ConfirmationStyledButton( "Are you sure you wish to delete this policy?", "delete", "Delete"); deletePolicy.addClickListener(new ClickListener() { public void onClick(Widget sender) { EsoeManager.contentService.deleteServicePolicy(PolicyUI.this.serviceIdentifier, id.getText(), new PolicyDeletionHandler()); } }); final ConfirmationStyledButton cancelPolicy = new ConfirmationStyledButton( "Are you sure you wish to cancel creation of this policy?", "cancel", "Cancel"); cancelPolicy.addClickListener(new ClickListener() { public void onClick(Widget sender) { EventController .executeEvent(new PolicyCancelledEvent(EventConstants.cancelPolicyCreation, PolicyUI.this)); } }); HorizontalPanel bannerTitle = new HorizontalPanel(); bannerTitle.addStyleName(CSSConstants.esoeManagerPolicyBannerTitle); bannerTitle.setSpacing(5); bannerTitle.add(showContent); if (!this.newPolicy) { bannerTitle.add(new Label("Policy - ")); bannerTitle.add(this.id.getContent()); } else bannerTitle.add(new Label("New Policy")); banner.add(bannerTitle); HorizontalPanel editorControlButtons = new HorizontalPanel(); editorControlButtons.setSpacing(5); editorControlButtons.add(graphicalMode); editorControlButtons.add(xmlMode); HorizontalPanel subBannerButtons = new HorizontalPanel(); subBannerButtons.setSpacing(5); if (!this.newPolicy) { subBannerButtons.add(savePolicy); // subBannerButtons.add(deletePolicy); - disabled for now, may enable in the future if deleting becomes required, better to deactivate though } else { subBannerButtons.add(savePolicy); subBannerButtons.add(cancelPolicy); } subBanner.add(editorControlButtons); subBanner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); subBanner.add(subBannerButtons); this.add(banner); this.add(subBanner); this.add(this.graphicalEditor); this.add(this.xmlEditor); this.activeEditor = this.graphicalEditor; /* Finally if this is a new policy then show the actual editor */ if (newPolicy) { subBanner.setVisible(true); this.graphicalEditor.setVisible(true); } }