Java Code Examples for com.vaadin.ui.Label#CONTENT_XHTML

The following examples show how to use com.vaadin.ui.Label#CONTENT_XHTML . 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: WinServiceAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<ComponentTypeDto> componentTypes) {
    removeAllItems();

    if (componentTypes == null) {
        return;
    }

    for (int i = 0; i < componentTypes.size(); i++) {
        ComponentTypeDto componentType = componentTypes.get(i);

        // サービス名
        String name = componentType.getComponentType().getComponentTypeNameDisp();
        Icons nameIcon = Icons.fromName(componentType.getComponentType().getComponentTypeName());
        Label slbl = new Label(IconUtils.createImageTag(getApplication(), nameIcon, name), Label.CONTENT_XHTML);
        slbl.setHeight(COLUMN_HEIGHT);

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

        addItem(new Object[] { (i + 1), slbl, description },
                componentType.getComponentType().getComponentTypeNo());
    }
}
 
Example 2
Source File: MyCloudAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<TemplateDto> templates) {
    removeAllItems();

    if (templates == null) {
        return;
    }

    for (int i = 0; i < templates.size(); i++) {
        TemplateDto template = templates.get(i);

        // テンプレート名
        String name = template.getTemplate().getTemplateNameDisp();
        Icons nameIcon = Icons.CUSTOM;
        Label slbl = new Label(IconUtils.createImageTag(getApplication(), nameIcon, name), Label.CONTENT_XHTML);
        slbl.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { (i + 1), slbl }, template.getTemplate().getTemplateNo());
    }
}
 
Example 3
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 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<ImageDto> images) {
    removeAllItems();

    if (images == null) {
        return;
    }

    for (int i = 0; i < images.size(); i++) {
        ImageDto image = images.get(i);

        // サーバ種別名
        String name = image.getImage().getImageNameDisp();
        Icons nameIcon = IconUtils.getImageIcon(image);
        Label nlbl = new Label(IconUtils.createImageTag(getApplication(), nameIcon, name), Label.CONTENT_XHTML);
        nlbl.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { (i + 1), nlbl }, image.getImage().getImageNo());
    }
}
 
Example 5
Source File: WinServerAdd.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 6
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 7
Source File: WinLoadBalancerAdd.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<LoadBalancerPlatformDto> platforms) {
    removeAllItems();

    if (platforms == null) {
        return;
    }

    for (int i = 0; i < platforms.size(); i++) {
        LoadBalancerPlatformDto platformDto = platforms.get(i);

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

        addItem(new Object[] { (i + 1), slbl }, platformDto.getPlatform().getPlatformNo());
    }
}
 
Example 8
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 9
Source File: MyCloudManage.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
public void show(List<FarmDto> farms) {
    removeAllItems();

    if (farms == null) {
        return;
    }

    for (int i = 0; i < farms.size(); i++) {
        FarmDto farm = farms.get(i);

        // myCloud名
        Icons nameIcon = Icons.CLOUD;
        Label slbl = new Label(
                IconUtils.createImageTag(getApplication(), nameIcon, farm.getFarm().getFarmName()),
                Label.CONTENT_XHTML);
        slbl.setHeight(COLUMN_HEIGHT);

        // コメント
        String comment = farm.getFarm().getComment();

        addItem(new Object[] { (i + 1), slbl, comment }, farm.getFarm().getFarmNo());
    }
}
 
Example 10
Source File: WinServerAddSimple.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
public void show(List<PlatformDto> platforms, ComponentType componentType) {
    removeAllItems();

    if (platforms == null) {
        return;
    }

    Long componentTypeNo = componentType.getComponentTypeNo();

    int index = 1;
    for (PlatformDto platform : platforms) {
        // サービス種別を利用可能かチェック
        boolean available = false;
        for (ImageDto tmpImage : platform.getImages()) {
            for (ComponentType tmpComponentType : tmpImage.getComponentTypes()) {
                if (componentTypeNo.equals(tmpComponentType.getComponentTypeNo())) {
                    available = true;
                    break;
                }
            }
            if (available) {
                break;
            }
        }
        if (!available) {
            continue;
        }

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

        addItem(new Object[] { index, label }, platform.getPlatform().getPlatformNo());
        index++;
    }
}
 
Example 11
Source File: WinLoadBalancerAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
public void show(List<ComponentDto> components) {
    removeAllItems();

    if (components == null) {
        return;
    }

    for (int i = 0; i < components.size(); i++) {
        ComponentDto componentDto = components.get(i);

        // サービス名
        String serviceName = componentDto.getComponent().getComponentName();
        if (StringUtils.isNotEmpty(componentDto.getComponent().getComment())) {
            serviceName = componentDto.getComponent().getComment() + "\n[" + serviceName + "]";
        }
        Label nameLabel = new Label(serviceName, Label.CONTENT_PREFORMATTED);

        // サービス種類
        ComponentType componentType = componentDto.getComponentType();
        String typeName = componentType.getComponentTypeNameDisp();
        Icons typeIcon = Icons.fromName(componentType.getComponentTypeName());
        Label typeLabel = new Label(IconUtils.createImageTag(getApplication(), typeIcon, typeName),
                Label.CONTENT_XHTML);
        typeLabel.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { nameLabel, typeLabel }, componentDto.getComponent().getComponentNo());
    }
}
 
Example 12
Source File: WinServerAttachService.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
public void show(List<ComponentDto> components) {
    this.components = components;

    removeAllItems();

    if (components == null) {
        return;
    }

    for (ComponentDto component : components) {
        // チェックボックス
        CheckBox checkBox = new CheckBox();
        checkBox.setImmediate(true);
        checkBox.setEnabled(false);
        if (selectedComponentNos.contains(component.getComponent().getComponentNo())) {
            checkBox.setValue(true);
        } else {
            checkBox.setValue(false);
        }

        checkBox.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(Property.ValueChangeEvent event) {
                // チェックボックスの有効/無効を制御
                changeCheckEnabled();

                // テーブル再描画
                requestRepaint();
            }
        });

        // サービス名
        String serviceName = component.getComponent().getComponentName();
        if (StringUtils.isNotEmpty(component.getComponent().getComment())) {
            serviceName = component.getComponent().getComment() + "\n[" + serviceName + "]";
        }
        Label serviceNameLabel = new Label(serviceName, Label.CONTENT_PREFORMATTED);
        serviceNameLabel.setHeight(COLUMN_HEIGHT);

        // ステータス
        String status = null;
        if (instance != null) {
            for (ComponentInstanceDto componentInstance : instance.getComponentInstances()) {
                if (componentInstance.getComponentInstance().getComponentNo()
                        .equals(component.getComponent().getComponentNo())) {
                    status = componentInstance.getComponentInstance().getStatus();
                    break;
                }
            }
        }
        if (StringUtils.isEmpty(status)) {
            status = "Stopped";
        } else {
            status = StringUtils.capitalize(StringUtils.lowerCase(status));
        }

        Icons statusIcon = Icons.fromName(status);
        Label statusLabel = new Label(IconUtils.createImageTag(getApplication(), statusIcon, status),
                Label.CONTENT_XHTML);
        statusLabel.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { checkBox, serviceNameLabel, statusLabel },
                component.getComponent().getComponentNo());
    }

    changeCheckEnabled();
}