Package org.rhq.coregui.client.components.table

Examples of org.rhq.coregui.client.components.table.IconField


    }

    protected List<ListGridField> createFields() {
        List<ListGridField> fields = new ArrayList<ListGridField>();

        IconField iconField = new IconField();
        iconField.setShowHover(true);
        iconField.setHoverCustomizer(new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                String resCat = record.getAttribute(CATEGORY.propertyName());
                switch (ResourceCategory.valueOf(resCat)) {
                case PLATFORM:
                    return MSG.common_title_platform();
                case SERVER:
                    return MSG.common_title_server();
                case SERVICE:
                    return MSG.common_title_service();
                }
                return null;
            }
        });
        fields.add(iconField);

        ListGridField nameField = new ListGridField(NAME.propertyName(), NAME.title(), 250);
        nameField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                String invStatus = record.getAttribute(INVENTORY_STATUS.propertyName());
                if (InventoryStatus.COMMITTED == InventoryStatus.valueOf(invStatus)) {
                    String url = LinkManager.getResourceLink(record.getAttributeAsInt("id"));
                    String name = StringUtility.escapeHtml(value.toString());
                    return LinkManager.getHref(url, name);
                } else {
                    return value.toString();
                }
            }
        });
        nameField.setShowHover(true);
        nameField.setHoverCustomizer(new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
                return AncestryUtil.getResourceHoverHTML(listGridRecord, 0);
            }
        });
        fields.add(nameField);

        ListGridField keyField = new ListGridField(KEY.propertyName(), KEY.title(), 170);
        keyField.setCellFormatter(new EscapedHtmlCellFormatter());
        fields.add(keyField);

        ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();
        fields.add(ancestryField);

        ListGridField descriptionField = new ListGridField(DESCRIPTION.propertyName(), DESCRIPTION.title());
        descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
        fields.add(descriptionField);

        ListGridField locationField = new ListGridField(LOCATION.propertyName(), LOCATION.title(), 180);
        locationField.setCellFormatter(new EscapedHtmlCellFormatter());
        fields.add(locationField);

        ListGridField typeNameField = new ListGridField(TYPE.propertyName(), TYPE.title(), 130);
        fields.add(typeNameField);

        ListGridField pluginNameField = new ListGridField(PLUGIN.propertyName(), PLUGIN.title(), 100);
        fields.add(pluginNameField);

        ListGridField versionField = new ListGridField(VERSION.propertyName(), VERSION.title(), 60);
        fields.add(versionField);

        ListGridField categoryField = new ListGridField(CATEGORY.propertyName(), CATEGORY.title(), 60);
        categoryField.setCellFormatter(new ResourceCategoryCellFormatter());
        fields.add(categoryField);

        IconField availabilityField = new IconField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 70);
        fields.add(availabilityField);

        ListGridField ctimeField = new ListGridField(CTIME.propertyName(), CTIME.title(), 120);
        ctimeField.setCellFormatter(new TimestampCellFormatter());
        fields.add(ctimeField);
View Full Code Here


    @Override
    protected void configureTable() {
        ListGridField idField = new ListGridField("id", MSG.common_title_id());
        idField.setWidth(50);

        IconField categoryField = new IconField(CATEGORY.propertyName());
        categoryField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                String categoryName = (String) value;
                GroupCategory category = GroupCategory.valueOf(categoryName);
                String icon = ImageManager.getGroupIcon(category);
                return "<img class='tableImage' src=\"" + ImageManager.getFullImagePath(icon) + "\" />";
            }
        });
        categoryField.setShowHover(true);
        categoryField.setHoverCustomizer(new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                String categoryName = record.getAttribute(CATEGORY.propertyName());
                GroupCategory category = GroupCategory.valueOf(categoryName);
                String displayName;
                switch (category) {
View Full Code Here

                }
            });

            fields.add(metricNameField);

            IconField iconField = new IconField(FIELD_ICON);
            iconField.setWidth(25);

            // click an icon, win a chart
            iconField.addRecordClickHandler(new RecordClickHandler() {
                @Override
                public void onRecordClick(RecordClickEvent event) {
                    Record record = event.getRecord();

                    String title = record.getAttribute(NAME.propertyName());
View Full Code Here

    protected void configureTable() {
        ListGridField idField = new ListGridField("id", MSG.common_title_id());
        idField.setType(ListGridFieldType.INTEGER);
        idField.setWidth(50);

        IconField originField = new IconField("cannedExpression");
        originField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                String icon = "global/User_16.png";
                if (value!=null) {
                    icon = "global/Plugin_16.png";
                }
                return "<img class='tableImage' src=\"" + ImageManager.getFullImagePath(icon) + "\" />";
            }
        });
        originField.setShowHover(true);
        originField.setHoverCustomizer(new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                String expr = record.getAttribute("cannedExpression");
                String displayName = MSG.view_dynagroup_originHoverUser();
                if (expr!=null) {
                    displayName = MSG.view_dynagroup_originHoverPlugin(expr.replaceAll(":.*", ""));
View Full Code Here

        ListGridField ancestryField = AncestryUtil.setupAncestryListGridField();

        ListGridField alertsField = new ListGridField(ALERTS.propertyName(), ALERTS.title(), 70);

        IconField availabilityField = new IconField(AVAILABILITY.propertyName(), AVAILABILITY.title(), 70);

        setListGridFields(resourceField, ancestryField, alertsField, availabilityField);
    }
View Full Code Here

                String name = StringUtility.escapeHtml(value.toString());
                return LinkManager.getHref(url, name);
            }
        });

        IconField inComplianceField = new IconField(DataSource.ATTR_IN_COMPLIANCE, MSG.common_title_in_compliance(), 95);
        inComplianceField.setCanSortClientOnly(true);
        fields.add(inComplianceField);

        return fields;
    }
View Full Code Here

        ListGridField resourceIdField = FIELD_RESOURCE_ID.getListGridField("120");
        //        resourceIdField.setHidden(true);
        fields.add(resourceIdField);

        IconField availabilityField = new IconField(FIELD_AVAILABILITY.propertyName(), FIELD_AVAILABILITY.title(), 70);
        fields.add(availabilityField);

        return fields;
    }
View Full Code Here

                return "<a href=\"" + LinkManager.getResourceLink(listGridRecord.getAttributeAsInt("id")) + "\">" + o
                    + "</a>";
            }
        });

        IconField availabilityField = new IconField(ResourceDataSourceField.AVAILABILITY.propertyName(),
            MSG.common_title_availability(), 70);

        ListGridField versionField = new ListGridField(ResourceDataSourceField.VERSION.propertyName(),
            MSG.common_title_version());

        ListGridField cpuField = new ListGridField(FIELD_CPU, MSG.dataSource_platforms_field_cpu());
        ListGridField memoryField = new ListGridField(FIELD_MEMORY, MSG.dataSource_platforms_field_memory());
        ListGridField swapField = new ListGridField(FIELD_SWAP, MSG.dataSource_platforms_field_swap());

        nameField.setWidth("20%");
        availabilityField.setWidth(70);
        versionField.setWidth("20%");
        cpuField.setWidth("20%");
        memoryField.setWidth("20%");
        swapField.setWidth("20%");
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.table.IconField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.