com.vaadin.ui.Label Java Examples

The following examples show how to use com.vaadin.ui.Label. 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: ModuleLayout.java    From usergrid with Apache License 2.0 6 votes vote down vote up
public void loadData( Table userTable ){
    ModuleDao moduleDao = InjectorFactory.getInstance( ModuleDao.class );
    List<Module> modules = moduleDao.getAll();
    for( final Module module : modules ) {
        Label groupLabel = new Label( module.getGroupId( ) );
        Label artifactLabel = new Label( module.getArtifactId( ) );
        Label versionLabel = new Label( module.getVersion( ) );

        Button detailsField = new Button( "show details" );
        detailsField.addStyleName( "link" );
        detailsField.addClickListener( new Button.ClickListener( ) {
            @Override
            public void buttonClick( Button.ClickEvent event ) {
                onItemClick( module.getId() );
            }
        } );
        userTable.addItem( new Object[]{ groupLabel, artifactLabel, versionLabel, detailsField }, module.getId( ) );
    }
}
 
Example #2
Source File: AbstractView.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the top title header.
 *
 * @param topHeader
 *            the top header
 */
private static void createTopTitleHeader(final HorizontalLayout topHeader) {
	final HorizontalLayout topTitleHeadertPanel = new HorizontalLayout();


	final Label titleLabel = new Label("Citizen Intelligence Agency");
	titleLabel.setStyleName("Header");
	topTitleHeadertPanel.addComponent(titleLabel);
	topTitleHeadertPanel.setComponentAlignment(titleLabel, Alignment.MIDDLE_LEFT);

	final Label sloganLabel = new Label("// Tracking politicians like bugs!");
	sloganLabel.setStyleName("HeaderSlogan");
	topTitleHeadertPanel.addComponent(sloganLabel);
	topTitleHeadertPanel.setComponentAlignment(sloganLabel, Alignment.MIDDLE_RIGHT);

	topHeader.addComponent(topTitleHeadertPanel);
	topHeader.setComponentAlignment(topTitleHeadertPanel, Alignment.MIDDLE_LEFT);
	topHeader.setExpandRatio(topTitleHeadertPanel, ContentRatio.GRID);
}
 
Example #3
Source File: WinServerAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.availableService"));
    setWidth("100%");
    setHeight("100px");
    setPageLength(3);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(false);
    setMultiSelect(false);
    setImmediate(true);
    addStyleName("win-server-add-service");

    //カラム設定
    addContainerProperty("Service", Label.class, new Label());
    addContainerProperty("Description", String.class, null);
    setColumnExpandRatio("Service", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example #4
Source File: WinServerAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<PlatformDto> platforms) {
    removeAllItems();

    if (platforms == null) {
        return;
    }

    for (int i = 0; i < platforms.size(); i++) {
        PlatformDto platform = platforms.get(i);

        // プラットフォーム名
        Icons icon = IconUtils.getPlatformIcon(platform);
        String description = platform.getPlatform().getPlatformNameDisp();
        Label slbl = new Label(IconUtils.createImageTag(getApplication(), icon, description),
                Label.CONTENT_XHTML);
        slbl.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { (i + 1), slbl }, platform.getPlatform().getPlatformNo());
    }
}
 
