com.vaadin.shared.ui.label.ContentMode Java Examples
The following examples show how to use
com.vaadin.shared.ui.label.ContentMode.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HomeViewImpl.java From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 | 6 votes |
@Override public void postConstruct() { super.postConstruct(); content = new VerticalLayout(); content.setSpacing(true); content.setMargin(true); setCompositionRoot(content); caption = new Label("This is Home View", ContentMode.HTML); caption.addStyleName(ValoTheme.LABEL_H2); content.addComponent(caption); loginInfo = new Label("This is Home View", ContentMode.HTML); loginInfo.addStyleName(ValoTheme.LABEL_H2); content.addComponent(loginInfo); }
Example #2
Source File: FormUtils.java From jdal with Apache License 2.0 | 6 votes |
/** * Create a titled separator * @param title title * @return a {@link HorizontalLayout} with title and rule. */ public static Component createTitledSeparator(String title) { Label titleLabel = new Label(title); titleLabel.setStyleName(Reindeer.LABEL_H2); Label rule = new Label("<hr />", ContentMode.HTML); titleLabel.setSizeUndefined(); HorizontalLayout hl = new HorizontalLayout(); hl.addComponent(titleLabel); Box.addHorizontalStruct(hl, 20); hl.addComponent(rule); hl.setComponentAlignment(rule, Alignment.BOTTOM_CENTER); hl.setExpandRatio(rule, 1); hl.setWidth(100, Unit.PERCENTAGE); return hl; }
Example #3
Source File: TargetDetails.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private HorizontalLayout getSecurityTokenLayout(final String securityToken) { final HorizontalLayout securityTokenLayout = new HorizontalLayout(); final Label securityTableLbl = new Label( SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")), ContentMode.HTML); securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE); securityTableLbl.addStyleName("label-style"); final TextField securityTokentxt = new TextField(); securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS); securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY); securityTokentxt.addStyleName("targetDtls-securityToken"); securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE); securityTokentxt.setCaption(null); securityTokentxt.setNullRepresentation(""); securityTokentxt.setValue(securityToken); securityTokentxt.setReadOnly(true); securityTokenLayout.addComponent(securityTableLbl); securityTokenLayout.addComponent(securityTokentxt); return securityTokenLayout; }
Example #4
Source File: TargetTable.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private Label getTargetPollTime(final Object itemId) { final Label statusLabel = new Label(); statusLabel.addStyleName(ValoTheme.LABEL_SMALL); statusLabel.setHeightUndefined(); statusLabel.setContentMode(ContentMode.HTML); final String pollStatusToolTip = (String) getContainerDataSource().getItem(itemId) .getItemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue(); if (StringUtils.hasText(pollStatusToolTip)) { statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); statusLabel.setDescription(pollStatusToolTip); } else { statusLabel.setValue(FontAwesome.CLOCK_O.getHtml()); statusLabel.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_IN_TIME)); } return statusLabel; }
Example #5
Source File: UploadDropAreaLayout.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
private VerticalLayout createDropAreaLayout() { final VerticalLayout dropAreaLayout = new VerticalLayout(); final Label dropHereLabel = new Label(i18n.getMessage(UIMessageIdProvider.LABEL_DROP_AREA_UPLOAD)); dropHereLabel.setWidth(null); final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML); dropIcon.addStyleName("drop-icon"); dropIcon.setWidth(null); dropAreaLayout.addComponent(dropIcon); dropAreaLayout.setComponentAlignment(dropIcon, Alignment.TOP_CENTER); dropAreaLayout.addComponent(dropHereLabel); dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER); uploadButtonLayout.setWidth(null); uploadButtonLayout.addStyleName("upload-button"); dropAreaLayout.addComponent(uploadButtonLayout); dropAreaLayout.setComponentAlignment(uploadButtonLayout, Alignment.BOTTOM_CENTER); dropAreaLayout.setSizeFull(); dropAreaLayout.setStyleName("upload-drop-area-layout-info"); dropAreaLayout.setSpacing(false); return dropAreaLayout; }
Example #6
Source File: ConfirmDialog.java From sensorhub with Mozilla Public License 2.0 | 5 votes |
public ConfirmDialog(String caption, String message, String okButtonText, String cancelButtonText) { super(caption); super.setModal(true); super.setClosable(false); super.setResizable(false); VerticalLayout windowLayout = new VerticalLayout(); windowLayout.setMargin(true); // confirmation message windowLayout.addComponent(new Label(message, ContentMode.HTML)); windowLayout.setSpacing(true); // buttons HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.setWidth(100.0f, Unit.PERCENTAGE); windowLayout.addComponent(buttonsLayout); okButton = new Button(okButtonText); buttonsLayout.addComponent(okButton); okButton.setTabIndex(1); okButton.addClickListener(this); buttonsLayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER); cancelButton = new Button(cancelButtonText); buttonsLayout.addComponent(cancelButton); cancelButton.setTabIndex(0); cancelButton.setClickShortcut(KeyCode.ESCAPE, null); cancelButton.addClickListener(this); buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_CENTER); super.setContent(windowLayout); }
Example #7
Source File: JobLogView.java From chipster with MIT License | 5 votes |
private void showTextWindow(String caption, String content) { Label textComponent = new Label(content); textComponent.setContentMode(ContentMode.PREFORMATTED); Window subWindow = new Window(caption); subWindow.setContent(textComponent); subWindow.setWidth(70, Unit.PERCENTAGE); subWindow.setHeight(90, Unit.PERCENTAGE); subWindow.center(); this.getUI().addWindow(subWindow); }
Example #8
Source File: BasicModel.java From chipster with MIT License | 5 votes |
private void initHeadeer() { lbTitle = new Label(); lbTitle.setContentMode(ContentMode.HTML); lbTitleDescription = new Label(); lbTitleDescription.setContentMode(ContentMode.HTML); lbTitleDescription.setImmediate(true); addRow(lbTitle, lbTitleDescription); }
Example #9
Source File: ToolEditorUI.java From chipster with MIT License | 5 votes |
@Override protected void init(VaadinRequest request) { treeToolEditor = new TreeToolEditor(this); toolEditor = new ToolEditor(this); textEditor = new TextEditor(this); final Panel vLayout = new Panel(); vSplitPanel = new VerticalSplitPanel(); vSplitPanel.setSplitPosition(50, Unit.PERCENTAGE); vSplitPanel.setImmediate(true); vSplitPanel.setLocked(false); vSplitPanel.setWidth("100%"); vLayout.setContent(vSplitPanel); setContent(vSplitPanel); VerticalLayout vvLayout = new VerticalLayout(); vvLayout.setSizeFull(); Label title = new Label("<h2><b> Tool Editor</b></h2>", ContentMode.HTML); vvLayout.addComponent(title); vvLayout.setComponentAlignment(title, Alignment.TOP_LEFT); HorizontalSplitPanel hSplitpPanel = new HorizontalSplitPanel(); hSplitpPanel.setSizeFull(); vvLayout.addComponent(hSplitpPanel); HorizontalLayout buttonPanel = getButtonPanel(); vvLayout.addComponent(buttonPanel); vvLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_CENTER); vvLayout.setExpandRatio(hSplitpPanel, 5); vvLayout.setComponentAlignment(hSplitpPanel, Alignment.TOP_LEFT); vvLayout.setMargin(false); vvLayout.setSpacing(false); hSplitpPanel.setFirstComponent(treeToolEditor); hSplitpPanel.setSecondComponent(toolEditor); vSplitPanel.setFirstComponent(vvLayout); vSplitPanel.setSecondComponent(textEditor); hSplitpPanel.setStyleName("topborder"); }
Example #10
Source File: EndpointTestTab.java From RDFUnit with Apache License 2.0 | 5 votes |
private void initLayout() { this.setMargin(true); this.setId("EndointTestTab"); this.setWidth("100%"); this.addComponent(new Label("<h2>1. Data Selection</h2>", ContentMode.HTML)); // Create the model and the Vaadin view implementation DataSelectorView dataSelectorView = new DataSelectorView(); this.addComponent(dataSelectorView); this.addComponent(new Label("<h2>2. Constraints Selection</h2>", ContentMode.HTML)); SchemaSelectorView schemaSelectorView = new SchemaSelectorView(); this.addComponent(schemaSelectorView); this.addComponent(new Label("<h2>3. Test Generation</h2>", ContentMode.HTML)); TestGenerationView testGenerationView = new TestGenerationView(); this.addComponent(testGenerationView); this.addComponent(new Label("<h2>4. Testing</h2>", ContentMode.HTML)); TestExecutionView testExecutionView = new TestExecutionView(); this.addComponent(testExecutionView); // Set previous / next dataSelectorView.setNextItem(schemaSelectorView); schemaSelectorView.setPreviousItem(dataSelectorView); schemaSelectorView.setNextItem(testGenerationView); testGenerationView.setPreviousItem(schemaSelectorView); testGenerationView.setNextItem(testExecutionView); testExecutionView.setPreviousItem(testGenerationView); //testGenerationView.setNextItem(); }
Example #11
Source File: CheckboxListQuestion.java From gazpachoquest with GNU General Public License v3.0 | 5 votes |
@Override protected void init() { questionTitle.setValue(String.format("<b>%d</b>. %s", questionDTO.getNumber(), questionDTO .getLanguageSettings().getTitle())); questionTitle.setContentMode(ContentMode.HTML); content.addComponent(questionTitle); options.setCaption("Choose one of the following answers"); Answer multipleAnswer = questionDTO.getAnswer(); List<Answer> answers = Collections.emptyList(); if (multipleAnswer instanceof MultipleAnswer) { answers = ((MultipleAnswer) multipleAnswer).getAnswers(); } selectedOptions = new HashSet<String>(); for (QuestionOptionDTO questionOptionDTO : questionDTO.getQuestionOptions()) { String optionCode = questionOptionDTO.getCode(); String optionTitle = questionOptionDTO.getLanguageSettings().getTitle(); options.addItem(optionCode); options.setItemCaption(optionCode, optionTitle); for (Answer answer : answers) { BooleanAnswer booleanAnswer = (BooleanAnswer) answer; if (booleanAnswer.getOption().equals(optionCode)) { if (booleanAnswer.getValue()) { selectedOptions.add(optionCode); } break; } } } options.setValue(selectedOptions); options.addValueChangeListener(this); content.addComponent(options); }
Example #12
Source File: ListRadioQuestion.java From gazpachoquest with GNU General Public License v3.0 | 5 votes |
@Override protected void init() { questionTitle.setValue(String.format("<b>%d</b>. %s", questionDTO.getNumber(), questionDTO .getLanguageSettings().getTitle())); questionTitle.setContentMode(ContentMode.HTML); content.addComponent(questionTitle); options.setCaption("Choose one of the following answers"); options.addItem("NULL"); options.setItemCaption("NULL", "Not selected"); for (QuestionOptionDTO questionOptionDTO : questionDTO.getQuestionOptions()) { String optionCode = questionOptionDTO.getCode(); String optionTitle = questionOptionDTO.getLanguageSettings().getTitle(); options.addItem(optionCode); options.setItemCaption(optionCode, optionTitle); if (questionDTO.getAnswer() instanceof TextAnswer) { if (((TextAnswer) questionDTO.getAnswer()).getValue().equals(optionCode)) { options.setValue(optionCode); } } } if (questionDTO.getAnswer() instanceof NoAnswer) { options.setValue("NULL"); } options.addValueChangeListener(this); content.addComponent(options); }
Example #13
Source File: AutoCompleteTextFieldComponent.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private static Label createStatusIcon() { final Label statusIcon = new Label(); statusIcon.setImmediate(true); statusIcon.setContentMode(ContentMode.HTML); statusIcon.setSizeFull(); setInitialStatusIconStyle(statusIcon); statusIcon.setId(UIComponentIdProvider.VALIDATION_STATUS_ICON_ID); return statusIcon; }
Example #14
Source File: UserViewImpl.java From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 | 5 votes |
@Override public void postConstruct() { super.postConstruct(); content = new VerticalLayout(); content.setSpacing(true); content.setMargin(true); setCompositionRoot(content); caption = new Label("This is User view", ContentMode.HTML); caption.addStyleName(ValoTheme.LABEL_H2); content.addComponent(caption); info = new Label("Invoke admin service", ContentMode.HTML); info.addStyleName(ValoTheme.LABEL_H2); content.addComponent(info); btnTest = new Button("Click me", FontAwesome.STAR); content.addComponent(btnTest); btnTest.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { mvpPresenterHandlers.callDummyService(); } }); dummyInfo = new Label("", ContentMode.HTML); dummyInfo.addStyleName(ValoTheme.LABEL_H2); content.addComponent(dummyInfo); }
Example #15
Source File: AbstractHawkbitLoginUI.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Component buildDisclaimer() { final HorizontalLayout fields = new HorizontalLayout(); fields.setSpacing(true); fields.addStyleName("disclaimer"); final Label disclaimer = new Label(uiProperties.getDemo().getDisclaimer(), ContentMode.HTML); disclaimer.setCaption(i18n.getMessage("label.login.disclaimer")); disclaimer.setIcon(FontAwesome.EXCLAMATION_CIRCLE); disclaimer.setId("login-disclaimer"); disclaimer.setWidth("525px"); fields.addComponent(disclaimer); return fields; }
Example #16
Source File: StorageAdminPanel.java From sensorhub with Mozilla Public License 2.0 | 5 votes |
protected void buildDataPanel(GridLayout form, IRecordStorageModule<?> storage) { // measurement outputs int i = 1; if (storage.isEnabled()) { for (IRecordStoreInfo dsInfo: storage.getRecordStores().values()) { Panel panel = newPanel("Stream #" + i++); GridLayout panelLayout = ((GridLayout)panel.getContent()); panelLayout.setSpacing(true); // stored time period double[] timeRange = storage.getRecordsTimeRange(dsInfo.getName()); Label l = new Label("<b>Time Range:</b> " + new DateTimeFormat().formatIso(timeRange[0], 0) + " / " + new DateTimeFormat().formatIso(timeRange[1], 0)); l.setContentMode(ContentMode.HTML); panelLayout.addComponent(l, 0, 0, 1, 0); // time line panelLayout.addComponent(buildGantt(storage, dsInfo), 0, 1, 1, 1); // data structure DataComponent dataStruct = dsInfo.getRecordDescription(); Component sweForm = new SWECommonForm(dataStruct); panelLayout.addComponent(sweForm); // data table panelLayout.addComponent(buildTable(storage, dsInfo)); if (oldPanel != null) form.replaceComponent(oldPanel, panel); else form.addComponent(panel); oldPanel = panel; } } }
Example #17
Source File: SPUIComponentProvider.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private static Label createUsernameLabel(final String label, final String username) { String loadAndFormatUsername = ""; if (!StringUtils.isEmpty(username)) { loadAndFormatUsername = UserDetailsFormatter.loadAndFormatUsername(username); } final Label nameValueLabel = new Label(getBoldHTMLText(label) + loadAndFormatUsername, ContentMode.HTML); nameValueLabel.setSizeFull(); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName(LABEL_STYLE); nameValueLabel.setDescription(loadAndFormatUsername); return nameValueLabel; }
Example #18
Source File: SPUIComponentProvider.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * Method to CreateName value labels. * * @param label * as string * @param values * as string * @return HorizontalLayout */ public static HorizontalLayout createNameValueLayout(final String label, final String... values) { final String valueStr = StringUtils.arrayToDelimitedString(values, " "); final Label nameValueLabel = new Label( label ); nameValueLabel.setContentMode(ContentMode.TEXT); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName("text-bold"); nameValueLabel.setSizeUndefined(); final Label valueStrLabel = new Label(valueStr); valueStrLabel.setWidth("100%"); valueStrLabel.addStyleName("text-cut"); valueStrLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); valueStrLabel.addStyleName(LABEL_STYLE); final HorizontalLayout nameValueLayout = new HorizontalLayout(); nameValueLayout.setMargin(false); nameValueLayout.setSpacing(true); nameValueLayout.setSizeFull(); nameValueLayout.addComponent(nameValueLabel); nameValueLayout.setComponentAlignment(nameValueLabel, Alignment.TOP_LEFT); nameValueLayout.setExpandRatio(nameValueLabel, 0.0F); nameValueLayout.addComponent(valueStrLabel); nameValueLayout.setComponentAlignment(valueStrLabel, Alignment.TOP_LEFT); nameValueLayout.setExpandRatio(valueStrLabel, 1.0F); return nameValueLayout; }
Example #19
Source File: IntroTab.java From RDFUnit with Apache License 2.0 | 5 votes |
private void initLayout() { this.setMargin(true); this.addComponent(new Label("<h2>RDFUnit - A Unit Testing Suite for RDF</h2>", ContentMode.HTML)); this.addComponent(new Label( "<p><strong>Welcome to the RDFUnit Demo</strong></p>" + "<p>RDFUnit is a testing framework that can verify your data against a schema / vocabulary or custom SPARQL test cases.</p>" + "<p>Please note that you cannot use all features of RDFUnit from this UI. For example, you cannot define your own tests cases or test SPARQL Endpoints directly. " + "For more thorough testing please try the command line (CLI) version.</p>", ContentMode.HTML)); Link homepage = new Link("Homepage", new ExternalResource("http://rdfunit.aksw.org/")); Link github = new Link("Github page", new ExternalResource("https://github.com/AKSW/RDFUnit")); Link report = new Link("Report", new ExternalResource("http://svn.aksw.org/papers/2014/WWW_Databugger/public.pdf")); HorizontalLayout links = new HorizontalLayout(); this.addComponent(links); links.setDefaultComponentAlignment(Alignment.BOTTOM_LEFT); links.addComponent(new Label("To learn more about RDFUnit you can navigate to our: ", ContentMode.HTML)); links.addComponent(homepage); links.addComponent(new Label(" / ")); links.addComponent(github); links.addComponent(new Label(" / ")); links.addComponent(report); }
Example #20
Source File: SPTargetAttributesLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * Custom Decorate. * * @param controllerAttibs */ private void decorate(final Map<String, String> controllerAttibs) { final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class); final Label title = new Label(i18n.getMessage("label.target.controller.attrs"), ContentMode.HTML); title.addStyleName(SPUIDefinitions.TEXT_STYLE); targetAttributesLayout.addComponent(title); if (HawkbitCommonUtil.isNotNullOrEmpty(controllerAttibs)) { for (final Map.Entry<String, String> entry : controllerAttibs.entrySet()) { targetAttributesLayout.addComponent( SPUIComponentProvider.createNameValueLabel(entry.getKey() + ": ", entry.getValue())); } } }
Example #21
Source File: HawkbitCommonUtil.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * Get formatted label.Appends ellipses if content does not fit the label. * * @param labelContent * content * @return Label */ public static Label getFormatedLabel(final String labelContent) { final Label labelValue = new Label(labelContent, ContentMode.TEXT); labelValue.setSizeFull(); labelValue.addStyleName(SPUIDefinitions.TEXT_STYLE); labelValue.addStyleName("label-style"); labelValue.addStyleName("avoid-tooltip"); return labelValue; }
Example #22
Source File: SchemaSelectorView.java From RDFUnit with Apache License 2.0 | 5 votes |
private void setInputText() { inputText.setCaption("Direct Constraints Input"); inputText.setInputPrompt("Paste constraints in RDF directly here.\n" + "Constraints can be in the form of:\n" + "1) RDFS/OWL axioms (e.g. rdfs:range / rdfs:domain / cardinality constraints e.t.c.)\n" + "2) DSP Profile rules (http://dublincore.org/documents/2008/03/31/dc-dsp/)\n" + "3) IBM Resource (typed) Shapes (http://www.w3.org/Submission/2014/SUBM-shapes-20140211/)\n" + "(We do not yet support SPIN rules but will do soon)"); inputText.setRows(8); inputText.setColumns(40); inputText.setWidth("100%"); datasetMessage.setContentMode(ContentMode.HTML); datasetMessage.setValue("<h3>Automatic Constraint Detection based on RDFS/OWL (with CWA)</h3>" + "We will parse the input source and identify all used properties and classes.<br/>" + "Based on them we will try to dereference all the mentioned vocabularies & ontologies.<br/>" + "Then we will use these vocabularies in our algorithms to generate automatic RDFUnit Test Cases.<br/>" + "<b>Note that atm (for safety reasons) we automatically dereference only schemas that are available in LOV</b>"); ontologyMessage.setContentMode(ContentMode.HTML); ontologyMessage.setValue("<h3>Automatic Constraint Detection for Ontologies (including OWL, RDFS, RDF, XSD)</h3>" + "We will parse the input ontology and identify all used properties and classes.<br/>" + "Based on them we will try to dereference all the mentioned vocabularies & ontologies.<br/>" + "Then we will use these vocabularies in our algorithms to generate automatic RDFUnit Test Cases.<br/>" + "<b>Note that atm (for safety reasons) we automatically dereference only schemas that are available in LOV</b>"); specificSchemasMessage.setContentMode(ContentMode.HTML); specificSchemasMessage.setValue("<h3>Set Specific Schema Constraints</h3>" + "Schemas from LOV are available with auto-complete and will be used for RDFS/OWL checking. " + "You can also paste a <b>custom URI</b> and press \"Enter\" to insert it.<br/>" + "Note that custom URIs <b>can contain OWL/RDFS, <a href=\"http://dublincore.org/documents/2008/03/31/dc-dsp/\" target=\"_blank\">DSP Constraints</a> " + "or <a href=\"http://www.w3.org/Submission/2014/SUBM-shapes-20140211/\" target=\"_blank\">Resource (typed) Shapes</a> constraints</b> (SPIN is not yet supported).<br/>" + "Even if you mix different types of constraints RDFUnit will still work but the result will have to make sense ;)<br/> "); }
Example #23
Source File: CreateOrUpdateFilterTable.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private Component getStatusIcon(final Object itemId) { final Item row1 = getItem(itemId); final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1 .getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue(); final Label label = new LabelBuilder().name("").buildLabel(); label.setContentMode(ContentMode.HTML); if (targetStatus == TargetUpdateStatus.PENDING) { label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING)); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW); label.setValue(FontAwesome.ADJUST.getHtml()); } else if (targetStatus == TargetUpdateStatus.REGISTERED) { label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED)); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE); label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml()); } else if (targetStatus == TargetUpdateStatus.ERROR) { label.setDescription(i18n.getMessage(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR))); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED); label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); } else if (targetStatus == TargetUpdateStatus.IN_SYNC) { label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC)); label.setValue(FontAwesome.CHECK_CIRCLE.getHtml()); } else if (targetStatus == TargetUpdateStatus.UNKNOWN) { label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN)); label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml()); } return label; }
Example #24
Source File: XacmlAdminConsole.java From XACML with MIT License | 4 votes |
/** * The constructor should first build the main layout, set the * composition root and then do any custom initialization. * * The constructor will not be automatically regenerated by the * visual editor. */ public XacmlAdminConsole() { buildMainLayout(); setCompositionRoot(mainLayout); if (logger.isDebugEnabled()) { logger.debug("Creating tabs..."); } this.labelWelcome.setValue("Welcome " + ((XacmlAdminUI)UI.getCurrent()).getUserName()); this.labelCopyright.setContentMode(ContentMode.HTML); if (((XacmlAdminUI)UI.getCurrent()).isAuthorized( XacmlAdminAuthorization.AdminAction.ACTION_READ, XacmlAdminAuthorization.AdminResource.RESOURCE_POLICY_WORKSPACE)) { this.policyWorkspace = new PolicyWorkspace(); this.tabSheet.addComponent(this.policyWorkspace); this.tabSheet.getTab(this.policyWorkspace).setCaption("Policy Workspace"); } else { this.policyWorkspace = null; } if (((XacmlAdminUI)UI.getCurrent()).isAuthorized( XacmlAdminAuthorization.AdminAction.ACTION_READ, XacmlAdminAuthorization.AdminResource.RESOURCE_DICTIONARIES)) { this.attributeDictionary = new AttributeDictionary(); this.tabSheet.addComponent(this.attributeDictionary); this.tabSheet.getTab(this.attributeDictionary).setCaption("Attribute Dictionary"); this.obadvice = new ObadviceDictionary(); this.tabSheet.addComponent(this.obadvice); this.tabSheet.getTab(this.obadvice).setCaption("Obligation/Advice Dictionary"); } else { this.attributeDictionary = null; this.obadvice = null; } if (((XacmlAdminUI)UI.getCurrent()).isAuthorized( XacmlAdminAuthorization.AdminAction.ACTION_READ, XacmlAdminAuthorization.AdminResource.RESOURCE_PDP_ADMIN)) { this.pdp = new PDPManagement(((XacmlAdminUI)UI.getCurrent()).getPAPEngine()); this.tabSheet.addComponent(this.pdp); this.tabSheet.getTab(this.pdp).setCaption("PDP Management"); } else { this.pdp = null; } if (((XacmlAdminUI)UI.getCurrent()).isAuthorized( XacmlAdminAuthorization.AdminAction.ACTION_READ, XacmlAdminAuthorization.AdminResource.RESOURCE_PIP_ADMIN)) { this.pip = new PIPManagement(); this.tabSheet.addComponent(this.pip); this.tabSheet.getTab(this.pip).setCaption("PIP Management"); } else { this.pip = null; } /* * TODO - figure out how to add this in * if (((XacmlAdminUI)UI.getCurrent()).isAuthorized( XacmlAdminAuthorization.AdminAction.ACTION_READ, XacmlAdminAuthorization.AdminResource.RESOURCE_POLICY_WORKSPACE)) { this.user = new UserManagement(); this.tabSheet.addComponent(this.user); this.tabSheet.getTab(this.user).setCaption("User Management"); } */ if (logger.isDebugEnabled()) { logger.debug("Done creating tabs."); } }
Example #25
Source File: TestGenerationView.java From RDFUnit with Apache License 2.0 | 4 votes |
private void initLayout() { this.setWidth("100%"); resultsTable.setHeight("250px"); resultsTable.setWidth("100%"); resultsTable.addContainerProperty("Type", String.class, null); resultsTable.addContainerProperty("URI", Link.class, null); resultsTable.addContainerProperty("Automatic", AbstractComponent.class, null); resultsTable.addContainerProperty("Manual", AbstractComponent.class, null); resultsTable.setColumnCollapsingAllowed(true); resultsTable.setSelectable(true); resultsTable.setVisible(false); this.addComponent(resultsTable); messageLabel.setValue("Press Generate to start generating test cases"); messageLabel.setContentMode(ContentMode.HTML); HorizontalLayout genHeader = new HorizontalLayout(); genHeader.setSpacing(true); genHeader.setWidth("100%"); this.addComponent(genHeader); genHeader.addComponent(messageLabel); genHeader.setExpandRatio(messageLabel, 1.0f); genHeader.setComponentAlignment(messageLabel, Alignment.MIDDLE_RIGHT); genHeader.addComponent(generateTestsProgress); generateTestsProgress.setWidth("80px"); genHeader.setComponentAlignment(generateTestsProgress, Alignment.MIDDLE_RIGHT); genHeader.addComponent(progressLabel); progressLabel.setWidth("40px"); genHeader.setComponentAlignment(progressLabel, Alignment.MIDDLE_RIGHT); genHeader.addComponent(cancelBtn); genHeader.setComponentAlignment(cancelBtn, Alignment.MIDDLE_RIGHT); genHeader.addComponent(generateBtn); genHeader.setComponentAlignment(generateBtn, Alignment.MIDDLE_RIGHT); initInteractions(); }
Example #26
Source File: DataSelectorView.java From RDFUnit with Apache License 2.0 | 4 votes |
private void initLayout() { VerticalLayout root = new VerticalLayout(); root.setSpacing(true); HorizontalLayout components = new HorizontalLayout(); components.setSpacing(true); components.setWidth("100%"); setInputTypes(); setInputFormats(); setInputText(); VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSpacing(true); verticalLayout.setWidth("200px"); verticalLayout.addComponent(inputTypeSelect); verticalLayout.addComponent(inputFormatsSelect); components.addComponent(verticalLayout); components.addComponent(inputText); components.setExpandRatio(inputText, 1.0f); HorizontalLayout bottomLayout = new HorizontalLayout(); bottomLayout.setWidth("100%"); bottomLayout.setSpacing(true); bottomLayout.addComponent(messageLabel); bottomLayout.setExpandRatio(messageLabel, 1.0f); messageLabel.setContentMode(ContentMode.HTML); bottomLayout.addComponent(clearBtn); bottomLayout.addComponent(loadBtn); root.addComponent(components); root.addComponent(bottomLayout); setDefaultValues(); setCompositionRoot(root); clearBtn.addClickListener((Button.ClickListener) clickEvent -> { isReady = false; setDefaultValues(); }); loadBtn.addClickListener((Button.ClickListener) clickEvent -> UI.getCurrent().access(() -> { DataSelectorView.this.loadBtn.setEnabled(false); setMessage("Loading...", false); CommonAccessUtils.pushToClient(); DataSelectorView.this.execute(); DataSelectorView.this.loadBtn.setEnabled(true); CommonAccessUtils.pushToClient(); })); }
Example #27
Source File: SchemaSelectorView.java From RDFUnit with Apache License 2.0 | 4 votes |
private void initLayout() { VerticalLayout root = new VerticalLayout(); root.setSpacing(true); HorizontalLayout components = new HorizontalLayout(); components.setSpacing(true); components.setWidth("100%"); setInputTypes(); setInputFormats(); setInputText(); VerticalLayout optionSelection = new VerticalLayout(); optionSelection.setSpacing(true); optionSelection.setWidth("200px"); optionSelection.addComponent(inputTypeSelect); optionSelection.addComponent(inputFormatsSelect); VerticalLayout optionValues = new VerticalLayout(); optionSelection.setSpacing(true); optionValues.addComponent(datasetMessage); optionValues.addComponent(ontologyMessage); optionValues.addComponent(specificSchemasMessage); optionValues.addComponent(schemaSelectorWidget); schemaSelectorWidget.setWidth("50%"); optionValues.addComponent(inputText); components.addComponent(optionSelection); components.addComponent(optionValues); components.setExpandRatio(optionValues, 1.0f); HorizontalLayout bottomLayout = new HorizontalLayout(); bottomLayout.setWidth("100%"); bottomLayout.setSpacing(true); bottomLayout.addComponent(messageLabel); bottomLayout.setExpandRatio(messageLabel, 1.0f); messageLabel.setContentMode(ContentMode.HTML); bottomLayout.addComponent(clearBtn); bottomLayout.addComponent(loadBtn); root.addComponent(components); root.addComponent(bottomLayout); setDefaultValues(); setCompositionRoot(root); clearBtn.addClickListener((Button.ClickListener) clickEvent -> UI.getCurrent().access(() -> { isReady = false; setDefaultValues(); SchemaSelectorView.this.loadBtn.setEnabled(true); CommonAccessUtils.pushToClient(); })); loadBtn.addClickListener((Button.ClickListener) clickEvent -> UI.getCurrent().access(() -> { SchemaSelectorView.this.loadBtn.setEnabled(false); setMessage("Loading...", false); CommonAccessUtils.pushToClient(); SchemaSelectorView.this.execute(); SchemaSelectorView.this.loadBtn.setEnabled(true); CommonAccessUtils.pushToClient(); })); }
Example #28
Source File: RDFUnitDemo.java From RDFUnit with Apache License 2.0 | 4 votes |
private void initLayoutFooter() { layoutFooter.setHeight("40px"); layoutFooter.addStyleName("v-link"); layoutFooter.addComponent(new Label("@ <a href=\"http://aksw.org\">AKSW</a> / <a href=\"http://rdfunit.aksw.org\">RDFUnit</a>", ContentMode.HTML)); }
Example #29
Source File: RolloutGroupTargetsCountLabelMessage.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private void applyStyle() { /* Create label for Targets count message displaying below the table */ addStyleName(SPUIStyleDefinitions.SP_LABEL_MESSAGE_STYLE); setContentMode(ContentMode.HTML); setId(UIComponentIdProvider.COUNT_LABEL); }
Example #30
Source File: ReportView.java From chipster with MIT License | 4 votes |
public Label createReportLabel(String text) { Label label = new Label(text, ContentMode.PREFORMATTED); label.addStyleName("report-text"); return label; }