Package javax.swing

Examples of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding


    events.add(e);
  }

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


public void test(TestHarness harness)
  {
    Icon icon1 = MetalIconFactory.getFileChooserNewFolderIcon();
    Icon icon2 = MetalIconFactory.getHorizontalSliderThumbIcon();
    AbstractButton b = new JButton("123");
    b.setRolloverEnabled(false);
    b.addPropertyChangeListener(this);
    b.setRolloverIcon(icon1);
    harness.check(b.getRolloverIcon(), icon1);
    harness.check(events.size(), 2);
    PropertyChangeEvent e1 = (PropertyChangeEvent) events.get(0);
    harness.check(e1.getSource(), b);
    harness.check(e1.getPropertyName(), "rolloverIcon");
    harness.check(e1.getOldValue(), null);
    harness.check(e1.getNewValue(), icon1);
    PropertyChangeEvent e2 = (PropertyChangeEvent) events.get(1);
    harness.check(e2.getSource(), b);
    harness.check(e2.getPropertyName(), "rolloverEnabled");
    harness.check(e2.getOldValue(), Boolean.FALSE);
    harness.check(e2.getNewValue(), Boolean.TRUE);
   
    // change the icon
    events.clear();
    b.setRolloverIcon(icon2);
    harness.check(b.getRolloverIcon(), icon2);
    harness.check(events.size(), 1);
    e1 = (PropertyChangeEvent) events.get(0);
    harness.check(e1.getSource(), b);
    harness.check(e1.getPropertyName(), "rolloverIcon");
    harness.check(e1.getOldValue(), icon1);
    harness.check(e1.getNewValue(), icon2);
   
    // setting the same icon should generate no event
    events.clear();
    b.setRolloverIcon(icon2);
    harness.check(events.size(), 0);
   
    // set to null
    b.setRolloverIcon(null);
    harness.check(b.getRolloverIcon(), null);
    harness.check(b.isRolloverEnabled(), true);
    harness.check(events.size(), 1);
    e1 = (PropertyChangeEvent) events.get(0);
    harness.check(e1.getSource(), b);
    harness.check(e1.getPropertyName(), "rolloverIcon");
    harness.check(e1.getOldValue(), icon2);
View Full Code Here

      }
    catch (UnsupportedLookAndFeelException e)
      {
        // ignore
      }
    AbstractButton b = new JButton("Test");
    harness.check(b.isRolloverEnabled(), false);
    b.addPropertyChangeListener(this);   
    b.setRolloverEnabled(true);
    harness.check(b.isRolloverEnabled(), true);
    harness.check(this.event.getPropertyName(), "rolloverEnabled");
    harness.check(this.event.getSource(), b);
    harness.check(this.event.getOldValue(), Boolean.FALSE);
    harness.check(this.event.getNewValue(), Boolean.TRUE);
  }
View Full Code Here

public void test(TestHarness harness)
  {
    Icon icon1 = MetalIconFactory.getFileChooserNewFolderIcon();
    Icon icon2 = MetalIconFactory.getHorizontalSliderThumbIcon();
    AbstractButton b = new JButton("123");
    b.setRolloverEnabled(false);
    b.addPropertyChangeListener(this);
    b.setRolloverSelectedIcon(icon1);
    harness.check(b.getRolloverSelectedIcon(), icon1);
    harness.check(events.size(), 2);
    PropertyChangeEvent e1 = (PropertyChangeEvent) events.get(0);
    harness.check(e1.getSource(), b);
    harness.check(e1.getPropertyName(), "rolloverSelectedIcon");
    harness.check(e1.getOldValue(), null);
    harness.check(e1.getNewValue(), icon1);
    PropertyChangeEvent e2 = (PropertyChangeEvent) events.get(1);
    harness.check(e2.getSource(), b);
    harness.check(e2.getPropertyName(), "rolloverEnabled");
    harness.check(e2.getOldValue(), Boolean.FALSE);
    harness.check(e2.getNewValue(), Boolean.TRUE);
   
    // change the icon
    events.clear();
    b.setRolloverSelectedIcon(icon2);
    harness.check(b.getRolloverSelectedIcon(), icon2);
    harness.check(events.size(), 1);
    e1 = (PropertyChangeEvent) events.get(0);
    harness.check(e1.getSource(), b);
    harness.check(e1.getPropertyName(), "rolloverSelectedIcon");
    harness.check(e1.getOldValue(), icon1);
    harness.check(e1.getNewValue(), icon2);
   
    // setting the same icon should generate no event
    events.clear();
    b.setRolloverSelectedIcon(icon2);
    harness.check(events.size(), 0);
   
    // set to null
    b.setRolloverSelectedIcon(null);
    harness.check(b.getRolloverSelectedIcon(), null);
    harness.check(b.isRolloverEnabled(), true);
    harness.check(events.size(), 1);
    e1 = (PropertyChangeEvent) events.get(0);
    harness.check(e1.getSource(), b);
    harness.check(e1.getPropertyName(), "rolloverSelectedIcon");
    harness.check(e1.getOldValue(), icon2);
View Full Code Here

    events.add(e);
  }

  public void test(TestHarness harness)
  {
    AbstractButton b = new JButton("ABC");
    b.addPropertyChangeListener(this);
    b.setHorizontalTextPosition(SwingConstants.LEFT);
    harness.check(b.getHorizontalTextPosition(), SwingConstants.LEFT);
    PropertyChangeEvent e = (PropertyChangeEvent) events.get(0);
    harness.check(e.getSource(), b);
    harness.check(e.getPropertyName(), "horizontalTextPosition");
    harness.check(e.getOldValue(), new Integer(SwingConstants.TRAILING));
    harness.check(e.getNewValue(), new Integer(SwingConstants.LEFT));
   
    // setting the same value should generate no event
    events.clear();
    b.setHorizontalTextPosition(SwingConstants.LEFT);
    harness.check(events.size(), 0);
   
    // try an illegal argument
    boolean pass = false;
    try
      {
        b.setHorizontalTextPosition(SwingConstants.NORTH);
      }
    catch (IllegalArgumentException ex)
      {
        pass = 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

  public void actionPerformed(final ActionEvent e)
  {
    final Object source = e.getSource();
    if (source instanceof AbstractButton)
    {
      final AbstractButton b = (AbstractButton) source;
      maxPreviewRowsSpinner.setEnabled(b.isSelected());
    }
  }
View Full Code Here

  public void itemStateChanged(final ItemEvent e)
  {
    final Object source = e.getSource();
    if (source instanceof AbstractButton)
    {
      final AbstractButton b = (AbstractButton) source;
      maxPreviewRowsSpinner.setEnabled(b.isSelected());
    }
  }
View Full Code Here

  public void actionPerformed(final ActionEvent e)
  {
    final Object source = e.getSource();
    if (source instanceof AbstractButton)
    {
      final AbstractButton b = (AbstractButton) source;
      maxPreviewRowsSpinner.setEnabled(b.isSelected());
    }
  }
View Full Code Here

                           final String tagName)
  {
    super(self, parent, domContainer, tagName);
    this.actionChangeHandler = new ActionChangeHandler();

    final AbstractButton button = getButton();
    parentIsToolbar = computeParentToolbar(parent);
    if (parentIsToolbar)
    {
      button.putClientProperty("hideActionText", Boolean.TRUE);//NON-NLS
    }
  }
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.