Package com.smartgwt.client.widgets.form.fields

Examples of com.smartgwt.client.widgets.form.fields.StaticTextItem


                //                HeaderItem headerItem = new HeaderItem("header");
                //                headerItem.setValue("Inventory Summary");
                //                formItems.add(headerItem);

                StaticTextItem platformTotal = createSummaryRow("platformTotal", MSG.common_title_platform_total(),
                    summary.getPlatformCount(), LinkManager.getHubPlatformsLink());
                formItems.add(platformTotal);

                StaticTextItem serverTotal = createSummaryRow("serverTotal", MSG.common_title_server_total(),
                    summary.getServerCount(), LinkManager.getHubServersLink());
                formItems.add(serverTotal);

                StaticTextItem serviceTotal = createSummaryRow("serviceTotal", MSG.common_title_service_total(),
                    summary.getServiceCount(), LinkManager.getHubServicesLink());
                formItems.add(serviceTotal);

                StaticTextItem compatibleGroupTotal = createSummaryRow("compatibleGroupTotal",
                    MSG.common_title_compatibleGroups_total(), summary.getCompatibleGroupCount(),
                    LinkManager.getHubCompatibleGroupsLink());
                formItems.add(compatibleGroupTotal);

                StaticTextItem mixedGroupTotal = createSummaryRow("mixedGroupTotal",
                    MSG.common_title_mixedGroups_total(), summary.getMixedGroupCount(),
                    LinkManager.getHubMixedGroupsLink());
                formItems.add(mixedGroupTotal);

                StaticTextItem groupDefinitionTotal = createSummaryRow("groupDefinitionTotal",
                    MSG.common_title_group_def_total(), summary.getGroupDefinitionCount(),
                    LinkManager.getHubGroupDefinitionsLink());
                formItems.add(groupDefinitionTotal);

                StaticTextItem avergeMetricsTotal = createSummaryRow("averageMetricsTotal",
                    MSG.common_title_monitor_averagePerMinute(), summary.getScheduledMeasurementsPerMinute(), null);
                formItems.add(avergeMetricsTotal);

                form.setItems(formItems.toArray(new FormItem[formItems.size()]));
                form.setWrapItemTitles(false);
View Full Code Here


            }
        });
    }

    private StaticTextItem createSummaryRow(String name, String label, int value, final String viewPath) {
        final StaticTextItem item;
        if (viewPath != null) {
            item = new LinkItem(name);
            item.setTitleVAlign(VerticalAlignment.TOP); // see http://forums.smartclient.com/showthread.php?t=21284&highlight=LinkItem
            item.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    CoreGUI.goToView(viewPath);
                }
            });
        } else {
            item = new StaticTextItem(name);
        }
        item.setTitle(viewPath == null ? label : LinkManager.getHref(viewPath, label));
        item.setDefaultValue(value);
        item.setAlign(Alignment.CENTER);

        return item;
    }
View Full Code Here

        headerItem.setValue(MSG.view_inventory_summary_agent_title());
        formItems.add(headerItem);
        formItems.add(new SpacerItem());

        // Name
        nameValue = new StaticTextItem("name", MSG.common_title_name());
        formItems.add(nameValue);

        // Address
        String address = "address";
        addressValue = new StaticTextItem(address, MSG.common_title_address());
        formItems.add(addressValue);

        // Port
        String port = "port";
        portValue = new StaticTextItem(port, MSG.common_title_port());
        formItems.add(portValue);

        // Agent Status
        agentStatusIcon = new FormItemIcon();
        agentStatusIcon.setSrc(ImageManager.getAvailabilityLargeIcon(null));
        StaticTextItem agentStatus = new StaticTextItem("agent-comm-status",
            MSG.view_inventory_summary_agent_status_title());
        agentStatus.setIcons(agentStatusIcon);
        agentStatus.setWrapTitle(false);
        formItems.add(agentStatus);

        // Last Received Avail report
        String lastAvailReport = "last-avail-report";
        lastAvailReportValue = new StaticTextItem(lastAvailReport, MSG.view_inventory_summary_agent_last_title());
        lastAvailReportValue.setWrapTitle(false);
        formItems.add(lastAvailReportValue);

        // Last Received Avail ping
        lastAvailPingValue = new StaticTextItem("last-avail-ping", MSG.view_adminTopology_agent_lastAvailabilityPing());
        lastAvailPingValue.setWrapTitle(false);
        formItems.add(lastAvailPingValue);

        // Full Endpoint
        String fullEndpoint = "full-endpoint";
        endpointValue = new StaticTextItem(fullEndpoint, MSG.view_inventory_summary_agent_fullEnpoint());
        formItems.add(endpointValue);

        // link to agent topology view
        String topologyView = "topology-view";
        topologyViewItem = new StaticTextItem("topology-view", MSG.view_admin_topology());
        formItems.add(topologyViewItem);

        return formItems;
    }