Example #5
Source File: AboutWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
public AboutWindow() {
    MHorizontalLayout content = new MHorizontalLayout().withMargin(true).withFullWidth();
    this.setContent(content);

    Image about = new Image("", new ExternalResource(StorageUtils.generateAssetRelativeLink(WebResourceIds._about)));

    MVerticalLayout rightPanel = new MVerticalLayout();
    ELabel versionLbl = ELabel.h2(String.format("MyCollab Community Edition %s", Version.getVersion())).withFullWidth();
    ELabel javaNameLbl = new ELabel(String.format("%s, %s", System.getProperty("java.vm.name"),
            System.getProperty("java.runtime.version"))).withFullWidth();
    Label homeFolderLbl = new Label("Home folder: " + AppContextUtil.getSpringBean(ServerConfiguration.class).getHomeDir().getAbsolutePath());
    WebBrowser browser = Page.getCurrent().getWebBrowser();
    ELabel osLbl = new ELabel(String.format("%s, %s", System.getProperty("os.name"), browser.getBrowserApplication())).withFullWidth();
    Div licenseDiv = new Div().appendChild(new Text("Powered by: "))
            .appendChild(new A("https://www.mycollab.com")
                    .appendText("MyCollab")).appendChild(new Text(". Open source under GPL license"));
    ELabel licenseLbl = ELabel.html(licenseDiv.write()).withFullWidth();
    Label copyRightLbl = ELabel.html(String.format("&copy; %s - %s MyCollab Ltd. All rights reserved", "2011",
            LocalDate.now().getYear() + "")).withFullWidth();
    rightPanel.with(versionLbl, javaNameLbl, osLbl, homeFolderLbl, licenseLbl, copyRightLbl).withAlign(copyRightLbl, Alignment.BOTTOM_LEFT);
    content.with(about, rightPanel).expand(rightPanel);
}
 
Example #6
Source File: AbstractSoftwareModuleDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected void updateSoftwareModuleDetailsLayout(final String type, final String vendor, final String maxAssign) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();

    detailsTabLayout.removeAllComponents();

    final Label vendorLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.dist.details.vendor"), vendor == null ? "" : vendor);
    vendorLabel.setId(UIComponentIdProvider.DETAILS_VENDOR_LABEL_ID);
    detailsTabLayout.addComponent(vendorLabel);

    if (type != null) {
        final Label typeLabel = SPUIComponentProvider
                .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type);
        typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
        detailsTabLayout.addComponent(typeLabel);
    }

    final Label assignLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.assigned.type"), maxAssign == null ? "" : maxAssign);
    assignLabel.setId(UIComponentIdProvider.SWM_DTLS_MAX_ASSIGN);
    detailsTabLayout.addComponent(assignLabel);
}
 
Example #7
Source File: MyCloudAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    // テーブル基本設定
    setWidth("100%");
    addStyleName("win-mycloud-add-temp");
    setCaption(ViewProperties.getCaption("table.selectTemplate"));
    setPageLength(4);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);

    // カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Name", Label.class, new Label());
    setColumnExpandRatio("Name", 100);

    // テーブルのカラムに対してStyleNameを設定
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example #8
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void updateDetailsLayout(final String controllerId, final URI address, final String securityToken,
        final String lastQueryDate) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label controllerLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.id"), controllerId == null ? "" : controllerId);
    controllerLabel.setId(UIComponentIdProvider.TARGET_CONTROLLER_ID);
    detailsTabLayout.addComponent(controllerLabel);

    final Label lastPollDtLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.lastpolldate"), lastQueryDate == null ? "" : lastQueryDate);
    lastPollDtLabel.setId(UIComponentIdProvider.TARGET_LAST_QUERY_DT);
    detailsTabLayout.addComponent(lastPollDtLabel);

    final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.ip"),
            address == null ? "" : address.toString());
    typeLabel.setId(UIComponentIdProvider.TARGET_IP_ADDRESS);
    detailsTabLayout.addComponent(typeLabel);

    final HorizontalLayout securityTokenLayout = getSecurityTokenLayout(securityToken);
    controllerLabel.setId(UIComponentIdProvider.TARGET_SECURITY_TOKEN);
    detailsTabLayout.addComponent(securityTokenLayout);
}
 
Example #9
Source File: TargetTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
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 #10
Source File: WinLoadBalancerAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<String> types) {
    removeAllItems();

    if (types == null) {
        return;
    }

    for (int i = 0; i < types.size(); i++) {
        String type = types.get(i);

        // ロードバランサ種別
        Icons typeIcon = Icons.NONE;
        String typeString = ViewProperties.getLoadBalancerType(type);
        Label nlbl = new Label(IconUtils.createImageTag(getApplication(), typeIcon, typeString),
                Label.CONTENT_XHTML);
        nlbl.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { (i + 1), nlbl }, type);
    }
}
 
