com.smartgwt.client.widgets.form.fields.TextAreaItem Java Examples

The following examples show how to use com.smartgwt.client.widgets.form.fields.TextAreaItem. 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: WorkflowMaterialView.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private DynamicForm createPhysicalDocumentForm() {
    DynamicForm form = createExpansionForm();
    TextAreaItem xml = new TextAreaItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_METADATA);
    xml.setWidth("*");
    form.setDataSource(WorkflowMaterialDataSource.getInstance(),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_CATALOG),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_BARCODE),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_FIELD001),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_SIGLA),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_SIGNATURE),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_DETAIL),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_ISSUE),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_VOLUME),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_YEAR),
            new TextItem(WorkflowMaterialDataSource.FIELD_PHYSICAL_RDCZID),
            createNoteItem(),
            xml,
            createSaveItem());
    return form;
}
 
Example #2
Source File: AttributeSetPropertiesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void addMetadata() {
	form1 = new DynamicForm();
	form1.setNumCols(1);
	form1.setValuesManager(vm);
	form1.setTitleOrientation(TitleOrientation.LEFT);

	StaticTextItem id = ItemFactory.newStaticTextItem("id", "id", Long.toString(attributeSet.getId()));
	id.setDisabled(true);

	TextItem name = ItemFactory.newSimpleTextItem("name", I18N.message("name"), attributeSet.getName());
	name.setRequired(true);
	name.setDisabled(attributeSet.isReadonly());
	if (!attributeSet.isReadonly())
		name.addChangedHandler(changedHandler);

	TextAreaItem description = ItemFactory.newTextAreaItem("description", "description",
			attributeSet.getDescription());
	description.setDisabled(attributeSet.isReadonly());

	if (!attributeSet.isReadonly())
		description.addChangedHandler(changedHandler);

	form1.setItems(id, name, description);

	form1.setWidth(200);
}
 
Example #3
Source File: AutomationDialog.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
private Tab prepareScriptTab() {
	scriptForm = new DynamicForm();
	scriptForm.setWidth100();
	scriptForm.setHeight100();
	scriptForm.setTitleOrientation(TitleOrientation.TOP);
	scriptForm.setNumCols(1);

	final TextAreaItem automation = ItemFactory.newTextAreaItemForAutomation("automation", "automation", null, null,
			false);
	automation.setShowTitle(false);
	automation.setStartRow(false);
	automation.setRequired(true);
	automation.setWidth("*");
	automation.setHeight("*");
	scriptForm.setItems(automation);

	Tab tab = new Tab(I18N.message("script"));
	tab.setPane(scriptForm);
	return tab;
}
 
Example #4
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 #5
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 #6
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static TextAreaItem newTextAreaItemForAutomation(String name, String title, String value,
		ChangedHandler handler, boolean withHtmlEditor) {
	TextAreaItem item = newTextAreaItem(name, title, value);
	appendAutomationEditorIcon(item, handler, withHtmlEditor);
	if (handler != null)
		item.addChangedHandler(handler);
	return item;
}
 
Example #7
Source File: PeriodicalVolumeForm.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #8
Source File: MonographUnitForm.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #9
Source File: WorkflowTaskFormView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private FormItem createFormItem(DisplayType displayType, Record profile) {
    String name = profile.getAttribute(WorkflowParameterDataSource.FIELD_NAME);
    switch (displayType) {
        case SELECT:
            SelectItem si = new SelectItem();
            setOptions(si, profile);
            si.setWidth("*");
            return si;
        case COMBOBOX:
            ComboBoxItem cbi = new ComboBoxItem();
            setOptions(cbi, profile);
            cbi.setLength(2000);
            cbi.setWidth("*");
            return cbi;
        case CHECKBOX:
            CheckboxItem ci = new CheckboxItem();
            // the width must be set otherwise it overflows the form
            ci.setWidth(150);
            ci.setAllowEmptyValue(true);
            return ci;
        case TEXTAREA:
            TextAreaItem tai = new TextAreaItem();
            tai.setStartRow(true);
            tai.setEndRow(true);
            tai.setLength(2000);
            tai.setColSpan("*");
            tai.setWidth("*");
            tai.setHeight(30);
            return tai;
        case DATETIME:
            DateTimeItem di = new DateTimeItem();
            return di;
        case TEXT:
        default:
            TextItem ti = new TextItem(name);
            ti.setLength(2000);
            ti.setWidth("*");
            return ti;
    }
}
 
