Java Code Examples for com.smartgwt.client.widgets.form.DynamicForm#setBrowserSpellCheck()

The following examples show how to use com.smartgwt.client.widgets.form.DynamicForm#setBrowserSpellCheck() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeviceManager.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createForm() {
    DynamicForm df = new DynamicForm();
    df.setMargin(4);
    df.setNumCols(1);
    df.setTitleOrientation(TitleOrientation.TOP);
    df.setBrowserSpellCheck(false);
    df.setDataSource(DeviceDataSource.getInstance());
    TextItem fieldId = new TextItem(DeviceDataSource.FIELD_ID);
    fieldId.setWidth(280);
    fieldId.setCanEdit(false);
    fieldId.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
    TextItem fieldModel = new TextItem(DeviceDataSource.FIELD_MODEL);
    fieldModel.setCanEdit(false);
    fieldModel.setRequired(true);
    TextItem fieldLabel = new TextItem(DeviceDataSource.FIELD_LABEL);
    fieldLabel.setRequired(true);
    fieldLabel.setWidth("*");
    df.setItems(fieldId, fieldModel,  fieldLabel);
    return df;
}
 
Example 2
Source File: UrnNbnAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createOptionResolver() {
    DynamicForm form = new DynamicForm();
    SelectItem selection = new SelectItem(UrnNbnResourceApi.FIND_RESOLVER_PARAM,
            i18n.UrnNbnAction_Window_Select_Title());
    selection.setRequired(true);
    selection.setOptionDataSource(UrnNbnResolverDataSource.getInstance());
    selection.setValueField(UrnNbnResourceApi.RESOLVER_ID);
    selection.setDisplayField(UrnNbnResourceApi.RESOLVER_NAME);
    selection.setAutoFetchData(true);
    selection.setDefaultToFirstOption(true);
    selection.setWidth(350);
    selection.setAutoFetchData(true);
    form.setFields(selection);
    form.setBrowserSpellCheck(false);
    form.setWrapItemTitles(false);
    form.setTitleOrientation(TitleOrientation.TOP);
    return form;
}
 
Example 3
Source File: DesaExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createLogForm() {
    DynamicForm form = new DynamicForm();
    form.setBrowserSpellCheck(false);
    form.setCanEdit(false);
    form.setWidth100();
    form.setHeight("40%");
    TextAreaItem textAreaItem = new TextAreaItem(ExportResourceApi.RESULT_ERROR_LOG);
    textAreaItem.setColSpan("*");
    textAreaItem.setHeight("*");
    textAreaItem.setWrap(TextAreaWrap.OFF);
    textAreaItem.setShowTitle(false);
    textAreaItem.setWidth("*");
    textAreaItem.setCanEdit(false);
    form.setItems(textAreaItem);
    return form;
}
 
Example 4
Source File: UploadFile.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createForm() {
    DynamicForm form = new DynamicForm();
    form.setEncoding(Encoding.MULTIPART);
    form.setBrowserSpellCheck(false);
    form.setNumCols(2);
    form.setTitleOrientation(TitleOrientation.TOP);
    form.setCanSubmit(true);

    TextItem mimeItem = new TextItem(FIELD_MIMETYPE,
            i18n.DigitalObjectEditor_MediaEditor_Uploader_Mimetype_Title());
    mimeItem.setWidth(400);
    mimeItem.setColSpan(2);

    TextItem filenameItem = new TextItem(FIELD_FILE,
            i18n.DigitalObjectEditor_MediaEditor_Uploader_Filename_Title());
    filenameItem.setWidth(400);
    filenameItem.setColSpan(2);
    filenameItem.setRequired(Boolean.TRUE);

    HiddenItem pidItem = new HiddenItem(FIELD_PID);
    HiddenItem batchIdItem = new HiddenItem(FIELD_BATCHID);
    form.setFields(filenameItem, mimeItem, pidItem, batchIdItem);
    return form;
}
 
Example 5
Source File: ImportBatchChooser.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createLogForm() {
    DynamicForm form = new DynamicForm();
    form.setBrowserSpellCheck(false);
    form.setCanEdit(false);
    form.setWidth100();
    form.setHeight("40%");
    TextAreaItem textAreaItem = new TextAreaItem(ImportBatchDataSource.FIELD_LOG);
    textAreaItem.setColSpan("*");
    textAreaItem.setHeight("*");
    textAreaItem.setWrap(TextAreaWrap.OFF);
    textAreaItem.setShowTitle(false);
    textAreaItem.setWidth("*");
    textAreaItem.setCanEdit(false);
    form.setItems(textAreaItem);
    return form;
}
 
