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

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


        ProductInfo productInfo = CoreGUI.get().getProductInfo();
        timeoutItem.setContextualHelp(MSG.view_operationScheduleDetails_fieldHelp_timeout(productInfo.getShortName()));
        notesFields.add(timeoutItem);

        if (!isNewRecord()) {
            StaticTextItem nextFireTimeItem = new StaticTextItem(Field.NEXT_FIRE_TIME,
                MSG.dataSource_operationSchedule_field_nextFireTime());
            notesFields.add(nextFireTimeItem);
        }

        TextAreaItem notesItem = new TextAreaItem(Field.DESCRIPTION,
View Full Code Here


        DurationItem timeoutItem = (DurationItem) this.notesForm.getField(Field.TIMEOUT);
        Object value = getForm().getValue(Field.TIMEOUT);
        Integer integerValue = TypeConversionUtility.toInteger(value);
        timeoutItem.setValue(integerValue, UnitType.TIME);

        StaticTextItem notesItem = (StaticTextItem) this.notesForm.getField(Field.DESCRIPTION);
        // Notes field is user-editable, so escape HTML to prevent an XSS attack. Unless empty, then don't to prevent
        // displaying   as the value.
        String notesValue = getForm().getValueAsString(Field.DESCRIPTION);
        if (null != notesValue && !notesValue.isEmpty()) {
            notesItem.setEscapeHTML(true);
        }
        notesItem.setValue(notesValue);

        this.operationParameters = (Configuration) record.getAttributeAsObject(Field.PARAMETERS);
        super.editExistingRecord(record);
    }
