Package com.smartgwt.client.widgets.form.fields

Examples of com.smartgwt.client.widgets.form.fields.TextItem


    public String getName() {
        return MSG.view_bundle_createWizard_provideBundleDistro();
    }

    private DynamicForm createUrlForm() {
        urlTextItem = new TextItem("url", URL_OPTION);
        urlTextItem.setTooltip(URL_OPTION_TOOLTIP);
        urlTextItem.setRequired(false);
        urlTextItem.setShowTitle(false);
        urlTextItem.setWidth(400);
        urlTextItem.setColSpan(4);
        urlUserNameItem = new TextItem("username", URL_OPTION_USERNAME);
        urlUserNameItem.setTooltip(URL_OPTION_TOOLTIP);
        urlUserNameItem.setRequired(false);
        urlUserNameItem.setShowTitle(true);
        urlUserNameItem.setWidth(100);
        urlUserNameItem.setColSpan(1);
View Full Code Here


                    };
                    timer.schedule(500);
                }
            });
        }
        final TextItem resultCountItem = new TextItem("resultCount", MSG.common_title_groupsFound());
        {
            resultCountItem.setCanEdit(false);
            resultCountItem.setWidth("100%");
        }
        final TextItem pageCountItem = new TextItem("pageCount", MSG.common_title_queryPagesParsed());
        {
            pageCountItem.setCanEdit(false);
            pageCountItem.setWidth("100%");
        }
        final TextAreaItem adviceItem = new TextAreaItem("advice", MSG.common_title_suggest());
        {
            adviceItem.setWidth("100%");
            adviceItem.setHeight(20);
            String feedback = MSG.common_val_none();
            adviceItem.setValue(feedback);
            adviceItem.setTooltip(feedback);
            adviceItem.setDisabled(true);
            adviceItem.addChangeHandler(new ChangeHandler() {
                @Override
                public void onChange(ChangeEvent event) {
                    event.cancel();
                    cursorPosition = adviceItem.getSelectionRange()[0];
                }
            });
            adviceItem.addChangedHandler(new ChangedHandler() {

                @Override
                public void onChanged(ChangedEvent event) {
                    adviceItem.setSelectionRange(cursorPosition, cursorPosition);
                }
            });
        }
        //Customize Search component
        {
            searchTextItem.setName(MSG.common_title_search());
            searchTextItem.setTitle(MSG.view_admin_roles_filterResultsBelow());
            searchTextItem.setWidth("100%");
            searchTextItem.setTooltip(MSG.common_msg_typeToFilterResults());
        }
        final FormItemIcon loadingIcon = new FormItemIcon();
        final FormItemIcon successIcon = new FormItemIcon();
        final FormItemIcon failIcon = new FormItemIcon();
        final FormItemIcon attentionIcon = new FormItemIcon();
        String successIconPath = "[SKIN]/actions/ok.png";
        String failedIconPath = "[SKIN]/actions/exclamation.png";
        String loadingIconPath = "[SKIN]/loading.gif";
        String attentionIconPath = "[SKIN]/Dialog/warn.png";
        loadingIcon.setSrc(loadingIconPath);
        successIcon.setSrc(successIconPath);
        failIcon.setSrc(failedIconPath);
        attentionIcon.setSrc(attentionIconPath);

        final StaticTextItem groupQueryStatus = new StaticTextItem();
        {
            groupQueryStatus.setName("groupQueryStatus");
            groupQueryStatus.setTitle(MSG.common_title_queryProgress());
            groupQueryStatus.setDefaultValue(MSG.common_msg_loading());
            groupQueryStatus.setIcons(loadingIcon);
        }
        availableGroupDetails.setItems(resultCountItem, pageCountItem, groupQueryStatus, adviceItem, searchTextItem);

        // Ldap Group Settings region
        final DynamicForm ldapGroupSettings = new DynamicForm();
        {
            ldapGroupSettings.setWidth(groupPanelWidth);
            ldapGroupSettings.setHeight(groupPanelHeight);
            ldapGroupSettings.setGroupTitle(MSG.view_adminRoles_ldapGroupsSettingsReadOnly());
            ldapGroupSettings.setIsGroup(true);
            ldapGroupSettings.setWrapItemTitles(false);
        }
        final TextItem groupSearch = new TextItem("groupSearch", MSG.view_admin_systemSettings_LDAPFilter_name());
        {
            groupSearch.setCanEdit(false);
            groupSearch.setWidth("100%");
        }
        final TextItem groupMember = new TextItem("groupMember", MSG.view_admin_systemSettings_LDAPGroupMember_name());
        {
            groupMember.setCanEdit(false);
            groupMember.setWidth("100%");
        }
        final CheckboxItem groupQueryPagingItem = new CheckboxItem("groupQueryEnable",
            MSG.view_admin_systemSettings_LDAPGroupUsePaging_name());
        {
            groupQueryPagingItem.setCanEdit(false);
            groupQueryPagingItem.setValue(false);
            groupQueryPagingItem.setShowLabel(false);
            groupQueryPagingItem.setShowTitle(true);
            groupQueryPagingItem.setTitleOrientation(TitleOrientation.LEFT);
            //You have to set this attribute
            groupQueryPagingItem.setAttribute("labelAsTitle", true);
        }
        final TextItem groupQueryPagingCountItem = new TextItem("groupQueryCount",
            MSG.view_adminRoles_ldapQueryPageSize());
        {
            groupQueryPagingCountItem.setCanEdit(false);
            groupQueryPagingCountItem.setWidth("100%");
        }
        final CheckboxItem groupUsePosixGroupsItem = new CheckboxItem("groupUsePosixGroups",
            MSG.view_admin_systemSettings_LDAPGroupUsePosixGroup_name());
        {
            groupUsePosixGroupsItem.setCanEdit(false);
            groupUsePosixGroupsItem.setValue(false);
            groupUsePosixGroupsItem.setShowLabel(false);
            groupUsePosixGroupsItem.setShowTitle(true);
            groupUsePosixGroupsItem.setTitleOrientation(TitleOrientation.LEFT);
            //You have to set this attribute
            groupUsePosixGroupsItem.setAttribute("labelAsTitle", true);
        }
        ldapGroupSettings.setItems(groupSearch, groupMember, groupQueryPagingItem, groupQueryPagingCountItem,
            groupUsePosixGroupsItem);

        // orient both panels next to each other
        HLayout panel = new HLayout();
        {
            panel.addMember(availableGroupDetails);
            DynamicForm spacerWrapper = new DynamicForm();
            spacerWrapper.setItems(new SpacerItem());
            panel.addMember(spacerWrapper);
            panel.addMember(ldapGroupSettings);
        }
        availableFilterForm.addChild(panel);

        final long ldapGroupSelectorRequestId = System.currentTimeMillis();

        //launch operations to populate/refresh LDAP Group Query contents.
        final Timer ldapPropertiesTimer = new Timer() {
            public void run() {
                //if system properties not set, launch request/update
                String ldapGroupQuery = groupSearch.getValueAsString();
                if ((ldapGroupQuery == null) || (ldapGroupQuery.trim().isEmpty())) {
                    GWTServiceLookup.getSystemService().getSystemSettings(new AsyncCallback<SystemSettings>() {
                        @Override
                        public void onFailure(Throwable caught) {
                            groupQueryStatus.setIcons(failIcon);
                            groupQueryStatus.setDefaultValue(MSG.view_adminRoles_failLdapGroupsSettings());
                            CoreGUI.getErrorHandler().handleError(MSG.view_adminRoles_failLdapGroupsSettings(), caught);
                            Log.debug(MSG.view_adminRoles_failLdapGroupsSettings());
                        }

                        @Override
                        public void onSuccess(SystemSettings settings) {
                            //retrieve relevant information once and update ui
                            String ldapGroupFilter = settings.get(SystemSetting.LDAP_GROUP_FILTER);
                            String ldapGroupMember = settings.get(SystemSetting.LDAP_GROUP_MEMBER);
                            String ldapGroupPagingEnabled = settings.get(SystemSetting.LDAP_GROUP_PAGING);
                            String ldapGroupPagingValue = settings.get(SystemSetting.LDAP_GROUP_QUERY_PAGE_SIZE);
                            String ldapGroupIsPosix = settings.get(SystemSetting.LDAP_GROUP_USE_POSIX);
                            groupSearch.setValue(ldapGroupFilter);
                            groupMember.setValue(ldapGroupMember);
                            groupQueryPagingItem.setValue(Boolean.valueOf(ldapGroupPagingEnabled));
                            groupQueryPagingCountItem.setValue(ldapGroupPagingValue);
                            groupUsePosixGroupsItem.setValue(Boolean.valueOf(ldapGroupIsPosix));
                            ldapGroupSettings.markForRedraw();
                        }
                    });
                }
View Full Code Here

        } else {
            switch (propDef.getType()) {
            case STRING:
            case FILE:
            case DIRECTORY:
                editorItem = new TextItem();
                break;
            case LONG_STRING:
                editorItem = new TextAreaItem();
                break;
            case PASSWORD:
                editorItem = new PasswordItem();
                editorItem.setAttribute("autocomplete", "off");
                break;
            case BOOLEAN:
                // TODO: we want RadioGroupItem, but smartgwt seems to have a bug and it won't render this when
                //       our listgrid does not have the "unset" boolean field also present. If its just the value
                //       field, the radio group editor won't show.
                // RadioGroupItem radioGroupItem = new RadioGroupItem();
                // radioGroupItem.setVertical(false);
                // editorItem = radioGroupItem;
                editorItem = new SelectItem();
                editorItem.setValueMap(BOOLEAN_PROPERTY_ITEM_VALUE_MAP);
                break;
            case INTEGER:
            case LONG:
                editorItem = new TextItem(); // could not get smartgwt listgrid editing to work with IntegerItem
                break;
            case FLOAT:
            case DOUBLE:
                editorItem = new TextItem(); // could not get smartgwt listgrid editing to work with FloatItem
                break;
            }
        }

        editorItem.setName(MEMBER_VALUES_EDITOR_FIELD_PREFIX + "editor");
View Full Code Here

    @Override
    protected List<FormItem> createFormItems(EnhancedDynamicForm form) {
        List<FormItem> items = new ArrayList<FormItem>();

        TextItem nameItem = new TextItem(RolesDataSource.Field.NAME);
        nameItem.setShowTitle(true);
        nameItem.setSelectOnFocus(true);
        nameItem.setTabIndex(1);
        nameItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(nameItem);

        TextItem descriptionItem = new TextItem(RolesDataSource.Field.DESCRIPTION);
        descriptionItem.setShowTitle(true);
        descriptionItem.setTabIndex(5);
        descriptionItem.setColSpan(form.getNumCols());
        descriptionItem.setAttribute(EnhancedDynamicForm.OUTPUT_AS_HTML_ATTRIBUTE, true);
        items.add(descriptionItem);

        return items;
    }
View Full Code Here

    window.setShowModalMask(true);
   
    window.centerInPage();

   
    TextItem username = new TextItem()
    username.setTitle("Username");
    username.setName("username");
    username.setSelectOnFocus(true);
    //username.focusInItem();
    PasswordItem pass = new PasswordItem();
    pass.setTitle("Password");
    pass.setName("pass");
    form = new DynamicForm();
    form.setFields(username,pass);
    form.setAutoFocus(true)
   
    fillTextsWithCookie(username,pass);
    final CheckboxItem ch_remember = new CheckboxItem()
    ch_remember.setTitle("Remember me");
    ch_remember.setValue(true);
    DynamicForm remember_form = new DynamicForm();
    remember_form.setFields(ch_remember);
   
   
    final HTMLFlow message  = new HTMLFlow();
    //message.setVisible(true);
   
    IButton loginButton = new IButton("Login")
    //loginButton.setSelected(true);
    //loginButton.setLeft(300); 
    loginButton.addClickHandler(new ClickHandler() { 
      public void onClick(ClickEvent event) { 
        final String username = getFieldValue("username").toLowerCase();
        final String pass = getFieldValue("pass");
        if(isAnyEmptyField(username,pass))
          message.setContents("Please do not leave any field empty!");
        else
          systemcall.login(username,pass, new AsyncCallback<Boolean>(){
          public void onSuccess(Boolean success)
          {
            if(!success)
            {
              message.setContents("Failed to login!");
            }else
            {
              if(ch_remember.getValueAsBoolean())
                setLastLoginName(username, pass);
              else{
                if(username.equals(getLastUserName()) && pass.equals(getLastPassword())){
                  removeLastLoginName();
                }
              }
              window.destroy();
            }
          }
          public void onFailure(Throwable t)
          {
            Log.debug("Login->onFailure " + t);
          }
        });
    }

   
    });
   
    IButton createButton = new IButton("Create Account")
    createButton.setLeft(300)
    createButton.addClickHandler(new ClickHandler() { 
      public void onClick(ClickEvent event) { 
        final String username = getFieldValue("username").toLowerCase();
        final String pass = getFieldValue("pass");
        if(isAnyEmptyField(username,pass))
          message.setContents("Please do not leave any field empty!");
        else
          systemcall.createuser(username.toLowerCase(), pass, new AsyncCallback<Boolean>(){
          public void onSuccess(Boolean success)
          {
            Log.debug("Success : " + success);
            if(!success)
            {
              message.setContents("This id already exist. Try another one!");
            }else
            {
              systemcall.login(username.toLowerCase(), pass, new AsyncCallback<Boolean>()
                  {
                    public void onSuccess(Boolean success)
                    {
                      if(!success)
                      {
View Full Code Here

    urlTextBoxAnim = new Canvas();
    urlTextBoxAnim.setWidth100();
    DynamicForm form = new DynamicForm();
    form.setWidth100();

    urlTextBox = new TextItem();
    urlTextBox.setCanEdit(false);
    urlTextBox.setHeight(27);
    urlTextBox.setShowTitle(false);
    urlTextBox.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler(){
      @Override
View Full Code Here

    return button;
  }

  private void drawEndpointAddDialogue() {
    endpointAddForm = new DynamicForm();
    fetchEndpoint = new TextItem();
    fetchEndpoint.setTitle("Endpoint");

    possibleTypes = new LinkedHashMap<String, String>();
    possibleTypes.put("class", "Classses");
    possibleTypes.put("property", "Propperties");
View Full Code Here

    mainWindowLayout = new VLayout();
    mainWindowLayout.setWidth100();
    mainWindowLayout.setHeight100();
    form = new DynamicForm();

    subject = new TextItem();
    subject.setTitle("Subject");
    subject.setRequired(true);
    if (throwable != null) subject.setDefaultValue(throwable.getMessage());
    subject.setWidth(250);
    subject.setTitleOrientation(TitleOrientation.TOP);
View Full Code Here

          public void onClick(ClickEvent event) {
            if (providerContainer.getMembers().length == 2) {//might be added already
              HLayout formLayout = new HLayout();
              DynamicForm form = new DynamicForm()
                 
                  final TextItem textItem = new TextItem();
                  textItem.setHint("http://openIdProvider.org");
                  textItem.setShowHintInField(true);
                  textItem.setWidth(150);
                  textItem.setShowTitle(false);
                  form.setTitleOrientation(TitleOrientation.TOP);
                  form.setItems(textItem);
             
              Button authenticateButton = new Button("submit");
              authenticateButton.setWidth(40);
              authenticateButton.addClickHandler(new ClickHandler(){
                public void onClick(ClickEvent event) {
                  view.getOpenId().login(textItem.getValueAsString());
                }});
              formLayout.addMember(form);
              formLayout.addMember(authenticateButton);
              providerContainer.addMember(formLayout);
            }
View Full Code Here

        form.setAutoFocus(true);
        form.setNumCols(2);
        form.setMargin(10);

        //item with the name of the user
        final TextItem usernameItem = new TextItem("fName");
        usernameItem.setTitle(constants.username());
        usernameItem.setRequired(true);
        usernameItem.setSelectOnFocus(true);
        usernameItem.setWrapTitle(false);
       
        usernameItem.setColSpan(1);
        usernameItem.setStartRow(false);
        usernameItem.setEndRow(true);

        //item with the password of the user
        PasswordItem passwordItem = new PasswordItem("fPassword");
        passwordItem.setTitle(constants.password());
        passwordItem.setRequired(true);
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.fields.TextItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.