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

Examples of com.sencha.gxt.widget.core.client.event.SelectEvent


  }

  protected void onMouseDown(Event e) {
    int index = indexOf(e.getEventTarget().<Element>cast());
    if (index != -1) {
      fireEvent(new SelectEvent());
    }
  }
View Full Code Here


      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          sb.fireEvent(new SelectEvent());
        }
      });
      menu.add(item);

    } else if (w instanceof TextButton) {
      final TextButton b = (TextButton) w;

      MenuItem item = new MenuItem(b.getText(), b.getIcon());
      item.setItemId(b.getItemId());

      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }
      if (b.getMenu() != null) {
        item.setHideOnClick(false);
        item.setSubMenu(b.getMenu());
      }
      item.setEnabled(b.isEnabled());

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
    } else if (w instanceof ButtonGroup) {
      ButtonGroup g = (ButtonGroup) w;
      g.setItemId(g.getItemId());
      menu.add(new SeparatorMenuItem());
      String heading = g.getHeadingText();
      if (heading != null && heading.length() > 0 && !heading.equals("&#160;")) {
        menu.add(new HeaderMenuItem(heading));
      }

      Widget con = g.getWidget();
      if (con != null && con instanceof HasWidgets) {
        HasWidgets widgets = (HasWidgets) con;
        Iterator<Widget> it = widgets.iterator();
        while (it.hasNext()) {
          addWidgetToMenu(menu, it.next());
        }
      }

      menu.add(new SeparatorMenuItem());
    } else if (w instanceof ToggleButton) {
      final ToggleButton b = (ToggleButton) w;

      final CheckMenuItem item = new CheckMenuItem(b.getText());
      item.setItemId(b.getItemId());
      item.setChecked(b.getValue());

      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }

      item.setEnabled(b.isEnabled());

      item.addCheckChangeHandler(new CheckChangeHandler<CheckMenuItem>() {

        @Override
        public void onCheckChange(CheckChangeEvent<CheckMenuItem> event) {
          // must pass true to cause value change event to fire
          b.setValue(event.getItem().isChecked(), true);
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
View Full Code Here

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          sb.fireEvent(new SelectEvent());
        }
      });
      menu.add(item);

    } else if (w instanceof TextButton) {
      final TextButton b = (TextButton) w;

      MenuItem item = new MenuItem(b.getText(), b.getIcon());
      item.setItemId(b.getItemId());

      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }
      if (b.getMenu() != null) {
        item.setHideOnClick(false);
        item.setSubMenu(b.getMenu());
      }
      item.setEnabled(b.isEnabled());

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
    } else if (w instanceof ButtonGroup) {
      ButtonGroup g = (ButtonGroup) w;
      g.setItemId(g.getItemId());
      menu.add(new SeparatorMenuItem());
      String heading = g.getHeadingText();
      if (heading != null && heading.length() > 0 && !heading.equals("&#160;")) {
        menu.add(new HeaderMenuItem(heading));
      }

      Widget con = g.getWidget();
      if (con != null && con instanceof HasWidgets) {
        HasWidgets widgets = (HasWidgets) con;
        Iterator<Widget> it = widgets.iterator();
        while (it.hasNext()) {
          addWidgetToMenu(menu, it.next());
        }
      }

      menu.add(new SeparatorMenuItem());
    } else if (w instanceof ToggleButton) {
      final ToggleButton b = (ToggleButton)w;
     
      final CheckMenuItem item = new CheckMenuItem(b.getText());
      item.setItemId(b.getItemId());
      item.setChecked(b.getValue());
     
      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }

      item.setEnabled(b.isEnabled());
     
      item.addCheckChangeHandler(new CheckChangeHandler<CheckMenuItem>() {

        @Override
        public void onCheckChange(CheckChangeEvent<CheckMenuItem> event) {
          b.setValue(event.getItem().isChecked());
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
     
View Full Code Here

  }

  protected void onMouseDown(Event e) {
    int index = indexOf(e.getEventTarget().<Element> cast());
    if (index != -1) {
      fireEvent(new SelectEvent());
    }
  }
View Full Code Here

  public void setOff() {
    useCustom.setValue(false, true);
    useDefault.setValue(true, true);
    pathField.setValue("");
    hostField.setValue("");
    add.fireEvent(new SelectEvent());
  }
View Full Code Here

    pathField.setAllowBlank(false);
    this.pathField.setValue(p.getPath());
    this.hostField.setValue(p.getHost());
    hostFieldWapper.show();
    pathFieldWapper.show();
    add.fireEvent(new SelectEvent());
  }
View Full Code Here

    form.add(submit,new HorizontalLayoutData());
   
    container.add(form,new VerticalLayoutData(1,30));
    container.addAttachHandler(new Handler() {
      public void onAttachOrDetach(AttachEvent event) {
        submit.fireEvent(new SelectEvent());
      }
    });
  }
View Full Code Here

   
    container.add(form,new VerticalLayoutData(1, 30));
   
    container.addAttachHandler(new Handler() {
      public void onAttachOrDetach(AttachEvent event) {
        submit.fireEvent(new SelectEvent());
      }
    });
  }
View Full Code Here

      final ValueUpdater<String> valueUpdater)
  {
    if (fireCancellableEvent(context, new BeforeSelectEvent(context)))
    {
      appearance.onOver(p, false, null);
      fireEvent(context, new SelectEvent(context));
    }
  }
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.event.SelectEvent

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.