Example #10
Source File: TextEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DynamicForm createForm(TextDataSource dataSource) {
    DynamicForm form = new DynamicForm();
    form.setDataSource(dataSource);
    form.setWidth100();
    form.setHeight100();
    TextAreaItem textAreaItem = new TextAreaItem(TextDataSource.FIELD_CONTENT);
    textAreaItem.setColSpan("*");
    textAreaItem.setHeight("*");
    textAreaItem.setWrap(TextAreaWrap.OFF);
    textAreaItem.setShowTitle(false);
    textAreaItem.setWidth("*");
    form.setFields(textAreaItem);
    return form;
}
 
Example #11
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new TextAreaItem
 * 
 * @param name The item name (mandatory)
 * @param title The item title (mandatory)
 * @param value The item value (optional)
 * 
 * @return the new item
 */
public static TextAreaItem newTextAreaItem(String name, String title, String value) {
	TextAreaItem item = new TextAreaItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message(title));
	item.setHeight("*");
	if (value != null)
		item.setValue(value);
	else
		item.setValue("");
	return item;
}
 
Example #12
Source File: PatchPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void displayNotes(String fileName) {
	UpdateService.Instance.get().getPatchNotes(fileName, new AsyncCallback<String[]>() {

		@Override
		public void onFailure(Throwable caught) {
			Log.serverError(caught);
		}

		@Override
		public void onSuccess(String[] infos) {
			DynamicForm form = new DynamicForm();
			form.setTitleOrientation(TitleOrientation.TOP);
			form.setColWidths("*");
			form.setNumCols(1);

			TextAreaItem changelog = ItemFactory.newTextAreaItem("changelog", "changelog", infos[0]);
			changelog.setWidth("100%");
			changelog.setHeight(220);

			TextAreaItem patchNotes = ItemFactory.newTextAreaItem("patchnotes", "patchnotes", infos[1]);
			patchNotes.setWidth("100%");
			patchNotes.setHeight(220);

			form.setItems(patchNotes, changelog);

			notesPanel.addMember(form);
		}
	});
}
 
Example #13
Source File: UpdatePanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void displayNotes(String fileName) {
	UpdateService.Instance.get().getUpdateNotes(fileName, new AsyncCallback<String[]>() {

		@Override
		public void onFailure(Throwable caught) {
			Log.serverError(caught);
		}

		@Override
		public void onSuccess(String[] infos) {
			DynamicForm form = new DynamicForm();
			form.setTitleOrientation(TitleOrientation.TOP);
			form.setColWidths("*");
			form.setNumCols(1);

			TextAreaItem changelog = ItemFactory.newTextAreaItem("changelog", "changelog", infos[0]);
			changelog.setWidth("100%");
			changelog.setHeight(220);

			TextAreaItem updatenotes = ItemFactory.newTextAreaItem("updatenotes", "updatenotes", infos[1]);
			updatenotes.setWidth("100%");
			updatenotes.setHeight(220);

			form.setItems(updatenotes, changelog);

			notesPanel.addMember(form);
		}
	});
}
 
Example #14
Source File: SearchIndexCheckStatus.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public SearchIndexCheckStatus(String result) {
	super();
	
	setWidth100();
	setHeight100();

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("checkfulltextindex"));
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();


	final DynamicForm form = new DynamicForm();
	form.setHeight100();
	form.setWidth100();
	form.setTitleOrientation(TitleOrientation.TOP);

	final TextAreaItem status = new TextAreaItem();
	status.setWidth(700);
	status.setHeight("100%");
	status.setValue(result);
	status.setShowTitle(false);

	form.setFields(status);
	addItem(form);
}
 