Example #11
Source File: GetStartedInstructionWindow.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void displayInfo(SimpleUser user) {
    Div infoDiv = new Div().appendText("You have not setup SMTP account properly. So we can not send the invitation by email automatically. Please copy/paste below paragraph and inform to the user by yourself").setStyle("font-weight:bold;color:red");
    Label infoLbl = new Label(infoDiv.write(), ContentMode.HTML);

    Div userInfoDiv = new Div().appendText("Your username is ").appendChild(new B().appendText(user.getEmail()));
    Label userInfoLbl = ELabel.html(userInfoDiv.write());

    if (Boolean.TRUE.equals(user.isAccountOwner())) {
        user.setRoleName(UserUIContext.getMessage(RoleI18nEnum.OPT_ACCOUNT_OWNER));
    }
    Div roleInfoDiv = new Div().appendText("Your role is ").appendChild(new B().appendText(user.getRoleName()));
    Label roleInfoLbl = new Label(roleInfoDiv.write(), ContentMode.HTML);
    contentLayout.with(infoLbl, userInfoLbl, roleInfoLbl);

    final Button addNewBtn = new Button("Create another user", clickEvent -> {
        EventBusFactory.getInstance().post(new UserEvent.GotoAdd(GetStartedInstructionWindow.this, null));
        close();
    });
    addNewBtn.setStyleName(WebThemes.BUTTON_ACTION);

    Button doneBtn = new Button(UserUIContext.getMessage(GenericI18Enum.ACTION_DONE), clickEvent -> close());
    doneBtn.setStyleName(WebThemes.BUTTON_ACTION);

    final MHorizontalLayout controlsBtn = new MHorizontalLayout(addNewBtn, doneBtn).withMargin(true);
    contentLayout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
}
 
Example #12
Source File: RowUtil.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the row component.
 *
 * @param row         the row
 * @param component   the component
 * @param description the description
 */
