Java Code Examples for com.smartgwt.client.data.fields.DataSourceTextField#setCanEdit()

The following examples show how to use com.smartgwt.client.data.fields.DataSourceTextField#setCanEdit() . 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: WorkflowParameterDataSource.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public WorkflowParameterDataSource() {
        setID(ID);
        setDataURL(RestConfig.URL_WORKFLOW_PARAMETER);

        DataSourceTextField name = new DataSourceTextField(FIELD_NAME);
        name.setDisplayField(WorkflowModelConsts.PARAMETER_PROFILELABEL);
        name.setCanEdit(false);

        DataSourceTextField value = new DataSourceTextField(FIELD_VALUE);
        value.setCanEdit(true);

        setFields(name, value);
        setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
//        setOperationBindings(
//                RestConfig.createAddOperation(),
//                RestConfig.createDeleteOperation(),
//                RestConfig.createUpdateOperation());
    }
 
Example 2
Source File: UserPermissionDataSource.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public UserPermissionDataSource() {
    setID(ID);
    setDataURL(RestConfig.URL_USER_PERMISSIONS);

    DataSourceTextField permId = new DataSourceTextField(FIELD_PERMISSIONID);
    permId.setPrimaryKey(true);
    permId.setCanEdit(false);
    permId.setHidden(true);

    DataSourceTextField display = new DataSourceTextField(FIELD_DISPLAY);

    setFields(permId, display);
    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
}
 
Example 3
Source File: UserDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public UserDataSource() {
    setID(ID);

    ClientMessages i18n = GWT.create(ClientMessages.class);

    setDataURL(RestConfig.URL_USER);

    DataSourceIntegerField userId = new DataSourceIntegerField(FIELD_ID);
    userId.setPrimaryKey(true);
    userId.setCanEdit(false);
    userId.setHidden(true);
    userId.setTitle(i18n.UsersView_ListHeader_Id_Title());

    DataSourceTextField userName = new DataSourceTextField(FIELD_USERNAME);
    userName.setCanEdit(false);
    userName.setRequired(true);
    userName.setReadOnlyEditorProperties(new StaticTextItem());
    userName.setTitle(i18n.UsersView_ListHeader_Username_Title());
    userName.setPrompt(i18n.UsersView_ListHeader_Username_Hint());

    DataSourcePasswordField passwd = new DataSourcePasswordField(FIELD_PASSWORD);
    passwd.setHidden(true);
    passwd.setTitle(i18n.UsersView_ListHeader_Password_Title());

    DataSourceTextField surname = new DataSourceTextField(UserResourceApi.USER_SURNAME);
    surname.setRequired(true);
    surname.setTitle(i18n.UsersView_ListHeader_Surname_Title());

    DataSourceTextField forename = new DataSourceTextField(UserResourceApi.USER_FORENAME);
    forename.setTitle(i18n.UsersView_ListHeader_Forename_Title());

    DataSourceTextField organization = new DataSourceTextField(UserResourceApi.USER_ORGANIZATION);
    organization.setTitle(i18n.UsersView_ListHeader_Organization_Title());
    organization.setValueMap(Organization.getMap());
    organization.setReadOnlyEditorProperties(new StaticTextItem());

    DataSourceTextField role = new DataSourceTextField(UserResourceApi.USER_ROLE);
    role.setTitle(i18n.UsersView_ListHeader_Role_Title());
    role.setValueMap(UserRole.getMap());
    role.setReadOnlyEditorProperties(new StaticTextItem());

    DataSourceTextField email = new DataSourceTextField(UserResourceApi.USER_EMAIL);
    email.setTitle(i18n.UsersView_ListHeader_Email_Title());

    DataSourceTextField home = new DataSourceTextField(UserResourceApi.USER_HOME);
    home.setCanEdit(false);
    home.setReadOnlyEditorProperties(new StaticTextItem());
    home.setHidden(true);
    home.setTitle(i18n.UsersView_ListHeader_Home_Title());

    DataSourceDateTimeField created = new DataSourceDateTimeField(UserResourceApi.USER_CREATED);
    created.setCanEdit(false);
    created.setTitle(i18n.UsersView_ListHeader_Created_Title());
    created.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);

    DataSourceTextField remoteName = new DataSourceTextField(UserResourceApi.USER_REMOTENAME);
    remoteName.setTitle(i18n.UsersView_ListHeader_RemoteName_Title());
    remoteName.setCanEdit(false);
    remoteName.setHidden(true);

    DataSourceTextField remoteType = new DataSourceTextField(UserResourceApi.USER_REMOTETYPE);
    remoteType.setTitle(i18n.UsersView_ListHeader_RemoteType_Title());
    remoteType.setCanEdit(false);
    remoteType.setHidden(true);

    setFields(userId, userName, passwd, surname, forename, organization, role, email, created, remoteName, remoteType, home);

    setOperationBindings(RestConfig.createAddOperation(), RestConfig.createUpdateOperation());
    setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
}
 