Example 6
Source File: DigitalObjectAdministrationEditor.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public BatchEditor(ClientMessages i18n) {
    widget = new VLayout();
    form = new DynamicForm();
    form.setBrowserSpellCheck(false);

    TextItem owner = new TextItem(DigitalObjectAdministrationDataSource.FIELD_OWNER);
    owner.setCanEdit(Boolean.FALSE);

    SelectItem device = new SelectItem(DigitalObjectAdministrationDataSource.FIELD_DEVICE,
            i18n.ImportSourceChooser_OptionScanner_Title());
    DeviceDataSource.setOptionDataSource(device);
    device.setWidth(250);
    device.setAllowEmptyValue(true);
    device.setEmptyDisplayValue(ClientUtils.format("<i>&lt;%s&gt;</i>",
            i18n.DigitalObjectEditor_AdministrationEditor_NoDeviceSelection_Title()));

    form.setItems(device);
    widget.setMembers(form);
}
 
Example 7
Source File: DcEditor.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createFullForm() {
    DynamicForm f = new DynamicForm();
    f.setWidth100();
    f.setNumCols(2);
    f.setBrowserSpellCheck(false);
    f.setWrapItemTitles(false);
    f.setTitleOrientation(TitleOrientation.TOP);
    ArrayList<FormItem> items = new ArrayList<FormItem>();
    addElement(items, DcConstants.CONTRIBUTOR, null, true);
    addElement(items, DcConstants.COVERAGE, null, true);
    addElement(items, DcConstants.CREATOR, null, true);
    addElement(items, DcConstants.DATE, null, true);
    addElement(items, DcConstants.DESCRIPTION, null, true);
    addElement(items, DcConstants.FORMAT, null, true);
    addElement(items, DcConstants.IDENTIFIER, null, true);
    addElement(items, DcConstants.LANGUAGE, null, true);
    addElement(items, DcConstants.PUBLISHER, null, true);
    addElement(items, DcConstants.RELATION, null, true);
    addElement(items, DcConstants.RIGHTS, null, true);
    addElement(items, DcConstants.SOURCE, null, true);
    addElement(items, DcConstants.SUBJECT, null, true);
    addElement(items, DcConstants.TITLE, null, true);
    addElement(items, DcConstants.TYPE, null, true);
    f.setFields(items.toArray(new FormItem[items.size()]));
    return f;
}
 
Example 8
Source File: CopyPageMetadataWidget.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createForm() {
        DynamicForm form = new DynamicForm();
        form.setWrapItemTitles(false);
//        form.setAutoWidth();
        form.setAutoHeight();
        form.setBrowserSpellCheck(false);
        allowPageIndexes = new CheckboxItem("fillPageIndexes", i18n.PageMetadataEditor_CheckboxPageIndices_Title());
        allowPageIndexes.setStartRow(true);
        allowPageIndexes.setColSpan("*");
        allowPageIndexes.setShowTitle(false);
        allowPageNumbers = new CheckboxItem("fillPageNumbers", i18n.PageMetadataEditor_CheckboxPageNubers_Title());
        allowPageNumbers.setStartRow(true);
        allowPageNumbers.setColSpan("*");
        allowPageNumbers.setShowTitle(false);
        allowPageTypes = new CheckboxItem("fillPageTypes", i18n.PageMetadataEditor_CheckboxPageTypes_Title());
        allowPageTypes.setStartRow(true);
        allowPageTypes.setColSpan("*");
        allowPageTypes.setShowTitle(false);
        form.setFields(allowPageTypes, allowPageIndexes, allowPageNumbers);
        return form;
    }
 