Example #15
Source File: AutomationRoutineProperties.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void refresh() {
	vm.clearValues();
	vm.clearErrors(false);

	if (formsContainer.getMembers() != null)
		formsContainer.removeMembers(formsContainer.getMembers());

	DynamicForm form2 = new DynamicForm();
	form2.setWidth100();
	form2.setTitleOrientation(TitleOrientation.TOP);
	form2.setValuesManager(vm);
	form2.setNumCols(1);

	final TextAreaItem automation = ItemFactory.newTextAreaItemForAutomation("automation", "automation",
			routine.getAutomation(), changedHandler, false);
	automation.setStartRow(false);
	automation.setRequired(true);
	automation.setWidth("*");

	form2.setItems(automation);

	DynamicForm form1 = new DynamicForm();
	form1.setNumCols(1);
	form1.setTitleOrientation(TitleOrientation.TOP);
	form1.setValuesManager(vm);

	TextItem name = ItemFactory.newSimpleTextItem("name", I18N.message("name"), routine.getName());
	name.addChangedHandler(changedHandler);
	name.setDisabled(routine.getId() != 0L);

	TextItem description = ItemFactory.newTextItem("description", I18N.message("description"),
			routine.getDescription());
	description.addChangedHandler(changedHandler);
	description.setWidth(200);

	form1.setItems(name, description);

	formsContainer.setMembers(form1, form2);
}
 
Example #16
Source File: BarcodeTemplateSettings.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void prepareForm() {
	form = new DynamicForm();
	form.setWidth100();
	form.setAlign(Alignment.LEFT);
	form.setColWidths("1px, 100%");
	vm = new ValuesManager();
	form.setValuesManager(vm);

	TextItem name = ItemFactory.newTextItem("name", "name", template.getName());
	name.setRequired(true);
	name.setDisabled(template.getId() != 0L);

	StaticTextItem id = ItemFactory.newStaticTextItem("id", I18N.message("id"), "" + template.getId());
	id.setVisible(template != null && template.getId() != 0L);

	TextAreaItem description = ItemFactory.newTextAreaItem("description", "description", template.getDescription());
	description.setHeight(200);

	// The optional batch
	SpinnerItem batch = ItemFactory.newSpinnerItem("batch", "batch", template.getBatch());
	batch.setRequired(true);
	batch.setMin(1);
	batch.setStep(10);
	batch.setHintStyle("hint");

	// The image threshold
	SpinnerItem resolutionThreshold = ItemFactory.newSpinnerItem("resolutionthreshold",
			I18N.message("resolutionthreshold"), template.getImageThreshold());
	resolutionThreshold.setRequired(true);
	resolutionThreshold.setWrapTitle(false);
	resolutionThreshold.setMin(50);
	resolutionThreshold.setStep(100);
	resolutionThreshold.setHint("pixels");

	if (Session.get().isDefaultTenant() && template.getId() != 0L)
		form.setItems(id, name, description, batch, resolutionThreshold);
	else
		form.setItems(id, name, description);
}
 
Example #17
Source File: ZonalOCRTemplateSettings.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void prepareForm() {
	form = new DynamicForm();
	form.setWidth100();
	form.setAlign(Alignment.LEFT);
	form.setColWidths("1px, 100%");
	vm = new ValuesManager();
	form.setValuesManager(vm);

	final StaticTextItem fileNameWaring = ItemFactory.newStaticTextItem("fileNameWarning",
			I18N.message("attention"), I18N.message("filenamewarning"));
	fileNameWaring.setRequired(true);

	TextItem name = ItemFactory.newTextItem("name", "name", ocrPanel.getSelectedOcrTemplate().getName());
	name.setRequired(true);
	name.setDisabled(ocrPanel.getSelectedOcrTemplate().getId() != 0L);

	StaticTextItem id = ItemFactory.newStaticTextItem("id", I18N.message("id"),
			"" + ocrPanel.getSelectedOcrTemplate().getId());
	id.setVisible(ocrPanel.getSelectedOcrTemplate().getId() != 0L);

	SpinnerItem batch = ItemFactory.newSpinnerItem("batch", "batch",
			Session.get().getConfigAsInt("zonalocr.batch"));
	batch.setStep(50);
	batch.setMin(1);

	TextAreaItem description = ItemFactory.newTextAreaItem("description", "description",
			ocrPanel.getSelectedOcrTemplate().getDescription());
	description.setHeight(200);

	if (Session.get().isDefaultTenant())
		form.setItems(id, name, description, batch);
	else
		form.setItems(id, name, description);
}
 
