Package com.sencha.gxt.widget.core.client.form

Examples of com.sencha.gxt.widget.core.client.form.TextField


      VerticalLayoutContainer rightContainer = new VerticalLayoutContainer();
      layoutContainer
          .add(leftContainer, new HorizontalLayoutData(300, 1));
      layoutContainer.add(rightContainer);

      baseName = new TextField();
      baseName.setWidth(150);

      baseDesc = new TextArea();
      baseDesc.setWidth(150);
      baseDesc.setHeight(36);

      ListStore<String> scheduleTypeStore = new ListStore<String>(
          new ModelKeyProvider<String>() {
            @Override
            public String getKey(final String item) {
              return item;
            }
          });
      scheduleTypeStore.add(JobModel.INDEPEN_JOB);
      scheduleTypeStore.add(JobModel.DEPEND_JOB);
      baseScheduleType = new ComboBox<String>(scheduleTypeStore,
          new LabelProvider<String>() {
            @Override
            public String getLabel(final String item) {
              return item;
            }
          });
      baseScheduleType.setWidth(150);
      baseScheduleType.setTriggerAction(TriggerAction.ALL);
      baseScheduleType.setAllowBlank(false);
      baseScheduleType.setEditable(false);
      baseScheduleType
          .addValueChangeHandler(new ValueChangeHandler<String>() {
            @Override
            public void onValueChange(
                final ValueChangeEvent<String> event) {
              if (event.getValue().equals(JobModel.INDEPEN_JOB)) {
                cronWapper.show();
                baseCron.setAllowBlank(false);
                depCycleWapper.hide();
                depJobsWapper.hide();
                baseDepJobs.setAllowBlank(true);
              } else if (event.getValue().equals(
                  JobModel.DEPEND_JOB)) {
                cronWapper.hide();
                baseCron.setAllowBlank(true);
                depCycleWapper.show();
                depJobsWapper.show();
                baseDepJobs.setAllowBlank(false);
              }
            }
          });
      baseCron = new TextField();
      baseCron.setWidth(150);
      baseDepJobs = new TextField();
      baseDepJobs.setWidth(150);
      baseDepJobs.setReadOnly(true);
      baseDepJobs.addHandler(new ClickHandler() {
        @Override
        public void onClick(final ClickEvent event) {
          final CheckableJobTree tree = new CheckableJobTree();
          tree.setSelectHandler(new SelectHandler() {
            @Override
            public void onSelect(final SelectEvent event) {
              List<GroupJobTreeModel> list = tree.getTree()
                  .getCheckedSelection();// .getSelectionModel().getSelectedItems();
              String result = "";
              for (GroupJobTreeModel m : list) {
                if (m.isJob()) {
                  result += m.getId() + ",";
                }
              }
              if (result.endsWith(",")) {
                result = result.substring(0,
                    result.length() - 1);
              }
              baseDepJobs.setValue(result.toString(), true);
              baseDepJobs.validate();
            }
          });
          tree.show();
          tree.refresh(new Callback(){
            @Override
            public void callback() {
              tree.init(baseDepJobs.getValue());
            }
          });
        }
      }, ClickEvent.getType());
      ListStore<Map<String, String>> cycleStore = new ListStore<Map<String, String>>(
          new ModelKeyProvider<Map<String, String>>() {
            @Override
            public String getKey(final Map<String, String> item) {
              return item.get("key");
            }
          });
      Map<String, String> sameday = new HashMap<String, String>();
      sameday.put("key", "同一天");
      sameday.put("value", "sameday");
      Map<String, String> nolimit = new HashMap<String, String>();
      nolimit.put("key", "无限制");
      nolimit.put("value", " ");
      cycleStore.add(nolimit);
      cycleStore.add(sameday);
      baseDepCycle = new ComboBox<Map<String, String>>(cycleStore,
          new LabelProvider<Map<String, String>>() {
            @Override
            public String getLabel(final Map<String, String> item) {
              return item.get("key");
            }
          }, new AbstractSafeHtmlRenderer<Map<String, String>>() {
            @Override
            public SafeHtml render(final Map<String, String> object) {
              ComboBoxTemplates t = GWT
                  .create(ComboBoxTemplates.class);
              return t.display(object.get("key"));
            }

          });
      baseDepCycle.setWidth(150);
      baseDepCycle.setTriggerAction(TriggerAction.ALL);
      baseDepCycle.setEditable(false);
      baseMain = new TextField();
      baseMain.setWidth(150);

      depCycleWapper = new FieldLabel(baseDepCycle, "依赖周期");
      depJobsWapper = new FieldLabel(baseDepJobs, "依赖任务");
      cronWapper = new FieldLabel(baseCron, "定时表达式");
