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

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


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

        StaticTextItem file = new StaticTextItem("File", MSG.view_tabs_common_content());
        FormItem fileLink = null;

        if (driftDetails.isBinaryFile()) {
            file.setValue(driftDetails.getDrift().getNewDriftFile().getHashId());
            fileLink = spacer;
            driftForm.setItems(path, spacer, file, fileLink);
View Full Code Here


    public void enableSpecificEditor(Record record) {
        boolean readOnly = record.getAttributeAsBoolean("readOnly");
        if (editorsMap != null && !readOnly) {
            String attribute = record.getAttribute(valueFieldAttribute);
            if (editorsMap.containsKey(attribute)) {
                FormItem formItem = editorsMap.get(attribute);
        getField(1).setEditorType(formItem);
      }
    }
  }
View Full Code Here

        return form.validate();
    }

    public void setContextualHelp(String contextualHelp) {
        if (contextualHelp != null) {
            FormItem item;
            item = form.getItem(FIELD_UNITS);
            FormUtility.addContextualHelp(item, contextualHelp);
        }
    }
View Full Code Here

    public static Configuration saveMeasurementRangeEditorSettings(
        final CustomConfigMeasurementRangeEditor measurementRangeEditor, Configuration portletConfig) {
        String selectedValue = null;
        if ((measurementRangeEditor != null) && (portletConfig != null)) {
            //time range filter. Check for enabled and then persist property. Dealing with compound widget.
            FormItem item = measurementRangeEditor.getItem(CustomConfigMeasurementRangeEditor.ENABLE_RANGE_ITEM);
            CheckboxItem itemC = (CheckboxItem) item;
            boolean persistTimeRangeSettings = itemC.getValueAsBoolean();
            if (persistTimeRangeSettings) {//retrieve values and persist
                selectedValue = String.valueOf(itemC.getValueAsBoolean());
                if (!selectedValue.trim().isEmpty()) {//then call
View Full Code Here

            super.submitForm();
        }
    }

    protected void changeIcon(FormItemIcon icon, String tooltip) {
        FormItem item = (this.showUploadButton) ? this.uploadButton : this.fileUploadItem;
        item.setIcons(icon);
        item.setIconPrompt(tooltip);
        markForRedraw();
    }
View Full Code Here

        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;
View Full Code Here

            }
        });
    }

    protected FormItem prepareStaticFormItem() {
        FormItem item = instantiateStaticFormItem();
        item.setShowTitle(false);
        item.setShowIfCondition(new FormItemIfFunction() {
            public boolean execute(FormItem item, Object value, DynamicForm form) {
                return !isEditing();
            }
        });
View Full Code Here

        return item;
    }

    protected FormItem prepareEditFormItem() {
        FormItem item = instantiateEditFormItem();
        item.setShowTitle(false);
        item.setShowIfCondition(new FormItemIfFunction() {
            public boolean execute(FormItem item, Object value, DynamicForm form) {
                return isEditing();
            }
        });
View Full Code Here

    @Override
    public void submitForm() {

        // reset the name value from the package type name to the path of the actual uploaded file. The
        // name portion will be parsed out and used for the package name.
        FormItem nameItem = getItem("name");
        FormItem fileUploadItem = getItem("fileUploadItem");
        String uploadFilePath = (String) fileUploadItem.getValue();
        nameItem.setValue(uploadFilePath);

        super.submitForm();
    }
View Full Code Here

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

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

        FormItem valueItem;
        valueItem = buildSimpleField(propertyDefinitionSimple, propertySimple);

        FormItem unsetItem = buildUnsetItem(propertyDefinitionSimple, propertySimple, valueItem);
        fields.add(unsetItem);

        fields.add(valueItem);

        StaticTextItem descriptionItem = buildDescriptionField(propertyDefinition);
View Full Code Here

TOP

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

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.