Java Code Examples for com.smartgwt.client.widgets.form.fields.StaticTextItem#setShowTitle()

The following examples show how to use com.smartgwt.client.widgets.form.fields.StaticTextItem#setShowTitle() . 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: 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 2
Source File: SystemMenu.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void addInformations() {
	DynamicForm form1 = new DynamicForm();
	form1.setWidth(300);
	form1.setColWidths(1, "*");

	StaticTextItem productName = ItemFactory.newStaticTextItem("productName", "",
			"<b>" + Session.get().getInfo().getBranding().getProductName() + "</b>");
	productName.setShouldSaveValue(false);
	productName.setShowTitle(false);
	productName.setWrapTitle(false);
	productName.setWrap(false);
	productName.setEndRow(true);

	StaticTextItem version = ItemFactory.newStaticTextItem("version", "",
			I18N.message("version") + " " + Session.get().getInfo().getRelease());
	version.setShouldSaveValue(false);
	version.setShowTitle(false);
	version.setWrap(false);
	version.setEndRow(true);

	StaticTextItem vendor = ItemFactory.newStaticTextItem("vendor", "",
			"&copy; " + Session.get().getInfo().getBranding().getVendor());
	vendor.setShouldSaveValue(false);
	vendor.setShowTitle(false);
	vendor.setEndRow(true);

	String userno = Session.get().getInfo().getUserNo();
	String installationId = Session.get().getInfo().getInstallationId();

	DynamicForm form2 = new DynamicForm();
	form2.setAlign(Alignment.LEFT);
	form2.setTitleOrientation(TitleOrientation.TOP);
	form2.setColWidths(1);
	form2.setWrapItemTitles(false);
	form2.setNumCols(1);

	LinkItem support = new LinkItem();
	support.setName(I18N.message("support"));
	support.setLinkTitle(Session.get().getInfo().getBranding().getSupport());

	String mailTo = "mailto:" + Session.get().getInfo().getBranding().getSupport() + "?subject="
			+ Session.get().getInfo().getBranding().getProductName() + " Support - ";
	if (userno != null)
		mailTo += "UserNo(" + userno + ")";
	else
		mailTo += "ID(" + Session.get().getInfo().getInstallationId() + ")";
	support.setValue(mailTo);
	support.setRequired(true);
	support.setShouldSaveValue(false);

	StaticTextItem installationID = ItemFactory.newStaticTextItem("installid", "installid", installationId);
	installationID.setWidth(250);
	installationID.setRequired(true);
	installationID.setShouldSaveValue(false);
	installationID.setWrap(true);
	installationID.setWrapTitle(false);

	StaticTextItem usernoItem = ItemFactory.newStaticTextItem("userno", "userno", userno);
	usernoItem.setWidth(250);
	usernoItem.setRequired(true);
	usernoItem.setShouldSaveValue(false);
	usernoItem.setWrap(true);
	usernoItem.setWrapTitle(false);

	StaticTextItem hostName = ItemFactory.newStaticTextItem("hostname", "hostname",
			Session.get().getInfo().getHostName());
	hostName.setWidth(250);
	hostName.setRequired(true);
	hostName.setShouldSaveValue(false);
	hostName.setWrap(true);
	hostName.setWrapTitle(false);
	hostName.setVisible(!Session.get().isDemo());

	form1.setItems(productName, version, vendor);

	if (userno != null)
		form2.setItems(support, usernoItem, installationID, hostName);
	else
		form2.setItems(support, installationID, hostName);

	if (!Session.get().isDemo()) {
		addMember(form1);
		addMember(form2);
	}
}
 
Example 3
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;
}