Package javax.swing

Examples of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding


  }

  private boolean isInGroup(ButtonGroup group, Component comp) {
    Enumeration<AbstractButton> elements = group.getElements();
    while (elements.hasMoreElements()) {
      AbstractButton ab = elements.nextElement();
      if (ab == comp)
        return true;
    }
    return false;
  }
View Full Code Here


        if (bg.getButtonCount() > 0) {
          Enumeration<AbstractButton> elements = bg.getElements();
          MenuManager delMenu = new MenuManager(
              Messages.ButtonGroupCustomizer_Remove_Button_From_This_Group);
          while (elements.hasMoreElements()) {
            AbstractButton aButton = elements.nextElement();
            delMenu.add(new DeleteButtonFromThisGroupAction(
                rootAdapter, aButton, bg));
            allButtons.remove(aButton);
          }
          menuManager.add(delMenu);
View Full Code Here

          if (parent instanceof ButtonGroupAdapter) {
            ButtonGroupAdapter parentAdapter = (ButtonGroupAdapter) parent;
            ButtonGroup bg = parentAdapter.getButtonGroup();
            Enumeration<AbstractButton> elements = bg.getElements();
            while (elements.hasMoreElements()) {
              AbstractButton ab = elements.nextElement();
              if (!buttons.contains(ab)) {
                buttons.add(ab);
              }
            }
          }
View Full Code Here

      if (selectedButtons.isEmpty())
        return;
      ButtonGroup group = buttonGroup.getButtonGroup();
      for (Component comp : selectedButtons) {
        if (!isInGroup(group, comp)){
          AbstractButton aBtn=(AbstractButton)comp;
          removeButtonFromGroup(aBtn);
          buttonGroup.getButtonGroup().add(aBtn);
        }
      }
      root.setDirty(true);
View Full Code Here

      root.getInvisibles().add(btnAdapter);
      btnAdapter.setName(root.getNamespace().nextName(btnAdapter.getBasename()));
      if (selectedButtons.isEmpty())
        return;
      for (Component comp : selectedButtons) {
        AbstractButton aBtn=(AbstractButton) comp;
        removeButtonFromGroup(aBtn);
        btnAdapter.getButtonGroup().add(aBtn);
      }
      root.setDirty(true);
      root.addNotify();
View Full Code Here

      for (InvisibleAdapter adapter : adapters) {
        root.getInvisibles().remove(adapter);
        ButtonGroup bg = ((ButtonGroupAdapter)adapter).getButtonGroup();
        Enumeration<AbstractButton> elements = bg.getElements();
        while(elements.hasMoreElements()){
          AbstractButton ab=elements.nextElement();
          bg.remove(ab);
        }
      }
      root.setDirty(true);
      root.addNotify();
View Full Code Here

        IAdapter parentAdapter = wa.getParent();
        if (parentAdapter != null
            && parentAdapter instanceof ButtonGroupAdapter) {
          ButtonGroup bg = ((ButtonGroupAdapter) parentAdapter)
              .getButtonGroup();
          AbstractButton aBtn = (AbstractButton) wa.getWidget();
          if (isInGroup(bg, aBtn))
            bg.remove(aBtn);
        }
      }
      rootAdapter.setDirty(true);
View Full Code Here

        if(bg!=null){
          int count =bg.getButtonCount();
          if(count>0){
            Enumeration<AbstractButton> elements = bg.getElements();
            while(elements.hasMoreElements()){
              AbstractButton ab=elements.nextElement();
              WidgetAdapter btnAdapter = WidgetAdapter.getWidgetAdapter(ab);
              btnAdapter.setDirty(true);
            }
          }
        }
View Full Code Here

    events.add(e);
  }

  public void test(TestHarness harness)
  {
    AbstractButton b = new JButton("ABC");
    b.addPropertyChangeListener(this);
    b.setVerticalTextPosition(SwingConstants.TOP);
    harness.check(b.getVerticalTextPosition(), SwingConstants.TOP);
    PropertyChangeEvent e = (PropertyChangeEvent) events.get(0);
    harness.check(e.getSource(), b);
    harness.check(e.getPropertyName(), "verticalTextPosition");
    harness.check(e.getOldValue(), new Integer(SwingConstants.CENTER));
    harness.check(e.getNewValue(), new Integer(SwingConstants.TOP));
   
    // setting the same value should generate no event
    events.clear();
    b.setVerticalTextPosition(SwingConstants.TOP);
    harness.check(events.size(), 0);
   
    // try an illegal argument
    boolean pass = false;
    try
      {
        b.setVerticalTextPosition(SwingConstants.LEFT);
      }
    catch (IllegalArgumentException ex)
      {
        pass = true
      }
View Full Code Here

    events.add(e);
  }

  public void test(TestHarness harness)
  {
    AbstractButton b = new JButton("ABC");
    b.addPropertyChangeListener(this);
    b.setVerticalAlignment(SwingConstants.BOTTOM);
    harness.check(b.getVerticalAlignment(), SwingConstants.BOTTOM);
    PropertyChangeEvent e = (PropertyChangeEvent) events.get(0);
    harness.check(e.getSource(), b);
    harness.check(e.getPropertyName(), "verticalAlignment");
    harness.check(e.getOldValue(), new Integer(SwingConstants.CENTER));
    harness.check(e.getNewValue(), new Integer(SwingConstants.BOTTOM));
   
    // setting the same value should generate no event
    events.clear();
    b.setVerticalAlignment(SwingConstants.BOTTOM);
    harness.check(events.size(), 0);
   
    // try an illegal argument
    boolean pass = false;
    try
      {
        b.setVerticalAlignment(SwingConstants.RIGHT);
      }
    catch (IllegalArgumentException ex)
      {
        pass = true
      }
View Full Code Here

TOP

Related Classes of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding

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.