Example 9
Source File: LoginWindow.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createForm() {
    DynamicForm f = new DynamicForm();
    f.setWidth(400);
    f.setBrowserSpellCheck(false);
    f.setNumCols(1);
    f.setTitleOrientation(TitleOrientation.TOP);
    f.setSaveOnEnter(true);

    TextItem user = new TextItem(USERNAME, i18nSgwt.dialog_UserNameTitle());
    user.setRequired(true);
    user.setWidth("*");
    user.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);

    PasswordItem passwd = new PasswordItem(PASSWORD, i18nSgwt.dialog_PasswordTitle());
    passwd.setRequired(true);
    passwd.setWidth("*");

    TextItem producerCode = new TextItem(PRODUCER_CODE, i18n.LoginWindow_ProducerCode());
    producerCode.setWidth("*");
    producerCode.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);

    StaticTextItem error = new StaticTextItem(ERROR);
    error.setShowTitle(false);
    error.setShowErrorText(true);

    f.setItems(user, producerCode, passwd, error);
    f.addSubmitValuesHandler(new SubmitValuesHandler() {

        @Override
        public void onSubmitValues(SubmitValuesEvent event) {
            submitCredentials();
        }
    });
    return f;
}
 
Example 10
Source File: NewDigObject.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createOptionsForm() {
        SelectItem selectModel = new SelectItem(DigitalObjectDataSource.FIELD_MODEL,
                i18n.NewDigObject_OptionModel_Title());
        selectModel.setRequired(true);
        selectModel.setWidth(300);
        // issue 46: always start with empty model
        selectModel.setAllowEmptyValue(true);
        selectModel.setEmptyDisplayValue(ClientUtils.format("<i>&lt;%s&gt;</i>", i18n.NewDigObject_OptionModel_EmptyValue_Title()));
        selectModel.setOptionDataSource(MetaModelDataSource.getInstance());
//        selectModel.setShowOptionsFromDataSource(true);
        selectModel.setValueField(MetaModelDataSource.FIELD_PID);
        selectModel.setDisplayField(MetaModelDataSource.FIELD_DISPLAY_NAME);
        selectModel.setAutoFetchData(true);
        selectModel.setValidators(new CustomValidator() {

            @Override
            protected boolean condition(Object value) {
                boolean valid = getFormItem().getSelectedRecord() != null;
                return valid;
            }
        });

        TextItem newPid = new TextItem(DigitalObjectDataSource.FIELD_PID);
        newPid.setTitle(i18n.NewDigObject_OptionPid_Title());
        newPid.setTooltip(i18n.NewDigObject_OptionPid_Hint());
        newPid.setLength(36 + 5);
        newPid.setWidth((36 + 5) * 8);
        newPid.setValidators(new CustomUUIDValidator(i18n));
        //newPid.setValidators(new RegExpValidator(
        //        "uuid:[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}"));
        DynamicForm form = new DynamicForm();
        form.setWrapItemTitles(false);
        form.setAutoFocus(true);
        form.setNumCols(4);
        form.setBrowserSpellCheck(false);
        form.setFields(selectModel, newPid);
        form.setAutoWidth();
        form.setMargin(4);
        return form;
    }
 
Example 11
Source File: WorkflowJobView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createFilter() {
    DynamicForm form = new DynamicForm();
    form.setBrowserSpellCheck(false);
    form.setValidateOnExit(true);
    form.setSaveOnEnter(true);
    form.setAutoHeight();
    form.setWidth100();
    form.setNumCols(3);
    // ????
    return form;
}
 
Example 12
Source File: WorkflowTasksView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createFilter() {
    DynamicForm form = new DynamicForm();
    form.setBrowserSpellCheck(false);
    form.setValidateOnExit(true);
    form.setSaveOnEnter(true);
    form.setAutoHeight();
    form.setWidth100();
    form.setNumCols(3);
    // ????
    return form;
}
 
Example 13
Source File: PageMetadataEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createForm() {
        DynamicForm form = new DynamicForm();
        form.setWrapItemTitles(false);
//        form.setAutoWidth();
        form.setAutoHeight();
        form.setBrowserSpellCheck(false);
        form.setSaveOnEnter(true);
        form.addSubmitValuesHandler(formSubmitHandler);
        return form;
    }
 