View Full Code Here

        form.setWidth100();
        form.setExtraSpace(15);
        form.setIsGroup(true);
        form.setGroupTitle(MSG.view_admin_systemSettings_serverDetails());

        final StaticTextItem productName = new StaticTextItem("productname",
            MSG.view_admin_systemSettings_serverDetails_productName());
        final StaticTextItem productVersion = new StaticTextItem("productversion", MSG.common_title_version());
        final StaticTextItem productBuildNumber = new StaticTextItem("productbuild",
            MSG.view_admin_systemSettings_serverDetails_buildNumber());

        final StaticTextItem serverName = new StaticTextItem("servername",
            MSG.view_admin_systemSettings_serverDetails_serverName());
        final StaticTextItem serverTimezone = new StaticTextItem("timezone",
            MSG.view_admin_systemSettings_serverDetails_tz());
        final StaticTextItem serverTime = new StaticTextItem("localtime",
            MSG.view_admin_systemSettings_serverDetails_time());
        final StaticTextItem serverInstallDir = new StaticTextItem("installdir",
            MSG.view_admin_systemSettings_serverDetails_installDir());
        final StaticTextItem dbUrl = new StaticTextItem("dbUrl", MSG.view_admin_systemSettings_serverDetails_dbUrl());
        final StaticTextItem dbProductName = new StaticTextItem("dbProductName",
            MSG.view_admin_systemSettings_serverDetails_dbName());
        final StaticTextItem dbProductVersion = new StaticTextItem("dbProductVersion",
            MSG.view_admin_systemSettings_serverDetails_dbVersion());
        final StaticTextItem dbDriverName = new StaticTextItem("dbDriverName",
            MSG.view_admin_systemSettings_serverDetails_dbDriverName());
        final StaticTextItem dbDriverVersion = new StaticTextItem("dbDriverVersion",
            MSG.view_admin_systemSettings_serverDetails_dbDriverVersion());

        productName.setWrapTitle(false);
        productVersion.setWrapTitle(false);
        productBuildNumber.setWrapTitle(false);
        serverName.setWrapTitle(false);
        serverTimezone.setWrapTitle(false);
        serverTime.setWrapTitle(false);
        serverInstallDir.setWrapTitle(false);
        dbUrl.setWrapTitle(false);
        dbProductName.setWrapTitle(false);
        dbProductVersion.setWrapTitle(false);
        dbDriverName.setWrapTitle(false);
        dbDriverVersion.setWrapTitle(false);

        form.setItems(productName, productVersion, productBuildNumber, serverName, serverTimezone, serverTime,
            serverInstallDir, dbUrl, dbProductName, dbProductVersion, dbDriverName, dbDriverVersion);

        GWTServiceLookup.getSystemService().getServerDetails(new AsyncCallback<ServerDetails>() {

            @Override
            public void onSuccess(ServerDetails result) {
                ProductInfo productInfo = result.getProductInfo();
                form.setValue(productName.getName(), productInfo.getName());
                form.setValue(productVersion.getName(), productInfo.getVersion());
                form.setValue(productBuildNumber.getName(), productInfo.getBuildNumber()
                    + (CoreGUI.isRHQ() ? " (<a target='_blank' href='https://github.com/rhq-project/rhq/commit/"
                        + productInfo.getBuildNumber() + "'>GitHub</a>)" : ""));
                Map<Detail, String> details = result.getDetails();
                form.setValue(serverName.getName(), details.get(ServerDetails.Detail.SERVER_IDENTITY));
                form.setValue(serverTimezone.getName(), details.get(ServerDetails.Detail.SERVER_TIMEZONE));
                form.setValue(serverTime.getName(), details.get(ServerDetails.Detail.SERVER_LOCAL_TIME));
                form.setValue(serverInstallDir.getName(), details.get(ServerDetails.Detail.SERVER_INSTALL_DIR));
                form.setValue(dbUrl.getName(), details.get(ServerDetails.Detail.DATABASE_CONNECTION_URL));
                form.setValue(dbProductName.getName(), details.get(ServerDetails.Detail.DATABASE_PRODUCT_NAME));
                form.setValue(dbProductVersion.getName(), details.get(ServerDetails.Detail.DATABASE_PRODUCT_VERSION));
                form.setValue(dbDriverName.getName(), details.get(ServerDetails.Detail.DATABASE_DRIVER_NAME));
                form.setValue(dbDriverVersion.getName(), details.get(ServerDetails.Detail.DATABASE_DRIVER_VERSION));
            }

            @Override
            public void onFailure(Throwable caught) {
                CoreGUI.getErrorHandler().handleError(MSG.view_admin_systemSettings_cannotLoadServerDetails(), caught);
View Full Code Here

    @Override
    protected List<FormItem> createFields(ResourceOperationHistory operationHistory) {
        List<FormItem> items = super.createFields(operationHistory);

        if (this.showResourceField) {
            StaticTextItem resourceItem = new StaticTextItem(ResourceOperationHistoryDataSource.Field.RESOURCE,
                "Resource");
            resourceItem.setValue(this.disambiguatedResourceName);
            items.add(1, resourceItem);
        }

        GroupOperationHistory groupOperationHistory = operationHistory.getGroupOperationHistory();
        if (groupOperationHistory != null) {
            StaticTextItem groupOperationHistoryItem = new StaticTextItem(
                ResourceOperationHistoryDataSource.Field.GROUP_OPERATION_HISTORY, "Parent Group Execution");
            String groupOperationHistoryUrl = LinkManager.getGroupOperationHistoryLink(
                groupOperationHistory.getGroup(), groupOperationHistory.getId());
            String value = "<a href=\"" + groupOperationHistoryUrl + "\">" + groupOperationHistory.getId()
                + "</a> (on group '" + groupOperationHistory.getGroup().getName() + "')";
            groupOperationHistoryItem.setValue(value);
            items.add(groupOperationHistoryItem);
        }

        return items;
    }
View Full Code Here

        fields.add(createHeaderTextItem(MSG.common_title_description()));
        return fields;
    }

    private StaticTextItem createHeaderTextItem(String value) {
        StaticTextItem unsetHeader = new StaticTextItem();
        unsetHeader.setValue(value);
        unsetHeader.setShowTitle(false);
        unsetHeader.setCellStyle("configurationEditorHeaderCell");
        return unsetHeader;
    }
View Full Code Here

        }

        // GWT doesn't support reflection by default, therefore this "hack"
        public List<FormItem> build(FormItem valueItem) {
            List<FormItem> fields = new ArrayList<FormItem>();
            StaticTextItem nameItem = new StaticTextItem();
            nameItem.setStartRow(true);
            nameItem.setValue("<b>" + title + "</b>");
            nameItem.setShowTitle(false);
            nameItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
            fields.add(nameItem);

            valueItem.setName(name);
            valueItem.setValue(value);
            valueItem.setWidth(220);
            if (validators != null && validators.length > 0) {
                valueItem.setValidators(validators);
            }
            valueItem.setValidateOnChange(true);
            valueItem.setAlign(Alignment.CENTER);
            valueItem.setShowTitle(false);
            valueItem.setRequired(required);
            valueItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
            valueItem.setDisabled(readOnly);
            fields.add(valueItem);

            StaticTextItem descriptionItem = new StaticTextItem();
            descriptionItem.setValue(description);
            descriptionItem.setShowTitle(false);
            descriptionItem.setEndRow(true);
            descriptionItem.setCellStyle(oddRow ? "OddRow" : "EvenRow");
            fields.add(descriptionItem);

            oddRow = !oddRow;
            for (Map.Entry<String, Object> e : attributes.entrySet()) {
                valueItem.setAttribute(e.getKey(), e.getValue());
View Full Code Here

                    }
                }
            });
        }

        final StaticTextItem numColItem = new StaticTextItem();
        numColItem.setTitle(MSG.common_title_columns());
        numColItem.setValue(storedDashboard.getColumns());
        numColItem.setWrapTitle(false);

        ButtonItem addColumn = new ButtonItem("addColumn", MSG.common_title_add_column());
        addColumn.setAutoFit(true);
        addColumn.setStartRow(false);
        addColumn.setEndRow(false);

        final ButtonItem removeColumn = new ButtonItem("removeColumn", MSG.common_title_remove_column());
        removeColumn.setAutoFit(true);
        removeColumn.setStartRow(false);
        removeColumn.setEndRow(false);
        removeColumn.setDisabled(storedDashboard.getColumns() == 1);

        addColumn.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
                portalLayout.addMember(new PortalColumn());
                numColItem.setValue(storedDashboard.getColumns() + 1);
                storedDashboard.setColumns(storedDashboard.getColumns() + 1);
                removeColumn.setDisabled(storedDashboard.getColumns() == 1);
                save();
            }
        });

        removeColumn.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
            public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {

                Canvas[] columns = portalLayout.getMembers();
                int numColumns = columns.length;
                if (numColumns > 0) {
                    PortalColumn lastColumn = (PortalColumn) columns[numColumns - 1];
                    for (Canvas portletWindow : lastColumn.getMembers()) {
                        storedDashboard.removePortlet(((PortletWindow) portletWindow).getStoredPortlet());
                    }
                    portalLayout.removeMember(lastColumn);
                    numColItem.setValue(numColumns - 1);
                    storedDashboard.setColumns(storedDashboard.getColumns() - 1);
                    removeColumn.setDisabled(storedDashboard.getColumns() == 1);
                    save();
                }
            }