Example #18
Source File: TaskEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private VLayout prepareAutomationPanel() {
	VLayout automationPanel = new VLayout();
	automationPanel.setWidth100();
	automationPanel.setHeight100();

	DynamicForm automationForm = new DynamicForm();
	automationForm.setTitleOrientation(TitleOrientation.TOP);
	automationForm.setNumCols(1);
	automationForm.setValuesManager(vm);

	TextAreaItem onCreation = ItemFactory.newTextAreaItemForAutomation("onCreation",
			state.getType() == GUIWFState.TYPE_TASK ? "execscriptontaskreached" : "execscriptonenstatusreached",
			state.getOnCreation(), null, false);
	onCreation.setWidth("*");
	onCreation.setHeight(200);
	onCreation.setWrapTitle(false);

	TextAreaItem onAssignment = ItemFactory.newTextAreaItemForAutomation("onAssignment",
			"execscriptontaskassignment", state.getOnAssignment(), null, false);
	onAssignment.setWidth("*");
	onAssignment.setHeight(200);
	onAssignment.setWrapTitle(false);

	if (state.getType() == GUIWFState.TYPE_TASK)
		automationForm.setItems(onCreation, onAssignment);
	else {
		onCreation.setHeight(400);
		automationForm.setItems(onCreation);
	}

	automationPanel.addMember(automationForm);

	return automationPanel;
}
 
Example #19
Source File: FirewallPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void init() {
	form = new DynamicForm();
	form.setValuesManager(vm);
	form.setTitleOrientation(TitleOrientation.TOP);
	if (user != null)
		form.setNumCols(2);
	else
		form.setNumCols(1);
	final TextAreaItem whitelist = ItemFactory.newTextAreaItem("whitelist", "whitelist", null);
	whitelist.setHeight(120);
	whitelist.setWidth(350);
	whitelist.setHint(I18N.message("blacklisthint"));
	if (changedHandler != null)
		whitelist.addChangedHandler(changedHandler);
	if (Session.get().isDemo())
		whitelist.setDisabled(true);

	final TextAreaItem blacklist = ItemFactory.newTextAreaItem("blacklist", "blacklist", null);
	blacklist.setHeight(120);
	blacklist.setWidth(350);
	blacklist.setHint(I18N.message("blacklisthint"));
	if (changedHandler != null)
		blacklist.addChangedHandler(changedHandler);
	if (Session.get().isDemo())
		blacklist.setDisabled(true);

	form.setItems(whitelist, blacklist);

	if (user == null) {
		/*
		 * We are operating on general filters
		 */
		SettingService.Instance.get().loadSettingsByNames(
				new String[] { "firewall.whitelist", "firewall.blacklist" }, new AsyncCallback<GUIParameter[]>() {
					@Override
					public void onFailure(Throwable caught) {
						Log.serverError(caught);
					}

					@Override
					public void onSuccess(GUIParameter[] params) {
						whitelist.setValue(params[0].getValue().replace(',', '\n'));
						blacklist.setValue(params[1].getValue().replace(',', '\n'));
					}
				});
	} else {
		/*
		 * We are operating on user's specific filters
		 */
		whitelist.setValue(user.getIpWhitelist() != null ? user.getIpWhitelist().replace(',', '\n') : "");
		blacklist.setValue(user.getIpBlacklist() != null ? user.getIpBlacklist().replace(',', '\n') : "");
	}
}
 
Example #20
Source File: AutomationTriggerProperties.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void refresh() {
	vm.clearValues();
	vm.clearErrors(false);

	if (formsContainer.getMembers() != null)
		formsContainer.removeMembers(formsContainer.getMembers());

	DynamicForm form2 = new DynamicForm();
	form2.setWidth100();
	form2.setTitleOrientation(TitleOrientation.TOP);
	form2.setValuesManager(vm);
	form2.setNumCols(1);

	final TextAreaItem automation = ItemFactory.newTextAreaItemForAutomation("automation", "automation",
			trigger.getAutomation(), changedHandler, false);
	automation.setStartRow(false);
	automation.setWidth("*");
	automation.setDisabled(trigger.getRoutine()!=null);
	
	form2.setItems(automation);
	
	DynamicForm form1 = new DynamicForm();
	form1.setNumCols(2);
	form1.setTitleOrientation(TitleOrientation.TOP);
	form1.setValuesManager(vm);
	form1.setHeight100();

	SelectItem events = ItemFactory.newEventsSelector("events", I18N.message("triggeron"), changedHandler, true, true,
			true);
	events.setRowSpan(3);
	events.setValues(trigger.getEventsArray());

	SpacerItem spacer = new SpacerItem();
	spacer.setHeight(100);

	SelectItem routine = ItemFactory.newAutomationRoutineSelector("routine",
			trigger.getRoutine() != null ? trigger.getRoutine().getId() : null, changedHandler, true);
	routine.setEndRow(true);
	routine.addChangedHandler(changedHandler);
	ChangedHandler cngHandler = new ChangedHandler() {
		@Override
		public void onChanged(ChangedEvent event) {
			if (event == null) {
				automation.setDisabled(false);
			} else {
				automation.setDisabled(event.getValue() != null && !event.getValue().toString().isEmpty());
			}
		}
	};
	routine.addChangedHandler(cngHandler);
	
	form1.setItems(events, folderSelector, routine, spacer);

	formsContainer.setMembers(form1, form2);
}
 