View Full Code Here

                    child.destroy();
                }

                HeaderItem headerItem = new HeaderItem("header", MSG.view_inventory_summary_agent_title());
                headerItem.setValue(MSG.view_inventory_summary_agent_title());
                StaticTextItem permissionsMessage = new StaticTextItem("permissions", "permissionsFailure");
                permissionsMessage.setShowTitle(false);
                permissionsMessage.setValue(MSG.view_inventory_summary_agent_error3());
                permissionsMessage.setWrap(false);
                form.setFields(headerItem, new SpacerItem(), permissionsMessage);
                form.markForRedraw();
            }

            @Override
View Full Code Here

        form.setMargin(10);
        form.setWidth100();
        form.setWrapItemTitles(false);
        form.setNumCols(4);

        StaticTextItem nameItem = new StaticTextItem("name", MSG.common_title_name());
        nameItem.setValue(plugin.getName());

        StaticTextItem displayNameItem = new StaticTextItem("displayName", MSG.common_title_display_name());
        displayNameItem.setValue(plugin.getDisplayName());

        StaticTextItem versionItem = new StaticTextItem("version", MSG.common_title_version());
        versionItem.setValue(plugin.getVersion());

        StaticTextItem md5Item = new StaticTextItem("MD5", "MD5");
        md5Item.setValue(plugin.getMD5());

        StaticTextItem pathItem = new StaticTextItem("path", MSG.common_title_path());
        pathItem.setValue(plugin.getPath());

        StaticTextItem ampsItem = new StaticTextItem("ampsVersion", "AMPS " + MSG.common_title_version());
        ampsItem.setValue(plugin.getAmpsVersion());

        StaticTextItem descItem = new StaticTextItem("desc", MSG.common_title_description());
        descItem.setValue(plugin.getDescription());

        StaticTextItem mtimeItem = new StaticTextItem("mtime", MSG.common_title_lastUpdated());
        mtimeItem.setValue(TimestampCellFormatter.format(Long.valueOf(plugin.getMtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_MEDIUM));

        StaticTextItem kindItem = new StaticTextItem("kind", MSG.common_title_kind());
        switch (plugin.getDeployment()) {
        case AGENT:
            kindItem.setValue(MSG.view_admin_plugins_agent());
            break;
        case SERVER:
            kindItem.setValue(MSG.view_admin_plugins_server());
            break;
        }

        CanvasItem enabledItem = new CanvasItem("enabled", MSG.common_title_enabled());
        Img img = new Img(ImageManager.getAvailabilityIcon(plugin.isEnabled()), 16, 16);
        enabledItem.setCanvas(img);

        StaticTextItem typeItem = new StaticTextItem("type", MSG.common_title_type());
        typeItem.setValue(plugin.getType());

        form.setItems(displayNameItem, nameItem, versionItem, ampsItem, md5Item, kindItem, descItem, pathItem,
            mtimeItem, enabledItem, typeItem);

        SectionStackSection section = new SectionStackSection(MSG.common_title_details());
View Full Code Here

        form.setExtraSpace(10);
        form.setIsGroup(true);
        form.setGroupTitle(MSG.common_title_summary());
        form.setPadding(5);

        StaticTextItem bundleName = new StaticTextItem("bundle");
        bundleName.setTitle(MSG.common_title_bundle());
        bundleName.setValue("<a href=\"" + LinkManager.getBundleLink(bundle.getId()) + "\">"
            + StringUtility.escapeHtml(bundle.getName()) + "</a>");

        CanvasItem actionItem = new CanvasItem("actions");
        actionItem.setColSpan(1);
        actionItem.setRowSpan(4);
        actionItem.setShowTitle(false);
        actionItem.setCanvas(getActionLayout());

        StaticTextItem bundleVersionName = new StaticTextItem("bundleVersion");
        bundleVersionName.setTitle(MSG.view_bundle_bundleVersion());
        bundleVersionName.setValue("<a href=\""
            + LinkManager.getBundleVersionLink(bundle.getId(), deployment.getBundleVersion().getId()) + "\">"
            + StringUtility.escapeHtml(deployment.getBundleVersion().getVersion()) + "</a>");

        StaticTextItem deployed = new StaticTextItem("deployed", MSG.view_bundle_deployed());
        deployed.setValue(TimestampCellFormatter.format(deployment.getCtime(),
            TimestampCellFormatter.DATE_TIME_FORMAT_FULL));

        StaticTextItem deployedBy = new StaticTextItem("deployedBy", MSG.view_bundle_deploy_deployedBy());
        deployedBy.setValue(deployment.getSubjectName());

        StaticTextItem destinationGroup = new StaticTextItem("group");
        destinationGroup.setTitle(MSG.common_title_resource_group());
        destinationGroup.setValue("<a href=\""
            + LinkManager.getResourceGroupLink(deployment.getDestination().getGroup()) + "\">"
            + StringUtility.escapeHtml(deployment.getDestination().getGroup().getName()) + "</a>");

        StaticTextItem destBaseDir = new StaticTextItem("destBaseDir", MSG.view_bundle_dest_baseDirName());
        destBaseDir.setValue(deployment.getDestination().getDestinationSpecificationName());

        StaticTextItem path = new StaticTextItem("path", MSG.view_bundle_deployDir());
        path.setValue(deployment.getDestination().getDeployDir());

        StaticTextItem description = new StaticTextItem("description", MSG.common_title_description());
        description.setValue(StringUtility.escapeHtml(deployment.getDescription()));

        StaticTextItem status = new StaticTextItem("status", MSG.common_title_status());
        status.setValue(deployment.getStatus().name());
        status.setValueIcons(statusIcons);
        status.setValueIconHeight(11);
        status.setValueIconWidth(11);
        status.setShowValueIconOnly(true);
        if (deployment.getErrorMessage() != null) {
            status.setTooltip(MSG.view_bundle_deploy_clickForError());
            status.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    ErrorMessageWindow win = new ErrorMessageWindow(MSG.common_severity_error(), "<pre>"
                        + deployment.getErrorMessage() + "</pre>");
                    win.show();
View Full Code Here

        List<FormItem> fields = super.buildFieldsForPropertySimple(propertyDefinition, propertyDefinitionSimple,
            propertySimple);

        if (isAggregateProperty(propertySimple)) {
            // Create the "MEMBER VALUES DIFFER" label that is displayed when member values are heterogeneous.
            final StaticTextItem staticItem = new StaticTextItem("static-" + propertySimple.getName());
            staticItem.setValue(MSG.view_groupConfigEdit_valsDiff());
            staticItem.setTextBoxStyle("InlineNote");
            staticItem.setShowTitle(false);
            staticItem.setTooltip(MSG.view_groupConfigEdit_tooltip_1());
            Boolean isHomogeneous = isHomogeneous(propertySimple);
            staticItem.setVisible(!isHomogeneous);

            FormItem valueItem = fields.get(2);
            FormItemIcon icon = buildEditMemberValuesIcon(propertyDefinitionSimple, propertySimple, valueItem);
            staticItem.setIcons(icon);

            valueItem.setAttribute(RHQ_STATIC_ITEM_NAME_ATTRIBUTE, staticItem.getName());
            fields.add(3, staticItem);
        }

        return fields;
    }
View Full Code Here

    @Override
    protected List<FormItem> buildFieldsForPropertyList(PropertyDefinition propertyDefinition, boolean oddRow,
        PropertyDefinitionList propertyDefinitionList, PropertyDefinition memberDefinition, PropertyList propertyList) {
        List<FormItem> fields = new ArrayList<FormItem>();

        StaticTextItem nameItem = buildNameItem(propertyDefinition);
        fields.add(nameItem);

        StaticTextItem staticTextItem = new StaticTextItem();
        staticTextItem.setShowTitle(false);
        staticTextItem.setValue(MSG.view_groupConfigEdit_noListProps());
        staticTextItem.setColSpan(3);
        staticTextItem.setEndRow(true);
        fields.add(staticTextItem);

        return fields;
    }
View Full Code Here

                    String selection = dampeningRuleSelection.getValue().toString();
                    dampeningRuleSelection.setTooltip(getCategoryHelp(selection));
                }
            });

            dampeningRuleStatic = new StaticTextItem("dampeningRuleStatic", MSG.view_alert_common_tab_dampening());
            dampeningRuleStatic.setWrapTitle(false);
            dampeningRuleStatic.setHoverWidth(300);

            // NONE
            // nothing to do - the none category has no ui components to render

            //  CONSECUTIVE_COUNT
            consecutiveOccurrencesSpinner = new SpinnerItem("consecutiveOccurrencesSpinner",
                MSG.view_alert_common_tab_dampening_consecutive_occurrences_label());
            consecutiveOccurrencesSpinner.setWrapTitle(false);
            consecutiveOccurrencesSpinner.setMin(1);
            consecutiveOccurrencesSpinner.setMax(999999);
            consecutiveOccurrencesSpinner.setStep(1);
            consecutiveOccurrencesSpinner.setDefaultValue(1);
            consecutiveOccurrencesSpinner.setHoverWidth(300);
            consecutiveOccurrencesSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_consecutive_occurrences_label_tooltip());
            consecutiveOccurrencesStatic = new StaticTextItem("consecutiveOccurrencesStatic",
                MSG.view_alert_common_tab_dampening_consecutive_occurrences_label());
            consecutiveOccurrencesStatic.setWrapTitle(false);

            consecutiveOccurrencesSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            //  PARTIAL_COUNT
            partialOccurrencesSpinner = new SpinnerItem("partialOccurrencesSpinner",
                MSG.view_alert_common_tab_dampening_partial_occurrences_label());
            partialOccurrencesSpinner.setWrapTitle(false);
            partialOccurrencesSpinner.setMin(1);
            partialOccurrencesSpinner.setMax(999999);
            partialOccurrencesSpinner.setStep(1);
            partialOccurrencesSpinner.setDefaultValue(1);
            partialOccurrencesSpinner.setHoverWidth(300);
            partialOccurrencesSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_partial_occurrences_label_tooltip());
            partialOccurrencesStatic = new StaticTextItem("partialOccurrencesStatic",
                MSG.view_alert_common_tab_dampening_partial_occurrences_label());
            partialOccurrencesStatic.setWrapTitle(false);

            partialOccurrencesSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            partialEvaluationsSpinner = new SpinnerItem("partialEvaluationsSpinner",
                MSG.view_alert_common_tab_dampening_partial_evalatuions_label());
            partialEvaluationsSpinner.setWrapTitle(false);
            partialEvaluationsSpinner.setMin(1);
            partialEvaluationsSpinner.setMax(999999);
            partialEvaluationsSpinner.setStep(1);
            partialEvaluationsSpinner.setDefaultValue(1);
            partialEvaluationsSpinner.setHoverWidth(300);
            partialEvaluationsSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_partial_evalatuions_label_tooltip());
            partialEvaluationsStatic = new StaticTextItem("partialEvaluationStatic",
                MSG.view_alert_common_tab_dampening_partial_evalatuions_label());
            partialEvaluationsStatic.setWrapTitle(false);

            partialEvaluationsSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            //  DURATION_COUNT
            durationOccurrencesSpinner = new SpinnerItem("durationOccurrencesSpinner",
                MSG.view_alert_common_tab_dampening_duration_occurrences_label());
            durationOccurrencesSpinner.setWrapTitle(false);
            durationOccurrencesSpinner.setMin(1);
            durationOccurrencesSpinner.setMax(999999);
            durationOccurrencesSpinner.setStep(1);
            durationOccurrencesSpinner.setDefaultValue(1);
            durationOccurrencesSpinner.setHoverWidth(300);
            durationOccurrencesSpinner.setTooltip(MSG
                .view_alert_common_tab_dampening_duration_occurrences_label_tooltip());
            durationOccurrencesStatic = new StaticTextItem("durationOccurrencesStatic",
                MSG.view_alert_common_tab_dampening_duration_occurrences_label());
            durationOccurrencesStatic.setWrapTitle(false);

            durationOccurrencesSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            durationTimePeriodSpinner = new SpinnerItem("durationTimePeriodSpinner",
                MSG.view_alert_common_tab_dampening_duration_period_label());
            durationTimePeriodSpinner.setWrapTitle(false);
            durationTimePeriodSpinner.setMin(1);
            durationTimePeriodSpinner.setMax(999999);
            durationTimePeriodSpinner.setStep(1);
            durationTimePeriodSpinner.setDefaultValue(1);
            durationTimePeriodSpinner.setHoverWidth(300);
            durationTimePeriodSpinner.setTooltip(MSG.view_alert_common_tab_dampening_duration_period_label_tooltip());
            durationTimePeriodStatic = new StaticTextItem("durationTimePeriodStatic",
                MSG.view_alert_common_tab_dampening_duration_period_label());
            durationTimePeriodStatic.setWrapTitle(false);

            durationTimePeriodSpinner.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
            });

            durationTimeUnitsSelection = new SelectItem("durationTimeUnits", "");
            LinkedHashMap<String, String> units = new LinkedHashMap<String, String>(4);
            units.put(AlertDampening.TimeUnits.MINUTES.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.MINUTES));
            units.put(AlertDampening.TimeUnits.HOURS.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.HOURS));
            units.put(AlertDampening.TimeUnits.DAYS.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.DAYS));
            units.put(AlertDampening.TimeUnits.WEEKS.name(), getTimeUnitsTitle(AlertDampening.TimeUnits.WEEKS));
            durationTimeUnitsSelection.setValueMap(units);
            durationTimeUnitsSelection.setDefaultValue(AlertDampening.TimeUnits.MINUTES.name());
            durationTimeUnitsStatic = new StaticTextItem("durationTimeUnitsStatic", "");

            durationTimeUnitsSelection.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    updated = true;
                }