Example 14
Source File: DigitalObjectAdministrationEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public PlainEditor(ClientMessages i18n) {
    widget = new VLayout();
    form = new DynamicForm();
    form.setDataSource(DigitalObjectAdministrationDataSource.getInstance());
    form.setBrowserSpellCheck(false);

    TextItem pid = new TextItem(DigitalObjectAdministrationDataSource.FIELD_PID,
            i18n.DigitalObjectEditor_AdministrationEditor_Pid_Title());
    pid.setWidth("*");
    pid.setCanEdit(Boolean.FALSE);
    TextItem model = new TextItem(DigitalObjectAdministrationDataSource.FIELD_MODEL,
            i18n.DigitalObjectEditor_AdministrationEditor_Model_Title());
    model.setCanEdit(Boolean.FALSE);
    TextItem owner = new TextItem(DigitalObjectAdministrationDataSource.FIELD_OWNER,
            i18n.DigitalObjectEditor_AdministrationEditor_Owner_Title());
    owner.setCanEdit(Boolean.FALSE);
    TextItem creationDate = new TextItem(DigitalObjectAdministrationDataSource.FIELD_CREATED,
            i18n.DigitalObjectEditor_AdministrationEditor_Created_Title());
    creationDate.setCanEdit(Boolean.FALSE);
    TextItem modificationDate = new TextItem(DigitalObjectAdministrationDataSource.FIELD_MODIFIED,
            i18n.DigitalObjectEditor_AdministrationEditor_Modified_Title());
    modificationDate.setCanEdit(Boolean.FALSE);

    SelectItem device = new SelectItem(DigitalObjectAdministrationDataSource.FIELD_DEVICE,
            i18n.DigitalObjectEditor_AdministrationEditor_Device_Title());
    device.setWidth(250);
    DeviceDataSource.setOptionDataSource(device);
    device.setAllowEmptyValue(true);
    device.setEmptyDisplayValue(ClientUtils.format("<i>&lt;%s&gt;</i>",
            i18n.DigitalObjectEditor_AdministrationEditor_NoDeviceSelection_Title()));

    TextItem filename = new TextItem(DigitalObjectAdministrationDataSource.FIELD_FILENAME,
            i18n.DigitalObjectEditor_AdministrationEditor_File_Title());
    filename.setWidth("*");
    filename.setCanEdit(Boolean.FALSE);

    TextItem export = new TextItem(DigitalObjectAdministrationDataSource.FIELD_EXPORT,
            i18n.DigitalObjectEditor_AdministrationEditor_Export_Title());
    export.setWidth("*");
    export.setCanEdit(Boolean.FALSE);

    TextItem ndkExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_NDK_EXPORT,
            i18n.DigitalObjectEditor_AdministrationEditor_Ndk_Export_Title());
    ndkExport.setWidth("*");
    ndkExport.setCanEdit(Boolean.FALSE);

    TextItem archiveExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_ARCHIVE_EXPORT,
            i18n.DigitalObjectEditor_AdministrationEditor_Archive_Export_Title());
    archiveExport.setWidth("*");
    archiveExport.setCanEdit(Boolean.FALSE);

    TextItem krameriusExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_KRAMERIUS_EXPORT,
            i18n.DigitalObjectEditor_AdministrationEditor_Kramerius_Export_Title());
    krameriusExport.setWidth("*");
    krameriusExport.setCanEdit(Boolean.FALSE);

    TextItem crossrefExport = new TextItem(DigitalObjectAdministrationDataSource.FIELD_CROSSREF_EXPORT,
            i18n.DigitalObjectEditor_AdministrationEditor_Crossref_Export_Title());
    crossrefExport.setWidth("*");
    crossrefExport.setCanEdit(Boolean.FALSE);

    ComboBoxItem organization = new ComboBoxItem(DigitalObjectAdministrationDataSource.FIELD_ORGANIZATION,
            i18n.UsersView_ListHeader_Organization_Title());
    organization.setWidth(250);
    organization.setValueMap(Organization.getMap());

    ComboBoxItem user = new ComboBoxItem(DigitalObjectAdministrationDataSource.FIELD_USER,
            i18n.UsersView_ListHeader_Proccesor_Title());
    user.setWidth(250);
    user.setOptionDataSource(UserDataSource.getInstance());
    user.setValueField(UserDataSource.FIELD_USERNAME);
    user.setDisplayField(UserDataSource.FIELD_USERNAME);

    ComboBoxItem status = new ComboBoxItem(DigitalObjectAdministrationDataSource.FIELD_STATUS,
            i18n.DigitalObjectEditor_AdministrationEditor_Status_Title());
    status.setWidth(250);
    status.setValueMap(DigitalObjectState.getMap(i18n));

    form.setItems(pid, model, owner, creationDate, modificationDate, device, filename, export,  ndkExport, krameriusExport, archiveExport, crossrefExport, organization, user, status);
    widget.setMembers(form);
}
 
