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

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


        }
    }

    @SuppressWarnings("unchecked")
    private Table getNotificationsForAlert(Record record) {
        Table notifTable = new NotificationLogsTable(MSG.view_alert_common_tab_notifications(), record);
        return notifTable;
    }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    private Table getConditionsForAlert(Record record) {
        String mode = record.getAttribute("conditionExpression");
        Table table = new ConditionLogsTable(MSG.view_alert_common_tab_conditions() + ": match = " + mode, record);
        return table;
    }
View Full Code Here

    private Tab createVersionsTab() {
        Tab versionsTab = new Tab(MSG.view_bundle_versions());
        Criteria criteria = new Criteria();
        criteria.addCriteria("bundleId", bundleBeingViewed);
        Table bundleVersionsTable = new BundleVersionListView(criteria);
        versionsTab.setPane(bundleVersionsTable);
        return versionsTab;
    }
View Full Code Here

        this.bundleVersionId = bundleVersionId;
    }

    private void viewFiles(PageList<BundleFile> files) {

        Table table = new Table(MSG.view_bundle_bundleFiles());
        table.setShowFooterRefresh(false);

        ListGridField id = new ListGridField(ID, MSG.common_title_id());
        ListGridField name = new ListGridField(NAME, MSG.common_title_name());
        ListGridField size = new ListGridField(FILESIZE, MSG.view_bundle_fileListView_fileSize());
        //ListGridField md5 = new ListGridField(MD5, MSG.view_bundle_fileListView_md5());
        ListGridField sha256 = new ListGridField(SHA256, MSG.view_bundle_fileListView_sha256());
        ListGridField version = new ListGridField(VERSION, MSG.common_title_version());

        id.setWidth("50");
        setAutoFitOnField(name);
        setAutoFitOnField(size);
        //setAutoFitOnField(md5);
        setAutoFitOnField(sha256);
        setAutoFitOnField(version);

        // To get the ListGrid the Table must be initialized (via onInit()) by adding to the Canvas
        addMember(table);

        ListGrid listGrid = table.getListGrid();
        listGrid.setFields(id, name, size, /*md5,*/sha256, version); // today, we don't set md5, no sense showing it
        listGrid.setData(buildRecords(files));
        table.setTableActionDisableOverride(true);
    }
View Full Code Here

        tagEditor.setExtraSpace(10);
        return tagEditor;
    }

    private Table addMemberDeploymentsTable() {
        Table table = new Table(MSG.view_bundle_deploy_deploymentPlatforms());
        table.setShowFooterRefresh(false);

        TitleBar titleBar = new TitleBar(MSG.view_bundle_deploy_selectARow());
        table.setTitleBar(titleBar);

        // resource icon field
        ResourceCategory resourceCategory = ResourceCategory.PLATFORM;
        try {
            resourceCategory = deployment.getDestination().getGroup().getResourceType().getCategory();
        } catch (Exception skip) { // BZ 1027732 in case a group somehow got empty or switched to a mixed group, avoid NPE
        }
        ListGridField resourceIcon = new ListGridField("resourceAvailability");
        HashMap<String, String> icons = new HashMap<String, String>();
        icons.put(AvailabilityType.UP.name(), ImageManager.getResourceIcon(resourceCategory, AvailabilityType.UP));
        icons.put(AvailabilityType.DOWN.name(), ImageManager.getResourceIcon(resourceCategory, AvailabilityType.DOWN));
        icons.put(AvailabilityType.DISABLED.name(),
            ImageManager.getResourceIcon(resourceCategory, AvailabilityType.DISABLED));
        icons.put(AvailabilityType.UNKNOWN.name(),
            ImageManager.getResourceIcon(resourceCategory, AvailabilityType.UNKNOWN));
        resourceIcon.setValueIcons(icons);
        resourceIcon.setValueIconSize(16);
        resourceIcon.setType(ListGridFieldType.ICON);
        resourceIcon.setWidth(40);

        // resource field
        ListGridField resource = new ListGridField("resource", MSG.common_title_resource());
        resource.setWidth("*");
        resource.setCellFormatter(new CellFormatter() {
            @Override
            public String format(Object value, ListGridRecord listGridRecord, int i, int i1) {
                return "<a href=\"" + LinkManager.getResourceLink(listGridRecord.getAttributeAsInt("resourceId"))
                    + "\">" + StringUtility.escapeHtml(String.valueOf(value)) + "</a>";

            }
        });

        // resource version field
        ListGridField resourceVersion = new ListGridField("resourceVersion", MSG.common_title_version());
        resourceVersion.setAutoFitWidth(true);
        resourceVersion.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);

        // status icon field
        ListGridField status = new ListGridField("status", MSG.common_title_status());
        status.setValueIcons(statusIcons);
        status.setValueIconHeight(11);
        status.setValueIconWidth(11);
        status.setShowValueIconOnly(true);
        status.setWidth(60);

        List<ListGridRecord> records = new ArrayList<ListGridRecord>();
        for (BundleResourceDeployment rd : deployment.getResourceDeployments()) {
            ListGridRecord record = new ListGridRecord();
            Resource rr = rd.getResource();
            record.setAttribute("resource", rr.getName());
            record.setAttribute("resourceAvailability", rr.getCurrentAvailability().getAvailabilityType().name());
            record.setAttribute("resourceId", rr.getId());
            record.setAttribute("resourceVersion", rr.getVersion());
            record.setAttribute("status", rd.getStatus().name());
            record.setAttribute("id", rd.getId());
            record.setAttribute("object", rd);
            records.add(record);
        }

        // To get the ListGrid the Table must be initialized (via onInit()) by adding to the Canvas
        table.setHeight("30%");
        table.setWidth100();
        table.setShowResizeBar(true);
        table.setResizeBarTarget("next");
        addMember(table);

        ListGrid listGrid = table.getListGrid();
        listGrid.setFields(resourceIcon, resource, resourceVersion, status);
        listGrid.setData(records.toArray(new ListGridRecord[records.size()]));
        listGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
            @Override
            public void onSelectionChanged(SelectionEvent selectionEvent) {
View Full Code Here

TOP

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

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.