Example 4
Source File: WorkflowTaskDataSource.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public WorkflowTaskDataSource() {
        setID(ID);
        setDataURL(RestConfig.URL_WORKFLOW_TASK);
        final ClientMessages i18n = GWT.create(ClientMessages.class);

        allTaskStates = new LinkedHashMap<String, String>() {{
            put(State.WAITING.name(), i18n.WorkflowTask_State_Waiting_Title());
            put(State.READY.name(), i18n.WorkflowTask_State_Ready_Title());
            put(State.STARTED.name(), i18n.WorkflowTask_State_Started_Title());
            put(State.FINISHED.name(), i18n.WorkflowTask_State_Finished_Title());
            put(State.CANCELED.name(), i18n.WorkflowTask_State_Canceled_Title());
        }};
        DataSourceIntegerField fieldId = new DataSourceIntegerField(FIELD_ID);
        fieldId.setPrimaryKey(Boolean.TRUE);
        fieldId.setDetail(true);
        fieldId.setTitle(i18n.WorkflowTask_Field_Id_Title());
        fieldId.setCanEdit(false);

        DataSourceTextField label = new DataSourceTextField(FIELD_LABEL);
        label.setTitle(i18n.WorkflowTask_Field_Label_Title());
        label.setLength(255);
        label.setCanEdit(false);

        DataSourceTextField jobId = new DataSourceTextField(FIELD_JOB_ID);
        jobId.setTitle(i18n.WorkflowTask_Field_JobId_Title());
        jobId.setDetail(true);
        jobId.setCanEdit(false);

        DataSourceTextField jobLabel = new DataSourceTextField(FIELD_JOB_LABEL);
        jobLabel.setTitle(i18n.WorkflowTask_Field_JobLabel_Title());
        jobLabel.setDetail(true);
        jobLabel.setCanEdit(false);

        DataSourceEnumField state = new DataSourceEnumField(FIELD_STATE);
        state.setTitle(i18n.WorkflowTask_Field_State_Title());
        state.setValueMap(allTaskStates);
        state.setRequired(true);

        DataSourceTextField owner = new DataSourceTextField(FIELD_OWNER);
        owner.setTitle(i18n.WorkflowTask_Field_Owner_Title());
        owner.setDisplayField(WorkflowModelConsts.TASK_OWNERNAME);

        DataSourceTextField note = new DataSourceTextField(FIELD_NOTE);
        note.setTitle(i18n.WorkflowTask_Field_Note_Title());
        note.setDetail(true);

        DataSourceTextField type = new DataSourceTextField(FIELD_TYPE);
        type.setTitle(i18n.WorkflowTask_Field_Profile_Title());
        type.setDetail(true);
        type.setCanEdit(false);

        DataSourceEnumField priority = new DataSourceEnumField(FIELD_PRIORITY);
        priority.setTitle(i18n.WorkflowTask_Field_Priority_Title());
        priority.setDetail(true);
        priority.setValueMap(new LinkedHashMap() {{
            put("1", i18n.Workflow_Priority_1_Title());
            put("2", i18n.Workflow_Priority_2_Title());
            put("3", i18n.Workflow_Priority_3_Title());
            put("4", i18n.Workflow_Priority_4_Title());
        }});

        DataSourceDateTimeField created = new DataSourceDateTimeField(FIELD_CREATED);
        created.setTitle(i18n.WorkflowTask_Field_Created_Title());
        created.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
        created.setCanEdit(false);
        created.setDetail(true);

        DataSourceDateTimeField modified = new DataSourceDateTimeField(FIELD_MODIFIED);
        modified.setTitle(i18n.WorkflowTask_Field_Modified_Title());
        modified.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATETIME);
        modified.setCanEdit(false);
        modified.setDetail(true);

        DataSourceField params = new DataSourceField(FIELD_PARAMETERS, FieldType.ANY);
        params.setHidden(true);

        DataSourceField materials = new DataSourceField(FIELD_MATERIALS, FieldType.ANY);
        materials.setHidden(true);

        setFields(label, type, state, priority, owner, created, modified,
                fieldId, note, jobId, jobLabel, params, materials);
        setRequestProperties(RestConfig.createRestRequest(getDataFormat()));
        setOperationBindings(
                RestConfig.createAddOperation(),
//                RestConfig.createDeleteOperation(),
                RestConfig.createUpdatePostOperation());
    }