Java Code Examples for com.smartgwt.client.widgets.form.fields.TextItem#setWrapTitle()

The following examples show how to use com.smartgwt.client.widgets.form.fields.TextItem#setWrapTitle() . 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: Setup.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Prepares the repository form
 */
private Tab setupRepository(final ValuesManager vm, GUIInfo info) {
	// Prepare the tab used to configure the repository where documents and
	// other data will be stored
	Tab repositoryTab = new Tab();
	repositoryTab.setTitle(I18N.message("repository"));

	final DynamicForm repositoryForm = new DynamicForm();
	repositoryForm.setID("repositoryForm");
	repositoryForm.setValuesManager(vm);
	String dir = info.getConfig("store.1.dir");
	if (dir != null && dir.endsWith("docs"))
		dir = dir.substring(0, dir.length() - 4);
	TextItem repositoryItem = ItemFactory.newTextItem(REPOSITORY_FOLDER, "repofolder",
			dir);
	repositoryItem.setWidth(400);
	repositoryItem.setRequired(true);
	repositoryItem.setWrapTitle(false);
	repositoryItem.setDefaultValue(getDefaultFolder());
	repositoryForm.setFields(repositoryItem);
	repositoryForm.setDisabled(true);

	repositoryTab.setPane(repositoryForm);
	return repositoryTab;
}
 
Example 2
Source File: KeystoreUploader.java    From document-management-software with GNU Lesser General Public License v3.0 6 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 localCAalias = ItemFactory.newSimpleTextItem("localCAalias", "localcaalias",
			keystorePanel.getKeystore() != null ? keystorePanel.getKeystore().getOrganizationAlias() : null);
	localCAalias.setRequired(true);
	localCAalias.setSelectOnFocus(true);
	localCAalias.setWrapTitle(false);

	TextItem password = ItemFactory.newPasswordItem("password", "keystorepasswd",
			keystorePanel.getKeystore() != null ? keystorePanel.getKeystore().getPassword() : null);
	password.setRequired(false);
	password.setWrapTitle(false);

	form.setItems(localCAalias, password);
}
 
Example 3
Source File: ItemFactory.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static TextItem newEmailItem(String name, String title, boolean multiple) {
	TextItem item = new TextItem();
	item.setName(filterItemName(name));
	if (title != null)
		item.setTitle(I18N.message(title));
	else
		item.setShowTitle(false);
	if (multiple)
		item.setValidators(new EmailsValidator());
	else
		item.setValidators(new EmailValidator());
	item.setWrapTitle(false);
	item.setWidth(200);

	return item;
}
 
Example 4
Source File: Setup.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Prepares the registration form
 */
private Tab setupRegistration(final ValuesManager vm) {
	Tab registrationTab = new Tab();
	registrationTab.setTitle(I18N.message("registration"));

	TextItem regName = ItemFactory.newTextItem(REG_NAME, "name", null);
	regName.setWrapTitle(false);
	regName.setWidth(300);

	TextItem regOrganization = ItemFactory.newTextItem(REG_ORGANIZATION, "organization", null);
	regOrganization.setWrapTitle(false);
	regOrganization.setWidth(300);

	TextItem regWebsite = ItemFactory.newTextItem(REG_WEBSITE, "website", null);
	regWebsite.setWrapTitle(false);
	regWebsite.setWidth(300);

	TextItem regEmail = ItemFactory.newEmailItem(REG_EMAIL, "email", false);
	regEmail.setWrapTitle(false);
	regEmail.setWidth(300);

	SelectItem languageItem = ItemFactory.newLanguageSelector(LANGUAGE, false, true);
	languageItem.setTitle(I18N.message("language"));
	languageItem.setRequired(true);

	final DynamicForm regForm = new DynamicForm();
	regForm.setID("regForm");
	regForm.setValuesManager(vm);
	regForm.setFields(languageItem, regName, regEmail, regOrganization, regWebsite);

	registrationTab.setPane(regForm);
	return registrationTab;
}
 