Example #21
Source File: FormGenerator.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public TextAreaItem getTextAreaFormItem(Field f, String lang) {
    TextAreaItem item = new TextAreaItem(f.getName(), f.getTitle(activeLocale));
    item.setLength(f.getLength());
    item.setWidth(defaultWidth);
    return item;
}
 
Example #22
Source File: WorkflowTaskFormView.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
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;
}
 
Example #23
Source File: TemplatePropertiesPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
protected void prepareTemplateForm() {
	templateForm = new DynamicForm();
	templateForm.setNumCols(1);
	templateForm.setValuesManager(vm);
	templateForm.setTitleOrientation(TitleOrientation.LEFT);

	StaticTextItem id = ItemFactory.newStaticTextItem("id", "id", Long.toString(template.getId()));
	id.setDisabled(true);

	TextItem name = ItemFactory.newSimpleTextItem("name", I18N.message("name"), template.getName());
	name.setRequired(true);
	name.setDisabled(template.isReadonly());
	if (!template.isReadonly())
		name.addChangedHandler(changedHandler);

	TextAreaItem description = ItemFactory.newTextAreaItem("description", "description", template.getDescription());
	description.setDisabled(template.isReadonly());

	PickerIcon computeStat = new PickerIcon(PickerIconName.REFRESH, new FormItemClickHandler() {
		public void onFormItemClick(final FormItemIconClickEvent event) {
			event.getItem().setValue(I18N.message("computing") + "...");
			TemplateService.Instance.get().countDocuments(template.getId(), new AsyncCallback<Long>() {

				@Override
				public void onFailure(Throwable caught) {
					Log.serverError(caught);
				}

				@Override
				public void onSuccess(Long count) {
					event.getItem().setValue(Util.formatLong(count));
				}
			});
		}
	});
	computeStat.setPrompt(I18N.message("calculatestats"));

	StaticTextItem docs = ItemFactory.newStaticTextItem("docs", "documents", "-");
	docs.setIconHSpace(2);
	docs.setIconWidth(16);
	docs.setIconHeight(16);
	docs.setIcons(computeStat);
	docs.setWidth("1%");

	if (!template.isReadonly())
		description.addChangedHandler(changedHandler);

	templateForm.setItems(id, name, description, docs);

	container.addMember(templateForm);
}
 
Example #24
Source File: NdkAudioPageForm.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
/**
     * Create a new form.
     * @param i18n I18N
     * @param typeValueMapId {@link ValueMapDataSource#getOptionDataSource}
     *          reference to bundle with page types.
     */
    public NdkAudioPageForm(ClientMessages i18n, String typeValueMapId) {
        // save on Enter is supposed mainly for ImportBatchItemEditor
        // see submit handler in ModsMultiEditor
        setSaveOnEnter(true);
        setWidth100();
        setHeight100();
        setTitleOrientation(TitleOrientation.TOP);

        TextItem pageType = new TextItem(ModsCustomDataSource.FIELD_PAGE_TYPE);
        pageType.setTitle(i18n.PageForm_PageType_Title());
        pageType.setEndRow(true);
        pageType.setRequired(true);
        pageType.setReadOnly();
        pageType.disable();

        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("*");
        //https://github.com/proarc/proarc/issues/645 GWT v.6.0-p20161023 form draw issue
        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);
    }
 
Example #25
Source File: PeriodicalIssueForm.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
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);
}
 
Example #26
Source File: PageForm.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
/**
     * 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("*");
        //https://github.com/proarc/proarc/issues/645 GWT v.6.0-p20161023 form draw issue
        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);
    }