Examples of CellFormatter


Examples of com.smartgwt.client.widgets.grid.CellFormatter

            });

            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(ATTR_RESOURCE_ID));
                        String name = StringUtility.escapeHtml(value.toString());
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        super.configureTable();

        ListGrid listGrid = getListGrid();

        ListGridField resourceNameField = listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_RESOURCE_NAME);
        resourceNameField.setCellFormatter(new CellFormatter() {
            public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
                return LinkManager.getHref(url, o.toString());
            }
        });
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

     */
    public ArrayList<ListGridField> getListGridFields() {
        ArrayList<ListGridField> fields = super.getListGridFields();

        ListGridField resourceNameField = new ListGridField(AncestryUtil.RESOURCE_NAME, MSG.common_title_resource());
        resourceNameField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                String url = LinkManager.getResourceLink(record.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
                return LinkManager.getHref(url, value.toString());
            }
        });
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        listGrid.setShowAllRecords(true);
        //listGrid.setGroupStartOpen(GroupStartOpen.ALL);
        //listGrid.groupBy(MeasurementDataTraitCriteria.SORT_FIELD_DISPLAY_NAME);

        ListGridField resourceNameField = listGrid.getField(MeasurementDataTraitCriteria.SORT_FIELD_RESOURCE_NAME);
        resourceNameField.setCellFormatter(new CellFormatter() {
            public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
                return LinkManager.getHref(url, o.toString());
            }
        });
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        ListGridField name = new ListGridField(MeasurementDataTraitCriteria.SORT_FIELD_DISPLAY_NAME,
            MSG.dataSource_traits_field_trait());
        ListGridField value = new ListGridField("value", MSG.common_title_value());
        ListGridField resourceNameField = new ListGridField(MeasurementDataTraitCriteria.SORT_FIELD_RESOURCE_NAME,
            MSG.common_title_resource());
        resourceNameField.setCellFormatter(new CellFormatter() {
            public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                String url = LinkManager.getResourceLink(listGridRecord.getAttributeAsInt(AncestryUtil.RESOURCE_ID));
                return LinkManager.getHref(url, o.toString());
            }
        });
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        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(":.*", ""));
                }
                return displayName;
            }
        });

        ListGridField nameField = new ListGridField("name", MSG.common_title_name(), 150);
        nameField.setCellFormatter(new EscapedHtmlCellFormatter());
        ListGridField descriptionField = new ListGridField("description", MSG.common_title_description());
        descriptionField.setCellFormatter(new EscapedHtmlCellFormatter());
        ListGridField expressionField = new ListGridField("expression", MSG.view_dynagroup_expressionSet(), 250);
        expressionField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return value.toString().replaceAll("\\n", "<br/>");
            }
        });

View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        return AbstractConfigurationHistoryDataSource.Field.ID;
    }

    @Override
    protected CellFormatter getDetailsLinkColumnCellFormatter() {
        return new CellFormatter() {
            public String format(Object value, ListGridRecord record, int i, int i1) {
                Integer recordId = getId(record);
                String detailsUrl = "#" + getBasePath() + "/" + recordId;
                String cellHtml = LinkManager.getHref(detailsUrl, value.toString());
                String isCurrentConfig = record
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        alertsField.setWidth("10%");
        fields.add(alertsField);

        ListGridField minField = new ListGridField(FIELD_MIN, MSG.common_title_monitor_minimum());
        minField.setWidth("10%");
        minField.setCellFormatter(new CellFormatter() {
            @Override
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return record.getAttribute(FIELD_MIN_STRING);
            }
        });
        fields.add(minField);

        ListGridField maxField = new ListGridField(FIELD_MAX, MSG.common_title_monitor_maximum());
        maxField.setWidth("10%");
        maxField.setCellFormatter(new CellFormatter() {
            @Override
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return record.getAttribute(FIELD_MAX_STRING);
            }
        });
        fields.add(maxField);

        ListGridField avgField = new ListGridField(FIELD_AVG, MSG.common_title_monitor_average());
        avgField.setWidth("10%");
        avgField.setCellFormatter(new CellFormatter() {
            @Override
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return record.getAttribute(FIELD_AVG_STRING);
            }
        });
        fields.add(avgField);

        ListGridField totalField = new ListGridField(FIELD_TOTAL, MSG.view_resource_monitor_calltime_total());
        totalField.setWidth("10%");
        totalField.setCellFormatter(new CellFormatter() {
            @Override
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                return record.getAttribute(FIELD_TOTAL_STRING);
            }
        });
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

    protected void configureTable() {
        ListGridField idField = new ListGridField(FIELD_ID, MSG.common_title_id());

        ListGridField versionField = new ListGridField(BundleVersionDataSource.FIELD_VERSION,
            MSG.common_title_version());
        versionField.setCellFormatter(new CellFormatter() {
            public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                Integer _bundleId = listGridRecord.getAttributeAsInt("bundleId");
                Integer _bvId = listGridRecord.getAttributeAsInt("id");
                return "<a href=\"" + LinkManager.getBundleVersionLink(_bundleId, _bvId) + "\">" + o + "</a>";
            }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.CellFormatter

        details.setWidth(50);
        details.setAlign(Alignment.CENTER);
        details.setType(ListGridFieldType.ICON);
        details.setIconHeight(11);
        details.setIconWidth(11);
        details.setCellFormatter(new CellFormatter() {
            @Override
            public String format(Object o, ListGridRecord listGridRecord, int i, int i1) {
                return "<img src=\"images/subsystems/bundle/Details_11.png\"/>";
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.