• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TitleOrientation类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.smartgwt.client.types.TitleOrientation的典型用法代码示例。如果您正苦于以下问题:Java TitleOrientation类的具体用法?Java TitleOrientation怎么用?Java TitleOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TitleOrientation类属于com.smartgwt.client.types包,在下文中一共展示了TitleOrientation类的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createForm

点赞 3

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
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 fieldLabel = new TextItem(DeviceDataSource.FIELD_LABEL);
    fieldLabel.setRequired(true);
    fieldLabel.setWidth("*");
    df.setItems(fieldId, fieldLabel);
    return df;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:18,
代码来源:DeviceManager.java

示例2: createForm

点赞 3

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
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;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:25,
代码来源:UploadFile.java

示例3: createFullForm

点赞 3

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
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;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:27,
代码来源:DcEditor.java

示例4: initLayerShow

点赞 3

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void initLayerShow() {
	layerShow.setTitle(MESSAGES.layerActionsShowLayer());
	layerShow.setTooltip(MESSAGES.layerActionsShowLayerToolTip());
	layerShow.setTitleOrientation(TitleOrientation.LEFT);
	if (vectorLayer != null) {
		layerShow.setValue(vectorLayer.isVisible());
	} else {
		layerShow.setValue(rasterLayer.isVisible());
	}
	layerShow.addChangedHandler(new ChangedHandler() {

		public void onChanged(ChangedEvent event) {
			if (vectorLayer != null) {
				vectorLayer.setVisible(layerShow.getValueAsBoolean());
			} else {
				rasterLayer.setVisible(layerShow.getValueAsBoolean());
			}
		}
	});
}
 

开发者ID:geomajas,
项目名称:geomajas-project-client-gwt,
代码行数:21,
代码来源:LayerActions.java

示例5: setEntryOperatorRuleItem