Example 15
Source File: DigitalObjectSearchView.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
private DynamicForm createFilter() {
    DynamicForm form = new DynamicForm();
    form.setBrowserSpellCheck(false);
    form.setValidateOnExit(true);
    form.setSaveOnEnter(true);
    form.setAutoHeight();
    form.setWidth100();
    form.setNumCols(6);

    final RadioGroupItem filterType = new RadioGroupItem(DigitalObjectResourceApi.SEARCH_TYPE_PARAM);
    filterType.setVertical(false);
    filterType.setShowTitle(false);
    filterType.setWrap(false);
    // setRedrawOnChange(true) enforces evaluation of other FormItem.setShowIfCondition
    filterType.setRedrawOnChange(true);
    filterType.setColSpan(5);
    final LinkedHashMap<String, String> filterMap = new LinkedHashMap<String, String>();
    filterMap.put(FILTER_ALPHABETICAL, i18n.DigitalObjectSearchView_FilterGroupAlphabetical_Title());
    filterMap.put(FILTER_LAST_CREATED, i18n.DigitalObjectSearchView_FilterGroupLastCreated_Title());
    filterMap.put(FILTER_LAST_MODIFIED, i18n.DigitalObjectSearchView_FilterGroupLastModified_Title());
    if (!Editor.getInstance().hasPermission("proarc.permission.repository.search.groupOwner")) {
        filterMap.put(FILTER_PHRASE, i18n.DigitalObjectSearchView_FilterGroupPhrase_Title());
    }
    filterMap.put(FILTER_QUERY, i18n.DigitalObjectSearchView_FilterGroupAdvanced_Title());
    if (Editor.getInstance().hasPermission("proarc.permission.admin")) {
        filterMap.put(FILTER_DELETED, i18n.DigitalObjectSearchView_FilterGroupDeleted_Title());
    }
    filterType.setValueMap(filterMap);
    filterType.setValue(FILTER_LAST_CREATED);

    FormItemIfFunction showIfAdvanced = new StringMatchFunction(filterType, FILTER_QUERY, FILTER_DELETED);
    FormItemIfFunction showIfPhrase = new StringMatchFunction(filterType, FILTER_PHRASE);
    FormItemIfFunction showIfCreatedModifiedQuery = new StringMatchFunction(filterType, FILTER_LAST_CREATED, FILTER_LAST_MODIFIED, FILTER_QUERY, FILTER_DELETED, FILTER_ALPHABETICAL);
    FormItemIfFunction showIfAplhabetical = new StringMatchFunction(filterType, FILTER_LAST_CREATED, FILTER_LAST_MODIFIED, FILTER_ALPHABETICAL);

    final TextItem phrase = createAdvancedItem(DigitalObjectResourceApi.SEARCH_PHRASE_PARAM,
            i18n.DigitalObjectSearchView_FilterPhrase_Title(), showIfPhrase);
    phrase.setValidators(new RequiredIfValidator(new RequiredIfFunction() {

        @Override
        public boolean execute(FormItem formItem, Object value) {
            return FILTER_PHRASE.equals(filterType.getValueAsString());
        }
    }), new LengthRangeValidator() {{
        setMax(1000);
    }});

    SubmitItem submit = new SubmitItem("search", i18n.DigitalObjectSearchView_FilterSearchButton_Title());

    form.setFields(filterType, createSpacerItem("100%", null),
            phrase,
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_TITLE_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedTitle_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_IDENTIFIER_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedIdentifier_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_CREATOR_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedCreator_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_QUERY_LABEL_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedLabel_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createAdvancedItem(DigitalObjectResourceApi.SEARCH_OWNER_PARAM,
                    i18n.DigitalObjectSearchView_FilterAdvancedOwner_Title(), showIfAdvanced), createSpacerItem("100%", showIfAdvanced),
            createModelItem(i18n.DigitalObjectSearchView_FilterAdvancedModel_Title(), showIfCreatedModifiedQuery),
            createSortItem(i18n.DigitalObjectSearchView_FilterSort_Title(), showIfAplhabetical),
            createRememberModelItem(i18n.DigitalObjectSearchView_FilterAdvancedModel_Remember_Title(), showIfCreatedModifiedQuery),
            createSpacerItem("100%", showIfCreatedModifiedQuery),
            submit);
    
    form.addSubmitValuesHandler(new SubmitValuesHandler() {

        @Override
        public void onSubmitValues(SubmitValuesEvent event) {
            if (filters.validate(false)) {
                filter();
            }
        }
    });
    return form;
}