Examples of DynamicForm


Examples of com.smartgwt.client.widgets.form.DynamicForm

    }

    public Canvas getCanvas() {
        if (form == null) {

            form = new DynamicForm();
            form.setNumCols(1);
            List<FormItem> formItems = new ArrayList<FormItem>(2);

            StaticTextItem descriptionItem = new StaticTextItem("Description", MSG.common_title_description());
            descriptionItem.setTitleOrientation(TitleOrientation.TOP);
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

    public Canvas getCanvas() {
        if (null == canvas) {
            canvas = new EnhancedVLayout();
            canvas.setWidth100();

            radioForm = new DynamicForm();
            radioForm.setNumCols(1);
            // These settings (as opposed to setWidth100()) allow for contextual help to be better placed
            radioForm.setAutoWidth();
            radioForm.setOverflow(Overflow.VISIBLE);

            List<FormItem> formItems = new ArrayList<FormItem>();

            // Make the radio item title a separate item in the form in order to add contextual help
            // to the right of the title text.  We could also add it to the radio item but then it floats to
            // the right of the last radio button option (I'll leave that commented below if for some reason
            // we want to switch to that approach.
            StaticTextItem radioTitleItem = new StaticTextItem("RadioTitle");
            radioTitleItem.setShowTitle(false);
            radioTitleItem.setTitleOrientation(TitleOrientation.TOP);
            radioTitleItem.setAlign(Alignment.LEFT);
            // The css style "formTitle" is what should work here, but for some reason I wasn't getting the
            // proper color. So instead I grabbed the color from the smartgwt css and declared it explicitly.
            //radioTitleItem.setCellStyle("formTitle");
            radioTitleItem.setValue("<span style=\"font-weight: bold; color: #003168\">"
                + MSG.view_drift_wizard_pinTemplate_infoStepRadioTitle() + " :</span>");
            FormUtility.addContextualHelp(radioTitleItem, MSG.view_drift_wizard_pinTemplate_infoStepRadioHelp());
            formItems.add(radioTitleItem);

            LinkedHashMap<String, String> radioGroupValues = new LinkedHashMap<String, String>();
            radioGroupValues.put(CREATE_TEMPLATE, MSG.view_drift_wizard_pinTemplate_infoStepNewTemplate());
            radioGroupValues.put(SELECT_TEMPLATE, MSG.view_drift_wizard_pinTemplate_infoStepExistingTemplate());

            RadioGroupItem radioGroupItem;
            radioGroupItem = new RadioGroupItem("RadioOptions");
            // The title is mocked as a separate item above
            radioGroupItem.setShowTitle(false);
            //uncomment if we decide to show the title for some reason
            //radioGroupItem.setTitleOrientation(TitleOrientation.TOP);
            radioGroupItem.setWrap(false);
            radioGroupItem.setRequired(true);
            radioGroupItem.setAlign(Alignment.LEFT);
            radioGroupItem.setValueMap(radioGroupValues);
            radioGroupItem.setValue(CREATE_TEMPLATE);
            wizard.setCreateTemplate(true);

            radioGroupItem.addChangedHandler(new ChangedHandler() {
                public void onChanged(ChangedEvent event) {
                    if (SELECT_TEMPLATE.equals(event.getValue()) && null == selectTemplateItem.getValue()) {
                        SC.say(MSG.view_drift_wizard_pinTemplate_infoStepSelectBlocked());
                        event.getItem().setValue(CREATE_TEMPLATE);
                        return;
                    }

                    wizard.setCreateTemplate(CREATE_TEMPLATE.equals(event.getValue()));

                    if (wizard.isCreateTemplate()) {
                        selectTemplateForm.hide();
                        wizard.getView().getNextButton().setTitle(MSG.common_button_next());

                    } else {
                        selectTemplateForm.show();
                        wizard.getView().getNextButton().setTitle(MSG.common_button_finish());
                    }
                    radioForm.markForRedraw();
                }
            });
            formItems.add(radioGroupItem);

            formItems.add(new SpacerItem());

            radioForm.setItems(formItems.toArray(new FormItem[formItems.size()]));
            canvas.addMember(radioForm);

            selectTemplateForm = new DynamicForm();
            selectTemplateForm.setNumCols(1);
            selectTemplateForm.setIsGroup(true);
            selectTemplateForm.setGroupTitle(MSG.view_drift_wizard_pinTemplate_infoStepSelectTitle());
            selectTemplateForm.setPadding(10);
            selectTemplateForm.hide();
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

        setAutoSize(true);
    }

    private static Canvas buildAboutCanvas(ProductInfo productInfo) {

        DynamicForm form = new DynamicForm();
        form.setPadding(10);

        StaticTextItem logoItem = new StaticTextItem("logo");
        logoItem.setValue("<img src=\"" + ImageManager.getFullImagePath("header/rhq_logo_28px.png") + "\"/>");
        logoItem.setHeight(28);
        logoItem.setShowTitle(false);
        logoItem.setColSpan(2);
        logoItem.setWrap(false);
        logoItem.setWrapTitle(false);
        logoItem.setAlign(Alignment.CENTER);

        LinkItem productUrl = new LinkItem("url");
        productUrl.setValue(productInfo.getUrl());
        productUrl.setLinkTitle(MSG.common_label_link());
        productUrl.setTitle(productInfo.getFullName());
        productUrl.setTarget("_blank");
        productUrl.setWrap(false);
        productUrl.setWrapTitle(false);

        //Conditionally check for and apply update/patch version details
        String updatePortion = CoreGUI.getUpdateVersion();
        if (updatePortion == null) {
            updatePortion = "";
        }

        StaticTextItem version = new StaticTextItem("version", MSG.view_aboutBox_version());
        version.setValue(productInfo.getVersion() + (updatePortion.trim().length() == 0 ? "" : " " + updatePortion));
        version.setWrap(false);
        version.setWrapTitle(false);

        StaticTextItem buildNumber = new StaticTextItem("buildnumber", MSG.view_aboutBox_buildNumber());
        buildNumber.setValue(productInfo.getBuildNumber()
            + (CoreGUI.isRHQ() ? " (<a target='_blank' href='https://github.com/rhq-project/rhq/commit/"
                + productInfo.getBuildNumber() + "'>GitHub</a>)" : ""));
        buildNumber.setWrap(false);
        buildNumber.setWrapTitle(false);

        StaticTextItem gwtVersion = new StaticTextItem("gwtversion", "GWT " + MSG.common_title_version());
        gwtVersion.setValue(MSG.common_buildInfo_gwtVersion());
        gwtVersion.setWrap(false);
        gwtVersion.setWrapTitle(false);

        StaticTextItem smartGwtVersion = new StaticTextItem("smartgwtversion", "SmartGWT " + MSG.common_title_version());
        smartGwtVersion.setValue(Version.getVersion());
        smartGwtVersion.setWrap(false);
        smartGwtVersion.setWrapTitle(false);

        StaticTextItem allRightsReserved = new StaticTextItem();
        allRightsReserved.setValue(MSG.view_aboutBox_allRightsReserved());
        allRightsReserved.setShowTitle(false);
        allRightsReserved.setColSpan(2);
        allRightsReserved.setWrap(false);
        allRightsReserved.setWrapTitle(false);
        allRightsReserved.setAlign(Alignment.CENTER);

        form.setItems(logoItem, productUrl, version, buildNumber, gwtVersion, smartGwtVersion, allRightsReserved);
        return form;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

    @Override
    protected void onDraw() {
        super.onDraw();

        this.form = new DynamicForm();
        this.form.setNumCols(3);

        final IntegerItem intervalItem = new IntegerItem();
        intervalItem.setWrapTitle(false);
        intervalItem.setWidth(75);
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

            child.destroy();
        }

        addMember(createChangeSetForm(driftDetails.getDrift()));

        DynamicForm driftForm = new DynamicForm();
        driftForm.setIsGroup(true);
        driftForm.setGroupTitle(MSG.view_tabs_common_drift());
        driftForm.setWrapItemTitles(false);
        driftForm.setNumCols(4);

        SpacerItem spacer = new SpacerItem();

        StaticTextItem id = new StaticTextItem("id", MSG.common_title_id());
        id.setValue(driftDetails.getDrift().getId());

        StaticTextItem path = new StaticTextItem("path", MSG.common_title_path());
        path.setValue(driftDetails.getDrift().getPath());

        StaticTextItem timestamp = new StaticTextItem("timestamp", MSG.common_title_timestamp());
        timestamp.setValue(TimestampCellFormatter.format(driftDetails.getDrift().getCtime(), DATE_TIME_FORMAT_FULL));

        StaticTextItem category = new StaticTextItem("category", MSG.common_title_category());

        LinkedHashMap<String, String> catIconsMap = new LinkedHashMap<String, String>(3);
        catIconsMap.put(DriftDataSource.CATEGORY_ICON_ADD, DriftDataSource.CATEGORY_ICON_ADD);
        catIconsMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, DriftDataSource.CATEGORY_ICON_CHANGE);
        catIconsMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, DriftDataSource.CATEGORY_ICON_REMOVE);
        LinkedHashMap<String, String> catValueMap = new LinkedHashMap<String, String>(3);
        catValueMap.put(DriftDataSource.CATEGORY_ICON_ADD, MSG.view_drift_category_fileAdded());
        catValueMap.put(DriftDataSource.CATEGORY_ICON_CHANGE, MSG.view_drift_category_fileChanged());
        catValueMap.put(DriftDataSource.CATEGORY_ICON_REMOVE, MSG.view_drift_category_fileRemoved());
        category.setValueMap(catValueMap);
        category.setValueIcons(catIconsMap);
        category.setShowIcons(true);

        StaticTextItem oldFile = new StaticTextItem("oldFile", MSG.view_drift_table_oldFile());
        FormItem oldFileLink = null;

        StaticTextItem newFile = new StaticTextItem("newFile", MSG.view_drift_table_newFile());
        FormItem newFileLink = null;

        if (driftDetails.isBinaryFile()) {
            switch (driftDetails.getDrift().getCategory()) {
            case FILE_ADDED:
                category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
                oldFile.setValue(MSG.common_label_none());
                oldFileLink = spacer;
                newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
                newFileLink = spacer;
                break;
            case FILE_CHANGED:
                category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
                oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
                oldFileLink = spacer;
                newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
                newFileLink = spacer;
                break;
            case FILE_REMOVED:
                category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
                oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
                oldFileLink = spacer;
                newFile.setValue(MSG.common_label_none());
                newFileLink = spacer;
                break;
            }
            driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
                newFile, newFileLink);
        } else {
            FormItem viewDiffLink = spacer;
            switch (driftDetails.getDrift().getCategory()) {
            case FILE_ADDED:
                category.setValue(DriftDataSource.CATEGORY_ICON_ADD);
                oldFile.setValue(MSG.common_label_none());
                oldFileLink = spacer;
                newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
                newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(), driftDetails
                    .getDrift().getPath(), driftDetails.getChangeSet().getVersion(), driftDetails.getNewFileStatus());
                break;
            case FILE_CHANGED:
                category.setValue(DriftDataSource.CATEGORY_ICON_CHANGE);
                oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
                oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(), driftDetails
                    .getDrift().getPath(), driftDetails.getPreviousChangeSet().getVersion(),
                    driftDetails.getOldFileStatus());
                newFile.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
                newFileLink = createViewFileLink(driftDetails.getDrift().getNewDriftFile().getHashId(), driftDetails
                    .getDrift().getPath(), driftDetails.getChangeSet().getVersion(), driftDetails.getNewFileStatus());
                if (driftDetails.getNewFileStatus() == LOADED && driftDetails.getOldFileStatus() == LOADED) {
                    viewDiffLink = createViewDiffLink(driftDetails.getDrift(), driftDetails.getPreviousChangeSet()
                        .getVersion());
                }
                break;
            case FILE_REMOVED:
                category.setValue(DriftDataSource.CATEGORY_ICON_REMOVE);
                oldFile.setValue(driftDetails.getDrift().getOldDriftFile().getHashId());
                oldFileLink = createViewFileLink(driftDetails.getDrift().getOldDriftFile().getHashId(), driftDetails
                    .getDrift().getPath(), driftDetails.getChangeSet().getVersion(), driftDetails.getOldFileStatus());
                newFile.setValue(MSG.common_label_none());
                newFileLink = spacer;
                break;
            }
            driftForm.setItems(id, spacer, path, spacer, category, spacer, timestamp, spacer, oldFile, oldFileLink,
                newFile, newFileLink, spacer, spacer, spacer, viewDiffLink);
        }
        addMember(driftForm);
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

        }
        addMember(driftForm);
    }

    private DynamicForm createChangeSetForm(Drift<?, ?> drift) {
        DynamicForm changeSetForm = new DynamicForm();
        changeSetForm.setIsGroup(true);
        changeSetForm.setGroupTitle(MSG.view_drift_table_snapshot());
        changeSetForm.setWrapItemTitles(false);

        DriftChangeSet<?> changeSet = drift.getChangeSet();
        StaticTextItem changeSetId = new StaticTextItem("changeSetId", MSG.common_title_id());
        changeSetId.setValue(changeSet.getId());
        StaticTextItem changeSetCategory = new StaticTextItem("changeSetCategory", MSG.common_title_category());
        changeSetCategory.setValue(changeSet.getCategory().name());
        StaticTextItem changeSetVersion = new StaticTextItem("changeSetVersion", MSG.common_title_version());
        changeSetVersion.setValue(changeSet.getVersion());
        StaticTextItem changeSetDriftHandling = new StaticTextItem("changeSetDriftHandling",
            MSG.view_drift_table_driftHandlingMode());
        changeSetDriftHandling.setValue(DriftDefinitionDataSource.getDriftHandlingModeDisplayName(changeSet
            .getDriftHandlingMode()));

        changeSetForm.setItems(changeSetId, changeSetCategory, changeSetVersion, changeSetDriftHandling);

        return changeSetForm;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

        return link;
    }

    private Window createFileViewer(String contents, String path, int version) {
        VLayout layout = new VLayout();
        DynamicForm form = new DynamicForm();
        form.setWidth100();
        form.setHeight100();

        TextAreaItem textArea = new TextAreaItem();
        textArea.setShowTitle(false);
        textArea.setColSpan(2);
        textArea.setValue(contents);
        textArea.setWidth("*");
        textArea.setHeight("*");

        form.setItems(textArea);
        layout.addMember(form);

        PopupWindow window = new PopupWindow(layout);
        window.setIsModal(false);
        window.setTitle(path + ":" + version);
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

        return tabset;
    }

    private DynamicForm getDetailsTableForAlert(ListGridRecord record) {
        DynamicForm form = new DynamicForm();
        form.setNumCols(4);
        form.setHeight("15%");
        form.setWrapItemTitles(false);
        form.setAlign(Alignment.LEFT);

        List<FormItem> items = new ArrayList<FormItem>();

        StaticTextItem nameTextItem = new StaticTextItem("name", MSG.common_title_name());
        nameTextItem.setValue(record.getAttribute("name"));
        nameTextItem.setTooltip("Id = " + record.getAttribute("id"));
        items.add(nameTextItem);

        StaticTextItem descriptionTextItem = new StaticTextItem("description", MSG.common_title_description());
        descriptionTextItem.setValue(record.getAttribute("description"));
        items.add(descriptionTextItem);

        StaticTextItem prioTextItem = new StaticTextItem("priority", MSG.view_alerts_field_priority());
        prioTextItem.setValue(record.getAttribute("priority"));
        LinkedHashMap<String, String> priorityIcons = new LinkedHashMap<String, String>(3);
        priorityIcons.put(AlertDataSource.PRIORITY_ICON_HIGH, AlertDataSource.PRIORITY_ICON_HIGH);
        priorityIcons.put(AlertDataSource.PRIORITY_ICON_MEDIUM, AlertDataSource.PRIORITY_ICON_MEDIUM);
        priorityIcons.put(AlertDataSource.PRIORITY_ICON_LOW, AlertDataSource.PRIORITY_ICON_LOW);
        prioTextItem.setValueIcons(priorityIcons);
        // shouldn't have to do this, but the data source stores the actual URL of the icon in it, we need to map back to value
        LinkedHashMap<String, String> priorityMap = new LinkedHashMap<String, String>(3);
        priorityMap.put(AlertDataSource.PRIORITY_ICON_HIGH, MSG.common_alert_high());
        priorityMap.put(AlertDataSource.PRIORITY_ICON_MEDIUM, MSG.common_alert_medium());
        priorityMap.put(AlertDataSource.PRIORITY_ICON_LOW, MSG.common_alert_low());
        prioTextItem.setValueMap(priorityMap);
        items.add(prioTextItem);

        StaticTextItem createdTextItem = new StaticTextItem("ctime", MSG.common_title_createTime());
        createdTextItem.setValue(TimestampCellFormatter.format(record.getAttributeAsDate("ctime")));
        items.add(createdTextItem);

        StaticTextItem ackByItem = new StaticTextItem("acknowledgingSubject", MSG.view_alert_details_field_ack_by());
        if (record.getAttribute("acknowledgingSubject") != null) {
            ackByItem.setValue(record.getAttribute("acknowledgingSubject"));
        } else {
            ackByItem.setValue(MSG.view_alerts_field_ack_status_noAck());
        }
        items.add(ackByItem);

        StaticTextItem ackTimeItem = new StaticTextItem("acknowledgeTime", MSG.view_alert_details_field_ack_at());
        Date ack_time = record.getAttributeAsDate("acknowledgeTime");
        if (ack_time != null) {
            ackTimeItem.setValue(TimestampCellFormatter.format(ack_time));
        } else {
            ackTimeItem.setValue(MSG.view_alerts_field_ack_status_noAck());
        }
        items.add(ackTimeItem);

        StaticTextItem recoveryItem = new StaticTextItem("recovery", MSG.view_alert_details_field_recovery_info());
        recoveryItem.setValue(record.getAttribute("recoveryInfo"));
        items.add(recoveryItem);

        StaticTextItem resourceItem = new StaticTextItem("resourceName",
            MSG.view_alert_details_field_watched_resource());
        String resourceUrl = LinkManager.getResourceLink(Integer.parseInt(record.getAttribute("resourceId")));
        resourceItem.setValue(LinkManager.getHref(resourceUrl, record.getAttribute("resourceName")));
        items.add(resourceItem);

        StaticTextItem resourceAncestryItem = new StaticTextItem("resourceAncestry",
            MSG.view_alert_details_field_resource_ancestry());
        resourceAncestryItem.setValue(record.getAttribute("resourceAncestry"));
        items.add(resourceAncestryItem);

        String parentUrl = record.getAttribute("parent");
        if (parentUrl != null) {
            StaticTextItem parentItem = new StaticTextItem("parent", "Parent Definition");
            parentItem.setValue(LinkManager.getHref(parentUrl, record.getLinkText()));
            items.add(parentItem);
        }

        form.setItems(items.toArray(new FormItem[items.size()]));

        return form;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

    static void showDetails(Message message) {
        if (message == null) {
            return;
        }

        DynamicForm form = new DynamicForm();
        form.setWrapItemTitles(false);
        form.setAlign(Alignment.LEFT);

        StaticTextItem title = new StaticTextItem("theMessage", MSG.common_title_message());
        title.setValue(message.conciseMessage);

        StaticTextItem severity = new StaticTextItem("severity", MSG.view_messageCenter_messageSeverity());
        FormItemIcon severityIcon = new FormItemIcon();
        severityIcon.setSrc(getSeverityIcon(message.severity));
        severity.setIcons(severityIcon);
        severity.setValue(message.severity.name());

        StaticTextItem date = new StaticTextItem("time", MSG.view_messageCenter_messageTime());
        date.setValue(TimestampCellFormatter.format(message.fired, TimestampCellFormatter.DATE_TIME_FORMAT_FULL));

        StaticTextItem rootCause = new StaticTextItem("rootCause", MSG.view_messageCenter_messageRootCause());
        rootCause.setValue(message.rootCauseMessage);
        rootCause.setVisible(message.rootCauseMessage != null);

        StaticTextItem detail = new StaticTextItem("detail", MSG.view_messageCenter_messageDetail());
        detail.setTitleVAlign(VerticalAlignment.TOP);
        detail.setValue(message.detailedMessage);

        form.setItems(title, severity, date, rootCause, detail);

        final Window dialogWin = new Window();
        dialogWin.setTitle(MSG.common_title_message());
        dialogWin.setWidth(600);
        dialogWin.setHeight(400);
View Full Code Here

Examples of com.smartgwt.client.widgets.form.DynamicForm

    }

    private void buildForm() {
        if (!formBuilt) {

            DynamicForm conditionExpressionForm;
            conditionExpressionForm = new DynamicForm();
            conditionExpression = new SelectItem("conditionExpression",
                MSG.view_alert_common_tab_conditions_expression());
            LinkedHashMap<String, String> condExprs = new LinkedHashMap<String, String>(2);
            condExprs.put(BooleanExpression.ANY.name(), BooleanExpression.ANY.toString());
            condExprs.put(BooleanExpression.ALL.name(), BooleanExpression.ALL.toString());
            conditionExpression.setValueMap(condExprs);
            conditionExpression.setDefaultValue(BooleanExpression.ANY.name());
            conditionExpression.setWrapTitle(false);
            conditionExpression.setHoverWidth(300);
            conditionExpression.setTooltip(MSG.view_alert_common_tab_conditions_expression_tooltip());

            conditionExpressionStatic = new StaticTextItem("conditionExpressionStatic",
                MSG.view_alert_common_tab_conditions_expression());
            conditionExpressionStatic.setWrapTitle(false);

            conditionExpressionForm.setFields(conditionExpression, conditionExpressionStatic);

            conditionsEditor = new ConditionsEditor(conditionExpression, resourceType, null);

            conditionExpression.addChangeHandler(new ChangeHandler() {
                @Override
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.