View Full Code Here

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

        StaticTextItem ctimeItem = new StaticTextItem(FIELD_CTIME.propertyName(),
            MSG.view_adminTopology_partitionEventsDetail_eventExecutionTime());
        ctimeItem.setValue(TimestampCellFormatter.format(Long.valueOf(partitionEvent.getCtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_LONG));

        StaticTextItem addressItem = new StaticTextItem(FIELD_EVENT_TYPE.propertyName(),
            MSG.view_adminTopology_partitionEventsDetail_eventType());
        addressItem.setValue(partitionEvent.getEventType());

        StaticTextItem eventDetailItem = new StaticTextItem(FIELD_EVENT_DETAIL.propertyName(),
            MSG.view_adminTopology_partitionEventsDetail_eventDetails());
        eventDetailItem.setValue(partitionEvent.getEventDetail());

        StaticTextItem subjectPortItem = new StaticTextItem(FIELD_SUBJECT_NAME.propertyName(),
            FIELD_SUBJECT_NAME.title());
        subjectPortItem.setValue(partitionEvent.getSubjectName());

        StaticTextItem execStatusItem = new StaticTextItem(FIELD_EXECUTION_STATUS.propertyName(),
            FIELD_EXECUTION_STATUS.title());
        execStatusItem.setValue(partitionEvent.getExecutionStatus());

        form.setItems(ctimeItem, addressItem, eventDetailItem, subjectPortItem, execStatusItem);

        SectionStackSection section = new SectionStackSection(MSG.view_adminTopology_partitionEvents_details());
        section.setExpanded(true);
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(5);
        actionItem.setShowTitle(false);
        actionItem.setCanvas(getActionLayout());

        StaticTextItem created = new StaticTextItem("created", MSG.view_bundle_dest_created());
        created.setValue(new Date(destination.getCtime()));

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

        StaticTextItem baseDirName = new StaticTextItem("baseDir", MSG.view_bundle_dest_baseDirName());
        baseDirName.setValue(destination.getDestinationSpecificationName());

        StaticTextItem path = new StaticTextItem("path", MSG.view_bundle_dest_deployDir());
        path.setValue(destination.getDeployDir());

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

        form.setFields(bundleName, actionItem, created, destinationGroup, baseDirName, path, description);
        return form;
    }
View Full Code Here

        DynamicForm form = new DynamicForm();
        form.setHeight100();
        form.setWidth100();
        form.setPadding(20);

        StaticTextItem status = new StaticTextItem("status", MSG.common_title_status());
        status.setValueIcons(statusIcons);
        status.setValueIconHeight(11);
        status.setValueIconWidth(11);
        status.setShowValueIconOnly(true);

        StaticTextItem user = new StaticTextItem("user", MSG.common_title_user());

        StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
        timestamp.setDateFormatter(DateDisplayFormat.TOLOCALESTRING);

        StaticTextItem action = new StaticTextItem("action", MSG.view_bundle_deploy_action());
        StaticTextItem info = new StaticTextItem("info", MSG.common_severity_info());
        StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());

        StaticTextItem message = new StaticTextItem("message", MSG.common_title_message());
        message.setTitleVAlign(VerticalAlignment.TOP);

        TextAreaItem detail = new TextAreaItem("attachment", MSG.common_title_details());
        detail.setTitleVAlign(VerticalAlignment.TOP);
        detail.setMinHeight(100);
        detail.setHeight("100%");
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.