Example 5
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 TextItem.
 * 
 * @param name The item name (mandatory)
 * @param title The item title (mandatory)
 * @param value The item value (optional)
 * 
 * @return the text item
 */
public static TextItem newTextItem(String name, String title, String value) {
	TextItem item = new TextItem();
	item.setName(filterItemName(name));
	item.setTitle(I18N.message(title));
	if (value != null)
		item.setValue(value);
	else
		item.setValue("");
	item.setWrapTitle(false);
	item.setRequiredMessage(I18N.message("fieldrequired"));
	return item;
}
 
Example 6
Source File: Registration.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public Registration(String[] reg) {
	super();

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("registration"));
	setWidth(350);
	setHeight(150);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);

	final DynamicForm form = new DynamicForm();
	form.setValuesManager(vm);
	form.setMargin(5);
	form.setNumCols(2);
	form.setTitleOrientation(TitleOrientation.TOP);

	TextItem regName = ItemFactory.newTextItem("reg_name", "name", null);
	regName.setWrapTitle(false);
	regName.setValue(reg[0]);

	TextItem regEmail = ItemFactory.newEmailItem("reg_email", "email", false);
	regEmail.setWrapTitle(false);
	regEmail.setValue(reg[1]);

	TextItem regOrganization = ItemFactory.newTextItem("reg_organization", "organization", null);
	regOrganization.setWrapTitle(false);
	regOrganization.setValue(reg[2]);

	TextItem regWebsite = ItemFactory.newTextItem("reg_website", "website", null);
	regWebsite.setWidth(180);
	regWebsite.setWrapTitle(false);
	regWebsite.setValue(reg[3]);

	ButtonItem apply = new ButtonItem();
	apply.setTitle(I18N.message("apply"));
	apply.setAutoFit(true);
	apply.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			vm.validate();
			if (!vm.hasErrors()) {
				SettingService.Instance.get().saveRegistration(form.getValueAsString("reg_name"),
						form.getValueAsString("reg_email"), form.getValueAsString("reg_organization"),
						form.getValueAsString("reg_website"), new AsyncCallback<Void>() {
							@Override
							public void onFailure(Throwable caught) {
								SC.warn(caught.getMessage());
							}

							@Override
							public void onSuccess(Void ret) {
								afterSave();
								Registration.this.destroy();
							}
						});
			}
		}
	});

	form.setFields(regName, regEmail, regOrganization, regWebsite, apply);

	addItem(form);
}
 
Example 7
Source File: SignatureDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public SignatureDialog(long[] docIds) {
	super();

	this.docIds = docIds;

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

	VLayout layout = new VLayout();
	layout.setWidth100();
	layout.setHeight(40);

	form.setValuesManager(vm);
	form.setWrapItemTitles(false);
	form.setTitleOrientation(TitleOrientation.TOP);
	form.setNumCols(2);

	TextItem reason = ItemFactory.newTextItem("reason", "reason", null);
	reason.setRequired(true);
	reason.setWrapTitle(false);
	reason.setWidth(250);
	reason.setAutoComplete(AutoComplete.NONE);

	visualPositioning = new CheckboxItem();
	visualPositioning.setName("visualpositioning");
	visualPositioning.setTitle(I18N.message("visualpositioning"));
	visualPositioning.setDisabled(true);

	form.setItems(reason, visualPositioning);

	IButton sign = new IButton(I18N.message("sign"));
	sign.setAutoFit(true);
	sign.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			onSign();
		}
	});

	HLayout buttons = new HLayout();
	buttons.setMembersMargin(5);
	buttons.setMargin(3);
	buttons.addMember(sign);

	layout.addMember(form);
	layout.addMember(buttons);

	addItem(layout);

	SignService.Instance.get().isVisualSignatureEnabled(new AsyncCallback<Boolean>() {

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

		@Override
		public void onSuccess(Boolean enabled) {
			visualPositioning.setDisabled(!enabled);
		}
	});
}