View Full Code Here


  public CardAddGroup(GroupPresenter presenter) {
    this.presenter=presenter;
    panel = new FormPanel();
    VerticalLayoutContainer p = new VerticalLayoutContainer();
    panel.add(p,new MarginData(5));
    name = new TextField();
    name.setToolTipConfig(new ToolTipConfig("组名称", "必填,可修改"){{setDismissDelay(0);}});

    dir = new Radio();
    dir.setBoxLabel("目录组");
    dir.setToolTipConfig(new ToolTipConfig("目录组,不可修改", "该类型的组下面只能添加叶子组,不能添加Job任务"){{setDismissDelay(0);}});
View Full Code Here

        grid.getView().setAutoFill(true);
   
        // 名称和路径字段加上文本框,方便复制
        final GridEditing<PartitionModel> editing = new GridInlineEditing<PartitionModel>(
            grid);
        editing.addEditor(path, new TextField());
        editing.getEditor(path).setReadOnly(true);
        editing.addEditor(name, new TextField());
        editing.getEditor(name).setReadOnly(true);
   
        // 选择时加载分区数据预览
        GridSelectionModel<PartitionModel> gs = new GridSelectionModel<PartitionModel>();
        gs.addSelectionHandler(new SelectionHandler<PartitionModel>() {
View Full Code Here

    grid.setAllowTextSelection(true);
    grid.getView().setForceFit(true);
    grid.getView().setAutoFill(true);
    final GridEditing<ModelPropertyModel> editing = new GridInlineEditing<ModelPropertyModel>(
        grid);
    editing.addEditor(value, new TextField());
    editing.getEditor(value).setReadOnly(true);

    return grid;
  }
View Full Code Here

        final MenuItem referMenuItem = new MenuItem("复制引用语句", new SelectionHandler<MenuItem>() {
        @Override
        public void onSelection(SelectionEvent<MenuItem> event) {
          FileModel m =isCommon?getCommonTreeGrid().getSelectionModel().getSelectedItem():getMyTreeGrid().getSelectionModel().getSelectedItem();
          Window w = new Window();
          final TextField f = new TextField(){
            @Override
            public void onBrowserEvent(Event event) {
              super.onBrowserEvent(event);
              selectAll();
            }
          };
          w.setModal(true);
          w.setHeadingText("脚本引用语句");
          w.setHeight(60);
          StringBuffer sb = new StringBuffer();
          sb.append("download[").append("doc://")
            .append(m.getId()).append(' ').append(m.getName().replace(' ', '_'))
            .append("]");
          f.setValue(sb.toString());
          f.setReadOnly(true);
          f.setWidth(350);
          w.setWidget(f);
          w.show();
          f.focus();
        }
      });
        referMenuItem.setIcon(Images.getImageResources().script());
      return referMenuItem;
    }
View Full Code Here

            return;
          super.onFieldKeyUp(event);
        }
      };
      filters.addFilter(myFilter);
      final TextField filterText = myFilter.getField();
      filterText.setWidth(280);
      filterText.setEmptyText("关键词用空格隔开,'*'代表任意一个或多个字符");
      commonTableContainer.add(filterText, new VerticalLayoutData(1, 30,
          new Margins(3)));
      GridSelectionModel<TableModel> gs = new GridSelectionModel<TableModel>();
      gs.addSelectionHandler(new SelectionHandler<TableModel>() {
        @Override
View Full Code Here

   */
  public MyReferenceSelector(final int buttonWidth)
  {
    super(null);
    final HorizontalLayoutContainer panel = new HorizontalLayoutContainer();
    textField = new TextField();
    textField.setEmptyText(DkMain.i18n().label_reference_selector_empty_text());
    button = new TextButton(DkMain.i18n().label_reference_selector(), new SelectEvent.SelectHandler()
    {
      @Override
      public void onSelect(final SelectEvent event)
View Full Code Here

    dialogBox.add(verticalLayoutContainer);
  }

  protected void createLoginTextField()
  {
    loginTextField = new TextField(new TextInputCell()
    {
      @Override
      protected void onEnterKeyDown(final com.google.gwt.cell.client.Cell.Context context, final Element parent,
          final String value, final NativeEvent event, final ValueUpdater<String> valueUpdater)
      {
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.form.TextField

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.