点赞 3

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryOperatorRuleItem() {
    this.entryOperatorItem = new SelectItem();
    this.entryOperatorItem.setWidth(this.entryItemWidth);
    this.entryOperatorItem.setTitle(i18n.operator());
    this.entryOperatorItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryOperatorItem.setValueMap(getMathSymbols());
    this.entryOperatorItem.setDefaultValue(">");
    this.entryOperatorItem.setTextAlign(Alignment.CENTER);
    this.entryOperatorItem.addChangedHandler(new ChangedHandler() {
        public void onChanged(ChangedEvent event) {
            if (exitOperatorItem != null) {
                TextItem exitOperatorTextItem = (TextItem) event.getSource();
                exitOperatorItem.setValue(getInverse(exitOperatorTextItem.getValueAsString()));
            }
        }
    });
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:18,
代码来源:CreateSimpleRuleLayout.java

示例6: createDefaultForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
public DynamicForm createDefaultForm() {
    AbstractModelForm df = new AbstractModelForm() {};
    df.setBrowserSpellCheck(false);
    df.setTitleOrientation(TitleOrientation.TOP);
    df.setNumCols(1);
    df.setWrapItemTitles(false);
    df.setWidth100();
    df.setHoverWrap(false);
    df.setItemHoverWidth(defaultHoverWidth);
    df.setHoverWidth(defaultHoverWidth);
    return df;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:13,
代码来源:FormGenerator.java

示例7: createForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
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;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:36,
代码来源:LoginWindow.java

示例8: createParameterForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private DynamicForm createParameterForm(Record[] records) {
    if (records == null || records.length == 0) {
        return createDefaultParameterForm();
    }
    DynamicForm df = new DynamicForm();
    df.setUseFlatFields(true);
    df.setWrapItemTitles(false);
    df.setTitleOrientation(TitleOrientation.TOP);
    df.setNumCols(3);
    df.setColWidths("*", "*", "*");
    df.setItemHoverWidth(300);
    FormItem[] items = new FormItem[records.length];
    Record values = new Record();
    for (int i = 0; i < records.length; i++) {
        Record record = records[i];
        ValueType valueType = ValueType.fromString(
                record.getAttribute(WorkflowModelConsts.PARAMETER_VALUETYPE));
        DisplayType displayType = DisplayType.fromString(
                record.getAttribute(WorkflowModelConsts.PARAMETER_DISPLAYTYPE));
        displayType = valueType == ValueType.DATETIME ? DisplayType.DATETIME : displayType;

        String paramName = record.getAttribute(WorkflowParameterDataSource.FIELD_NAME);
        String fieldName = "f" + i;
        items[i] = createFormItem(record, valueType, displayType);
        items[i].setName(fieldName);
        // use dataPath to solve cases where the valid JSON name is not a valid javascript ID (param.id).
        items[i].setDataPath("/" + paramName);
        items[i].setTitle(record.getAttribute(WorkflowModelConsts.PARAMETER_PROFILELABEL));
        items[i].setTooltip(record.getAttribute(WorkflowModelConsts.PARAMETER_PROFILEHINT));
        Object val = getParameterValue(record, valueType, displayType);
        if (val != null) {
            values.setAttribute(paramName, val);
        }
    }
    df.setItems(items);
    df.editRecord(values);
    df.addItemChangedHandler(itemChangedHandler);
    return df;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:40,
代码来源:WorkflowTaskFormView.java

示例9: MonographUnitForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
public MonographUnitForm(final ClientMessages i18n) {
    setWidth100();
    setHeight100();
    setTitleOrientation(TitleOrientation.TOP);
    setNumCols(1);

    // identifiers
    final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
            i18n.MonographUnitForm_Identifiers_Title());
    identifiers.setDataSource(IdentifierDataSource.getInstance());
    identifiers.setValidators(
            new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
    DynamicForm identifierForm = new DynamicForm();
    identifierForm.setUseAllDataSourceFields(true);
    identifierForm.setNumCols(4);
    identifiers.setFormPrototype(identifierForm);
    identifiers.setEndRow(true);
    identifiers.setColSpan("2");

    TextItem unitNumber = new TextItem(ModsCustomDataSource.FIELD_MONOGRAPHUNIT_NUMBER);
    unitNumber.setTitle(i18n.MonographUnitForm_UnitNumber_Title());
    unitNumber.setRequired(true);
    unitNumber.setValidators(new IsIntegerValidator());

    TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.MonographUnitForm_Note_Title());
    note.setWidth("*");
    note.setHeight("*");
    note.setColSpan("*");

    setFields(unitNumber, identifiers, note);
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:32,
代码来源:MonographUnitForm.java

示例10: PeriodicalVolumeForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
public PeriodicalVolumeForm(ClientMessages i18n) {
    setWidth100();
    setHeight100();
    setTitleOrientation(TitleOrientation.TOP);
    setNumCols(1);

    TextItem volumeNumber = new TextItem(ModsCustomDataSource.FIELD_PER_VOLUME_NUMBER,
            i18n.PeriodicalVolumeForm_Number_Title());
    volumeNumber.setRequired(true);
    // javascript regexp ^([1-9]\d{0,4}(-[1-9]\d{0,4})?)$
    volumeNumber.setValidators(new StringTrimValidator(), new RegExpValidator("^([1-9]\\d{0,4}(-[1-9]\\d{0,4})?)$"));
    TextItem date = new TextItem(ModsCustomDataSource.FIELD_PER_VOLUME_YEAR,
            i18n.PeriodicalVolumeForm_Date_Title());
    date.setRequired(true);
    // issue 43; see https://docs.google.com/document/d/1zSriHPdnUY5d_tKv0M8a6nEym560DKh2H6XZ24tGAEw/edit?pli=1
    // javascript regexp ^([1-9]\d{3}(-[1-9]\d{3})?)$
    date.setValidators(new StringTrimValidator(), new RegExpValidator("^([1-9]\\d{3}(-[1-9]\\d{3})?)$"));
    date.setEndRow(true);

    // identifiers
    final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
            i18n.PeriodicalVolumeForm_Identifiers_Title());
    identifiers.setDataSource(IdentifierDataSource.getInstance());
    identifiers.setValidators(
            new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
    DynamicForm identifierForm = new DynamicForm();
    identifierForm.setUseAllDataSourceFields(true);
    identifierForm.setNumCols(4);
    identifiers.setFormPrototype(identifierForm);
    identifiers.setEndRow(true);
    identifiers.setColSpan("2");

    TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE,
            i18n.PeriodicalVolumeForm_Note_Title());
    note.setWidth("*");
    note.setHeight("*");
    note.setColSpan("*");

    setFields(volumeNumber, date, identifiers, note);
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:41,
代码来源:PeriodicalVolumeForm.java

示例11: setEntryValueItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryValueItem() {
    this.entryValueItem = new TextItem();
    this.entryValueItem.setWidth(this.entryItemWidth);
    this.entryValueItem.setTitle(i18n.value());
    this.entryValueItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryValueItem.setKeyPressFilter("[0-9]");
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:8,
代码来源:CreateSimpleRuleLayout.java

示例12: setEntryValueUnitItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryValueUnitItem() {
    this.entryValueUnitItem = new SelectItem();
    this.entryValueUnitItem.setWidth(this.entryItemWidth);
    this.entryValueUnitItem.setTitle(i18n.unit());
    this.entryValueUnitItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryValueUnitItem.setValueMap(this.unitHashMap);
    this.entryValueUnitItem.setTextAlign(Alignment.CENTER);
    
    ArrayList<String> list = new ArrayList<String>(this.unitHashMap.values());
    if (list.size() != 0) {
        this.entryValueUnitItem.setDefaultValue(list.get(0));
    }
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:14,
代码来源:CreateSimpleRuleLayout.java

示例13: setCountItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setCountItem() {
    this.countItem = new TextItem();
    this.countItem.setWidth(this.entryItemWidth);
    this.countItem.setTitle(i18n.count());
    this.countItem.setTitleOrientation(TitleOrientation.TOP);
    this.countItem.setKeyPressFilter("[0-9]");
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:8,
代码来源:CreateSimpleRuleLayout.java

示例14: setEntryTimeItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryTimeItem() {
    this.entryTimeItem = new TextItem();
    this.entryTimeItem.setWidth(this.entryItemWidth);
    this.entryTimeItem.setTitle("<nobr>" + i18n.timeValue() + "</nobr>");
    this.entryTimeItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryTimeItem.setKeyPressFilter("[0-9]");
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:8,
代码来源:CreateSimpleRuleLayout.java

示例15: setEntryTimeUnitItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryTimeUnitItem() {
    this.entryTimeUnitItem = new SelectItem();
    this.entryTimeUnitItem.setWidth(this.entryItemWidth);
    this.entryTimeUnitItem.setTitle(i18n.timeUnit());
    this.entryTimeUnitItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryTimeUnitItem.setTooltip("<nobr>" + i18n.unitsTime() + "</nobr>");
    this.entryTimeUnitItem.setValueMap(this.timeUnitHashMap);
    this.entryTimeUnitItem.setDefaultValue("H");
    this.entryTimeUnitItem.setTextAlign(Alignment.CENTER);
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:11,
代码来源:CreateSimpleRuleLayout.java

示例16: setEntryValueConditionItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryValueConditionItem() {
    this.entryValueConditionItem = new TextItem();
    this.entryValueConditionItem.setWidth(this.entryItemWidth);
    this.entryValueConditionItem.setTitle(i18n.value());
    this.entryValueConditionItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryValueConditionItem.setKeyPressFilter("[0-9]");
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:8,
代码来源:CreateSimpleRuleLayout.java

示例17: setEntryValueUnitConditionItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setEntryValueUnitConditionItem() {
    this.entryValueUnitConditionItem = new SelectItem();
    this.entryValueUnitConditionItem.setWidth(this.entryItemWidth);
    this.entryValueUnitConditionItem.setTitle(i18n.unit());
    this.entryValueUnitConditionItem.setTitleOrientation(TitleOrientation.TOP);
    this.entryValueUnitConditionItem.setValueMap(this.unitHashMap);
    this.entryValueUnitConditionItem.setTextAlign(Alignment.CENTER);
    
    ArrayList<String> list = new ArrayList<String>(this.unitHashMap.values());
    if (list.size() != 0) {
        this.entryValueUnitConditionItem.setDefaultValue(list.get(0));
    }
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:14,
代码来源:CreateSimpleRuleLayout.java

示例18: setCountConditionItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setCountConditionItem() {
    this.countConditionItem = new TextItem();
    this.countConditionItem.setWidth(this.entryItemWidth);
    this.countConditionItem.setTitle(i18n.count());
    this.countConditionItem.setTitleOrientation(TitleOrientation.TOP);
    this.countConditionItem.setKeyPressFilter("[0-9]");
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:8,
代码来源:CreateSimpleRuleLayout.java

示例19: setExitTimeItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setExitTimeItem() {
    this.exitTimeItem = new TextItem();
    this.exitTimeItem.setWidth(this.entryItemWidth);
    this.exitTimeItem.setTitle("<nobr>" + i18n.timeValue() + "</nobr>");
    this.exitTimeItem.setTitleOrientation(TitleOrientation.TOP);
    this.exitTimeItem.setKeyPressFilter("[0-9]");
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:8,
代码来源:CreateSimpleRuleLayout.java

示例20: setExitTimeUnitItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setExitTimeUnitItem() {
    this.exitTimeUnitItem = new SelectItem();
    this.exitTimeUnitItem.setWidth(this.entryItemWidth);
    this.exitTimeUnitItem.setTitle(i18n.timeUnit());
    this.exitTimeUnitItem.setTitleOrientation(TitleOrientation.TOP);
    this.exitTimeUnitItem.setTooltip("<nobr>" + i18n.unitsTime() + "</nobr>");
    this.exitTimeUnitItem.setValueMap(this.timeUnitHashMap);
    this.exitTimeUnitItem.setDefaultValue("H");
    this.exitTimeUnitItem.setTextAlign(Alignment.CENTER);
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:11,
代码来源:CreateSimpleRuleLayout.java

示例21: setExitOperatorItem

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private void setExitOperatorItem() {
    this.exitOperatorItem = new SelectItem();
    this.exitOperatorItem.setWidth(this.entryItemWidth);
    this.exitOperatorItem.setTitle(i18n.operator());
    this.exitOperatorItem.setTitleOrientation(TitleOrientation.TOP);
    this.exitOperatorItem.setValueMap(getMathSymbols());
    this.exitOperatorItem.setTextAlign(Alignment.CENTER);
    
    String entryOperator = entryOperatorItem.getValueAsString();
    this.exitOperatorItem.setDefaultValue(getInverse(entryOperator));
}
 

开发者ID:52North,
项目名称:SensorWebClient,
代码行数:12,
代码来源:CreateSimpleRuleLayout.java

示例22: createDateInputs

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private DynamicForm createDateInputs() {
    datesForm = new DynamicForm();
    datesForm.setWidth100();
    datesForm.setTitleOrientation(TitleOrientation.LEFT);
    datesForm.setItemLayout(FormLayoutType.TABLE);
    datesForm.setLayoutAlign(Alignment.LEFT);
    datesForm.setNumCols(3);
    datesForm.setColWidths("80", "200", "*");
    datesForm.setWrapItemTitles(false);

    userSelect = new SelectItem("User");
    userSelect.disable();
    userSelect.setValue(LoginModel.getInstance().getLogin());
    userSelect.setAlign(Alignment.LEFT);
    userSelect.addChangedHandler(new ChangedHandler() {
        public void onChanged(ChangedEvent event) {
            Date from = readDateFromFormItem(event.getForm().getItem("From"));
            Date to = readDateFromFormItem(event.getForm().getItem("To"));
            refreshUsage(from, to);
        }
    });

    controller.getEventDispatcher().addUsersWithJobsListener(new SchedulerListeners.UsersListener() {
        @Override
        public void usersUpdated(List<SchedulerUser> users) {
            ArrayList<String> formatted = new ArrayList<String>(users.size());
            for (SchedulerUser user : users) {
                formatted.add(user.getUsername());
            }
            if (formatted.size() == 1 && formatted.get(0).equals(LoginModel.getInstance().getLogin())) {
                // only one user available and it is the current user, disable combo
                userSelect.disable();
                userSelect.setValue(LoginModel.getInstance().getLogin());
            } else if (!formatted.isEmpty()) {
                userSelect.enable();
            }

            if (userSelect.getValue() != null &&
                userSelect.getValue().equals(LoginModel.getInstance().getLogin()) &&
                !formatted.contains(LoginModel.getInstance().getLogin())) {
                // remove default value (user login) as he has not yet submitted jobs
                userSelect.clearValue();
            }

            userSelect.setValueMap(formatted.toArray(new String[formatted.size()]));
        }
    });

    RelativeDateItem fromDate = new RelativeDateItem("From", "Usage From");
    fromDate.setValue(DEFAULT_START_DATE);
    fromDate.setAlign(Alignment.LEFT);
    fromDate.setShowFutureOptions(false);

    RelativeDateItem toDate = new RelativeDateItem("To");
    toDate.setValue(DEFAULT_END_DATE);
    toDate.setAlign(Alignment.LEFT);
    toDate.setShowFutureOptions(false);

    ButtonItem button = new ButtonItem("Refresh");
    button.setAutoFit(true);
    button.setStartRow(false);
    button.setAlign(Alignment.RIGHT);
    button.addClickHandler(refreshAfterDateSelection());

    datesForm.setItems(userSelect, button, fromDate, toDate);

    return datesForm;
}
 

开发者ID:ow2-proactive,
项目名称:scheduling-portal,
代码行数:69,
代码来源:UsageView.java

示例23: createForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private Widget createForm() {
    taskForm = new DynamicForm();
    taskForm.setDataSource(WorkflowTaskDataSource.getInstance());
    taskForm.setNumCols(3);
    taskForm.setColWidths("*", "*", "*");
    taskForm.setTitleOrientation(TitleOrientation.TOP);
    taskForm.setItemHoverWidth(300);

    StaticTextItem jobLabel = new StaticTextItem(WorkflowTaskDataSource.FIELD_JOB_LABEL);
    jobLabel.setColSpan("*");
    jobLabel.setWidth("*");
    jobLabel.setShowTitle(false);
    jobLabel.setReadOnlyTextBoxStyle(Editor.CSS_HEADER_INSIDE_FORM);
    jobLabel.setTextBoxStyle(Editor.CSS_HEADER_INSIDE_FORM);

    final SelectItem owner = new SelectItem(WorkflowTaskDataSource.FIELD_OWNER);
    owner.setOptionDataSource(UserDataSource.getInstance());
    owner.setValueField(UserDataSource.FIELD_ID);
    owner.setDisplayField(UserDataSource.FIELD_USERNAME);
    owner.setWidth("*");
    owner.setValidators(new RequiredIfValidator(requiredFunc));

    TextAreaItem note = new TextAreaItem(WorkflowTaskDataSource.FIELD_NOTE);
    note.setStartRow(true);
    note.setColSpan("*");
    note.setWidth("*");

    // title tooltip is broken in SmartGWT 4.0
    final FormItemIcon taskHelpIcon = new FormItemIcon();
    taskHelpIcon.setSrc("[SKIN]/actions/help.png");
    taskHelpIcon.setTabIndex(-1);
    taskHelpIcon.setNeverDisable(true);
    taskHelpIcon.setShowIfCondition(new FormItemIfFunction() {

        @Override
        public boolean execute(FormItem item, Object value, DynamicForm form) {
            String hint = taskForm.getValueAsString(WorkflowTaskDataSource.FIELD_HINT);
            taskHelpIcon.setPrompt(hint);
            return hint != null;
        }
    });
    TextItem label = new TextItem(WorkflowTaskDataSource.FIELD_LABEL);
    label.setWidth("*");
    label.setIcons(taskHelpIcon);

    stateItem = new SelectItem(WorkflowTaskDataSource.FIELD_STATE);
    stateItem.addChangedHandler(new ChangedHandler() {

        @Override
        public void onChanged(ChangedEvent event) {
            owner.redraw();
            paramForm.markForRedraw();
        }
    });

    taskForm.setFields(jobLabel,
            label,
            owner,
            stateItem,
            new TextItem(WorkflowTaskDataSource.FIELD_CREATED),
            new TextItem(WorkflowTaskDataSource.FIELD_MODIFIED),
            new SelectItem(WorkflowTaskDataSource.FIELD_PRIORITY),
            note);
    return taskForm;
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:66,
代码来源:WorkflowTaskFormView.java

示例24: createOptionForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
private Widget createOptionForm() {
        final SelectItem profile = createProfileSelector();

        TextItem metadata = new TextItem(WorkflowResourceApi.NEWJOB_METADATA, "Metadata");
        metadata.setRequired(true);
        metadata.setShowTitle(false);
        metadata.setCanEdit(false);
        metadata.setStartRow(true);
        metadata.setReadOnlyDisplay(ReadOnlyDisplayAppearance.STATIC);
        metadata.setRequiredMessage(i18n.WorkflowJob_NewJobView_Err_NoMetadata_Msg());
        // show empty value instead of XML
        metadata.setEditorValueFormatter(new FormItemValueFormatter() {

            @Override
            public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
                return "";
            }
        });

//        HiddenItem catalog = new HiddenItem(WorkflowResourceApi.NEWJOB_CATALOGID);
//        catalog.setRequired(true);
//        catalog.setRequiredMessage("Nejsou vybrána žádná metadata!");

        optionForm = new DynamicForm();
        optionForm.setAutoWidth();
        optionForm.setWrapItemTitles(false);
        optionForm.setTitleOrientation(TitleOrientation.TOP);
        optionForm.setItems(profile, metadata);
        // XXX HiddenValidationErrorsHandler does not work in smartgwt 4.0
//        optionForm.addHiddenValidationErrorsHandler(new HiddenValidationErrorsHandler() {
//
//            @Override
//            public void onHiddenValidationErrors(HiddenValidationErrorsEvent event) {
//                event.cancel();
//                String[] profileErrors = optionForm.getFieldErrors(profile.getName());
//                ArrayList<String> result = new ArrayList<String>();
//                result.addAll(Arrays.asList(profileErrors));
//                Map<?,?> errors = event.getErrors();
//                for (Entry<? extends Object, ? extends Object> entrySet : errors.entrySet()) {
//                    StringBuilder sb = new StringBuilder();
//                    Object key = entrySet.getKey();
//                    Object value = entrySet.getValue();
//                    result.add(String.valueOf(key) + " - " + String.valueOf(value));
//                }
//                System.out.println("## onHiddenValidationErrors. origErr: " + profileErrors +
//                        "\n event.err: " + errors + "\n result: " + result);
//                optionForm.setFieldErrors(profile.getName(), result.toArray(new String[result.size()]), true);
//            }
//        });
        return optionForm;
    }
 

开发者ID:proarc,
项目名称:proarc,
代码行数:52,
代码来源:WorkflowNewJobView.java

示例25: PeriodicalIssueForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
public PeriodicalIssueForm(ClientMessages i18n) {
    setWidth100();
    setHeight100();
    setTitleOrientation(TitleOrientation.TOP);
    setNumCols(1);

    ComboBoxItem issueSequenceNumber = new ComboBoxItem(ModsCustomDataSource.FIELD_PER_ISSUE_NUMBER_SORTING,
            i18n.PeriodicalIssueForm_NumberSorting_Title());
    issueSequenceNumber.setRequired(true);
    issueSequenceNumber.setValidators(new StringTrimValidator(), new RegExpValidator(
            "^([1-9]\\d{0,4}(-[1-9]\\d{0,4})?|mimořádné|zvláštní|na ukázku)$"));
    issueSequenceNumber.setValueMap("mimořádné", "na ukázku", "zvláštní");
    issueSequenceNumber.setHideEmptyPickList(true);

    TextItem date = new TextItem(ModsCustomDataSource.FIELD_PER_ISSUE_DATE, i18n.PeriodicalIssueForm_Date_Title());
    date.setRequired(true);
    // issue 43, see https://docs.google.com/document/d/1zSriHPdnUY5d_tKv0M8a6nEym560DKh2H6XZ24tGAEw/edit?pli=1
    // YYYY|YYYY-YYYY|MM.YYYY|MM.-MM.YYYY|DD.MM.YYYY|DD.-DD.MM.YYYY
    // javascript regex ^([1-9]\d{3}(-[1-9]\d{3})?|(1\d|[1-9])\.(-(1\d|[1-9])\.)?[1-9]\d{3}|([123]\d|[1-9])\.(1\d|[1-9])\.(-([123]\d|[1-9])\.(1\d|[1-9])\.)?[1-9]\d{3})$
    date.setValidators(new StringTrimValidator(), new RegExpValidator(
            "^([1-9]\\d{3}(-[1-9]\\d{3})?|(1\\d|[1-9])\\.(-(1\\d|[1-9])\\.)?[1-9]\\d{3}|([123]\\d|[1-9])\\.(1\\d|[1-9])\\.(-([123]\\d|[1-9])\\.(1\\d|[1-9])\\.)?[1-9]\\d{3})$"));

    // identifiers
    final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
            i18n.PeriodicalIssueForm_Identifiers_Title());
    identifiers.setDataSource(IdentifierDataSource.getInstance());
    identifiers.setValidators(
            new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
    DynamicForm identifierForm = new DynamicForm();
    identifierForm.setUseAllDataSourceFields(true);
    identifierForm.setNumCols(4);
    identifiers.setFormPrototype(identifierForm);
    identifiers.setEndRow(true);
    identifiers.setColSpan("2");

    TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PeriodicalIssueForm_Note_Title());
    note.setWidth("*");
    note.setHeight("*");
    note.setColSpan("*");

    setFields(issueSequenceNumber, date, identifiers, note);
}
 

开发者ID:proarc,
项目名称:proarc,
代码行数:43,
代码来源:PeriodicalIssueForm.java

示例26: PageForm

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
/**
     * Create a new form.
     * @param i18n I18N
     * @param typeValueMapId {@link ValueMapDataSource#getOptionDataSource}
     *          reference to bundle with page types.
     */
    public PageForm(ClientMessages i18n, String typeValueMapId) {
        // save on Enter is supposed mainly for ImportBatchItemEditor
        // see submit handler in ModsMultiEditor
        setSaveOnEnter(true);
        setWidth100();
        setHeight100();
        setTitleOrientation(TitleOrientation.TOP);
        SelectItem pageType = new SelectItem(ModsCustomDataSource.FIELD_PAGE_TYPE, i18n.PageForm_PageType_Title());
        pageType.setOptionDataSource(ValueMapDataSource.getInstance().getOptionDataSource(typeValueMapId));
        pageType.setValueField(BundleValue.KEY);
        pageType.setDisplayField(BundleValue.VALUE);
        pageType.setDefaultValue(ModsCustomDataSource.getDefaultPageType());
        pageType.setWidth(200);
        pageType.setEndRow(true);

        IntegerItem pageIndex = new IntegerItem(ModsCustomDataSource.FIELD_PAGE_INDEX);
        pageIndex.setTitle(i18n.PageForm_PageIndex_Title());
        pageIndex.setValidators(new IsIntegerValidator());
        pageIndex.setRequired(true);
        pageIndex.setEndRow(true);

        TextItem pageNumber = new TextItem(ModsCustomDataSource.FIELD_PAGE_NUMBER);
        pageNumber.setTitle(i18n.PageForm_PageNumber_Title());
        pageNumber.setEndRow(true);
        pageNumber.setRequired(true);
        pageNumber.setValidators(new StringTrimValidator());
//        pageNumber.setLength(5);

        final RepeatableFormItem identifiers = new RepeatableFormItem(ModsCustomDataSource.FIELD_IDENTIFIERS,
                i18n.PageForm_Identifiers_Title());
        identifiers.setDataSource(IdentifierDataSource.getInstance());
        identifiers.setRequired(true);
        identifiers.setValidators(
                new IdentifiersValidator(i18n, Arrays.asList(IdentifierDataSource.TYPE_UUID)));
        DynamicForm identifierForm = new DynamicForm();
        identifierForm.setUseAllDataSourceFields(true);
        identifierForm.setNumCols(4);
        identifiers.setFormPrototype(identifierForm);
        identifiers.setEndRow(true);
        identifiers.setColSpan("3");

//        TextAreaItem note = new AutoFitTextAreaItem(ModsCustomDataSource.FIELD_NOTE, "Note");
        TextAreaItem note = new TextAreaItem(ModsCustomDataSource.FIELD_NOTE, i18n.PageForm_Note_Title());
        note.setWidth("*");
        note.setHeight("*");
        note.setColSpan("*");

        setFields(pageType, pageIndex, pageNumber, identifiers, note);

        IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
        integerRangeValidator.setMin(0);
        integerRangeValidator.setMax(Integer.MAX_VALUE);

        pageIndex.setValidators(integerRangeValidator);
    }
 

开发者ID:proarc,
项目名称:proarc,
代码行数:62,
代码来源:PageForm.java

示例27: createPasswordSection

点赞 2

import com.smartgwt.client.types.TitleOrientation; //导入依赖的package包/类
/**
 * Add the change password section
 */
private void createPasswordSection() {

    TitleOrientation titleOrientation = TitleOrientation.TOP;
    String role = UiHelper.getFormattedLabelText("Change Password");
    Label titleRoleLabel = UiHelper.createLabel(role, Alignment.LEFT);
    addMember(titleRoleLabel);
    addMember(getSeparator());

    i_passwordForm = new DynamicForm();
    i_passwordForm.setMargin(10);

    i_passwordForm.setCellPadding(6);
    i_passwordForm.setWidth(WIDTH);
    i_passwordForm.setHeight(100);
    i_passwordForm.setTitleOrientation(titleOrientation);
    i_passwordForm.setAutoFocus(true);
    i_passwordForm.setNumCols(1);
    i_passwordForm.setAlign(Alignment.LEFT);

    i_passwordItem = new PasswordItem("password");
    i_passwordItem.setTitle("Password");
    i_passwordItem.setWidth(WIDGET_WIDTH);
    i_passwordItem.setRequired(true);
    i_passwordItem.setValidators(
            FormValidators.getInstance().getPasswordLengthRangeValidator(), FormValidators
                    .getInstance().getMatchesValidator());

    i_passwordItem2 = new PasswordItem("password2");
    i_passwordItem2.setTitle("Password Confirm");
    i_passwordItem2.setWidth(WIDGET_WIDTH);
    i_passwordItem2.setRequired(true);
    i_passwordItem2.setValidators(FormValidators.getInstance()
            .getPasswordLengthRangeValidator());
    i_passwordItem2.setWrapTitle(false);

    i_passwordForm.setFields(new FormItem[] { i_passwordItem, i_passwordItem2, });

    // add the change pw button
    i_changePwButton = new IButton("Change Password");
    i_changePwButton.setWidth(160);
    i_changePwButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

        @Override
        public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {

            if (i_passwordForm.validate()) {
                changePassword();
            }
        }
    });

    addMember(i_passwordForm);
    HLayout buttonLayout = getButtonLayout();
    buttonLayout.addMember(i_changePwButton);
    addMember(buttonLayout);
}
 

开发者ID:SHARP-HTP,
项目名称:phenotype-portal,
代码行数:60,
代码来源:ProfilePanel.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)