View Full Code Here

        form.setMargin(10);
        form.setWidth100();
        form.setWrapItemTitles(false);
        form.setNumCols(2);

        StaticTextItem nameItem = new StaticTextItem(FIELD_NAME.propertyName(), FIELD_NAME.title());
        nameItem.setValue("<b>" + agent.getName() + "</b>");

        StaticTextItem addressItem = new StaticTextItem(FIELD_ADDRESS.propertyName(), FIELD_ADDRESS.title());
        addressItem.setValue(agent.getAddress());

        StaticTextItem remoteEndpointItem = new StaticTextItem(FIELD_REMOTE_ENDPOINT.propertyName(),
            FIELD_REMOTE_ENDPOINT.title());
        remoteEndpointItem.setValue(agent.getRemoteEndpoint());

        StaticTextItem portItem = new StaticTextItem(FIELD_PORT.propertyName(), FIELD_PORT.title());
        portItem.setValue(agent.getPort());

        final StaticTextItem tokenItem = new StaticTextItem(FIELD_AGENT_TOKEN.propertyName(), FIELD_AGENT_TOKEN.title());
        tokenItem.setValue(agent.getAgentToken());

        StaticTextItem lastAvailabilityReportItem = new StaticTextItem(FIELD_LAST_AVAILABILITY_REPORT.propertyName(),
            FIELD_LAST_AVAILABILITY_REPORT.title());
        String lastReport = agent.getLastAvailabilityReport() == null ? "unknown" : TimestampCellFormatter.format(
            Long.valueOf(agent.getLastAvailabilityReport()), TimestampCellFormatter.DATE_TIME_FORMAT_LONG);
        lastAvailabilityReportItem.setValue(lastReport);

        StaticTextItem lastAvailabilityPingItem = new StaticTextItem(FIELD_LAST_AVAILABILITY_PING.propertyName(),
            FIELD_LAST_AVAILABILITY_PING.title());
        String lastPing = agent.getLastAvailabilityPing() == null ? "unknown" : TimestampCellFormatter.format(
            Long.valueOf(agent.getLastAvailabilityPing()), TimestampCellFormatter.DATE_TIME_FORMAT_LONG);
        lastAvailabilityPingItem.setValue(lastPing);

        // make clickable link for affinity group
        StaticTextItem affinityGroupItem = new StaticTextItem(FIELD_AFFINITY_GROUP.propertyName(),
            FIELD_AFFINITY_GROUP.title());
        String affinityGroupItemText = "";
        AffinityGroup ag = agent.getAffinityGroup();
        if (ag != null && ag.getName() != null && !ag.getName().isEmpty()) {
            String detailsUrl = "#" + AffinityGroupTableView.VIEW_PATH + "/" + ag.getId();
            String formattedValue = StringUtility.escapeHtml(ag.getName());
            affinityGroupItemText = LinkManager.getHref(detailsUrl, formattedValue);
        }
        affinityGroupItem.setValue(affinityGroupItemText);

        StaticTextItem currentServerItem = new StaticTextItem(FIELD_SERVER.propertyName(), FIELD_SERVER.title());
        String serverValue = null;
        if (agent.getServer() == null) {
            serverValue = "";
        } else {
            String detailsUrl = "#" + ServerTableView.VIEW_PATH + "/" + agent.getServer().getId();
            String formattedValue = StringUtility.escapeHtml(agent.getServer().getName());
            serverValue = LinkManager.getHref(detailsUrl, formattedValue);
        }
        currentServerItem.setValue(serverValue);

        form.setItems(nameItem, addressItem, remoteEndpointItem, portItem, tokenItem, lastAvailabilityReportItem,
            lastAvailabilityPingItem, affinityGroupItem, currentServerItem);

        SectionStackSection section = new SectionStackSection(MSG.common_title_details());
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.fields.StaticTextItem

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.