public static void createRowComponent(final ResponsiveRow row, final Component component,
		final String description) {
	final CssLayout layout = new CssLayout();
	layout.addStyleName(".v-layout-content-pagemode-panel-level2");
	Responsive.makeResponsive(layout);
	layout.setSizeUndefined();

	final Label descriptionLabel = new Label(description);
	descriptionLabel.addStyleName(ITEMBOX);
	Responsive.makeResponsive(descriptionLabel);
	descriptionLabel.setWidth(100, Unit.PERCENTAGE);
	layout.addComponent(descriptionLabel);

	component.addStyleName(ITEMBOX);
	component.addStyleName(TITLE);
	Responsive.makeResponsive(component);
	component.setWidth(100, Unit.PERCENTAGE);
	layout.addComponent(component);

	row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE,
			DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
 
Example #13
Source File: WinServerAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.selectCloud"));
    setWidth("470px");
    setPageLength(4);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-server-add-cloud");

    // カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Cloud", Label.class, new Label());
    setColumnExpandRatio("Cloud", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example #14
Source File: FormUtils.java    From jdal with Apache License 2.0 6 votes vote down vote up
/**
   * 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 #15
Source File: WinServiceAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.selectService"));
    setWidth("440px");
    setPageLength(4);
    setSortDisabled(true);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-service-add-service");

    // カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Service", Label.class, new Label());
    addContainerProperty("Description", String.class, null);
    setColumnExpandRatio("Description", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example #16
Source File: AbstractDistributionSetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label typeLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type == null ? "" : type);
    typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
    detailsTabLayout.addComponent(typeLabel);

    final Label requiredMigrationStepLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("checkbox.dist.migration.required"),
            getMigrationRequiredValue(isMigrationRequired));
    requiredMigrationStepLabel.setId(UIComponentIdProvider.DETAILS_REQUIRED_MIGRATION_STEP_LABEL_ID);
    if (!isMultiAssignmentEnabled()) {
        detailsTabLayout.addComponent(requiredMigrationStepLabel);
    }

}
 
Example #17
Source File: WinServerEdit.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<ComponentType> componentTypes) {
    removeAllItems();

    if (componentTypes == null) {
        return;
    }

    for (ComponentType componentType : componentTypes) {
        // サービス名
        String name = componentType.getComponentTypeNameDisp();
        Icons nameIcon = Icons.fromName(componentType.getComponentTypeName());
        Label slbl = new Label(IconUtils.createImageTag(getApplication(), nameIcon, name), Label.CONTENT_XHTML);
        slbl.setHeight("26px");

        // サービス説明
        String description = componentType.getLayerDisp();

        addItem(new Object[] { slbl, description }, componentType.getComponentTypeNo());
    }
}
 
Example #18
Source File: WinServerAddSimple.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.selectCloud"));
    setWidth("260px");
    setPageLength(6);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-server-add-cloud");

    //カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Cloud", Label.class, new Label());
    setColumnExpandRatio("Cloud", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example #19
Source File: GroupsLegendLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Populates the legend based on a list of anonymous groups. They can't have
 * unassigned targets.
 * 
 * @param listOfTargetCountPerGroup
 *            list of target counts
 */
public void populateGroupsLegendByTargetCounts(final List<Long> listOfTargetCountPerGroup) {
    loadingLabel.setVisible(false);

    for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(listOfTargetCountPerGroup.size()); i++) {
        final Component component = groupsLegend.getComponent(i);
        final Label label = (Label) component;
        if (listOfTargetCountPerGroup.size() > i) {
            final Long targetCount = listOfTargetCountPerGroup.get(i);
            label.setValue(getTargetsInGroupMessage(targetCount,
                    i18n.getMessage("textfield.rollout.group.default.name", i + 1)));
            label.setVisible(true);
        } else {
            label.setValue("");
            label.setVisible(false);
        }
    }

    showOrHideToBeContinueLabel(listOfTargetCountPerGroup);

    unassignedTargetsLabel.setValue("");
    unassignedTargetsLabel.setVisible(false);
}
 
Example #20
Source File: Tool.java    From chipster with MIT License 6 votes vote down vote up
private void initElements() {
	lbId.setValue("Id:");
	lbModule = new Label("Module:");
	lbCategory = new Label("Category:");
	
	module = new ComboBox();
	module.setWidth(WIDTH);
	
	category = new ComboBox();
	category.setWidth(WIDTH);
	
	id.setImmediate(true);
	name.setRequired(true);
	name.setRequiredError(REQUIRED_TEXT);
	description.setRequired(true);
	description.setRequiredError(REQUIRED_TEXT);
}
 
Example #21
Source File: MyCloudManage.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    //テーブル基本設定
    setWidth("100%");

    setPageLength(4);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-mycloud-edit-table");

    //カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Name", Label.class, new Label());
    addContainerProperty("Description", String.class, null);
    setColumnExpandRatio("Name", 40);
    setColumnExpandRatio("Description", 60);

    //テーブルのカラムに対してStyleNameを設定
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example #22
Source File: QuestionnaireView.java    From gazpachoquest with GNU General Public License v3.0 5 votes vote down vote up
public void update(QuestionnairePageDTO page) {
    questionsLayout.removeAllComponents();

    List<SectionDTO> sections = page.getSections();

    for (SectionDTO sectionDTO : sections) {
        if (sectionInfoVisible && page.isSectionInfoAvailable()) {
            final Label sectionTile = new Label(sectionDTO.getLanguageSettings().getTitle());
            sectionTile.addStyleName(Reindeer.LABEL_H2);
            questionsLayout.addComponent(sectionTile);
        }
        List<QuestionDTO> questions = sectionDTO.getQuestions();
        for (QuestionDTO questionDTO : questions) {
            QuestionComponent questionComponent;
            try {
                questionComponent = QuestionFactory.build(questionnaireId, questionDTO);
                questionsLayout.addComponent(questionComponent);
            } catch (NotSupportedException e) {
                logger.warn(e.getMessage());
            }
        }

    }

    HorizontalLayout buttonsLayout = new HorizontalLayout();

    if (page.getMetadata().isNotFirst()) {
        previousButton.addClickListener(this);
        buttonsLayout.addComponent(previousButton);
    }

    if (page.getMetadata().isNotLast()) {
        nextButton.addClickListener(this);
        buttonsLayout.addComponent(nextButton);
    }
    questionsLayout.addComponent(buttonsLayout);
}
 
Example #23
Source File: CreateOrUpdateFilterTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void updateDescriptionLayout(final String description) {
    descriptionLayout.removeAllComponents();
    final Label descLabel = SPUIComponentProvider.createNameValueLabel("", description == null ? "" : description);
    /**
     * By default text will be truncated based on layout width. So removing it as we
     * need full description.
     */
    descLabel.removeStyleName("label-style");
    descLabel.setId(UIComponentIdProvider.DETAILS_DESCRIPTION_LABEL_ID);
    descriptionLayout.addComponent(descLabel);
}
 
Example #25
Source File: HelloVaadin.java    From tomee with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {

    //create the components you want to use
    // and set the main component with setContent(..)
    final Layout layout = new VerticalLayout();
    layout
        .addComponent(new Button("click me",
                                 event -> layout.addComponents(new Label("clicked again"))
        ));

    //set the main Component
    setContent(layout);
}
 
Example #26
Source File: Box.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Try to imitate a VerticalGlue of Swing BoxLayout
 */
public static void addVerticalGlue(AbstractOrderedLayout layout) {
	Label label = new Label(" ");
	label.setHeight("100%");
	layout.addComponent(label);
	layout.setExpandRatio(label, 1.0f);
}
 
Example #27
Source File: ToolEditorUI.java    From chipster with MIT License 5 votes vote down vote up
@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>&nbsp;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 #28
Source File: VaadinBindingUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
public static void registerControlAccessors(ConfigurableControlAccessorFactory accessorFactory) {
	Map<Class<?>, Class<?extends ControlAccessor>> accessors = accessorFactory.getAccessors();
	
	accessors.put(AbstractField.class, FieldAccessor.class);
	accessors.put(TextField.class, TextFieldAccessor.class);
	accessors.put(Label.class, LabelAccessor.class);
	accessors.put(PageableTable.class, PageableTableAccessor.class);
	accessors.put(Table.class, TableAccessor.class);
	accessors.put(TableEditor.class, TableEditorAccessor.class);
}
 
Example #29
Source File: AbstractActionTypeOptionGroupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void addForcedItemWithLabel() {
    final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.FORCED);
    forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    forceItem.setId(UIComponentIdProvider.SAVE_ACTION_RADIO_FORCED);
    addComponent(forceItem);
    final Label forceLabel = new Label();
    forceLabel.setStyleName("statusIconPending");
    forceLabel.setIcon(FontAwesome.BOLT);
    forceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_FORCED));
    forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM));
    forceLabel.setStyleName("padding-right-style");
    addComponent(forceLabel);
}
 
Example #30
Source File: AbstractActionTypeOptionGroupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void addDownloadOnlyItemWithLabel() {
    final FlexibleOptionGroupItemComponent downloadOnlyItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.DOWNLOAD_ONLY);
    downloadOnlyItem.setId(UIComponentIdProvider.ACTION_DETAILS_DOWNLOAD_ONLY_ID);
    downloadOnlyItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(downloadOnlyItem);
    final Label downloadOnlyLabel = new Label();
    downloadOnlyLabel.setSizeFull();
    downloadOnlyLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_DOWNLOAD_ONLY));
    downloadOnlyLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DOWNLOAD_ONLY_ITEM));
    downloadOnlyLabel.setStyleName("padding-right-style");
    downloadOnlyLabel.setIcon(FontAwesome.DOWNLOAD);
    addComponent(downloadOnlyLabel);
}