Package javax.swing

Examples of javax.swing.ActionMap.keys()


*/
public class newMapKeysNull implements Testlet {
 
  public void test(TestHarness harness) {
          ActionMap map = new ActionMap();
          if (map.keys() != null)
            harness.fail("New ActionMap should return null for keys()");
          if (map.allKeys() != null)
            harness.fail ("New ActionMap should return null for allKeys()");
  }

View Full Code Here


{
  public void test(TestHarness harness)
  {
    JSplitPane sp = new JSplitPane();
    ActionMap m = sp.getActionMap();
    harness.check(m.keys(), null);
    ActionMap mp = m.getParent();
    harness.check(mp.get("negativeIncrement") != null);
    harness.check(mp.get("positiveIncrement") != null);
    harness.check(mp.get("selectMin") != null);
    harness.check(mp.get("selectMax") != null);
View Full Code Here

{
  public void test(TestHarness harness)
  {
    JScrollBar sb = new JScrollBar();
    ActionMap m = sb.getActionMap();
    harness.check(m.keys(), null);
    ActionMap mp = m.getParent();
    harness.check(mp.get("positiveUnitIncrement") instanceof Action);
    harness.check(mp.get("positiveBlockIncrement") instanceof Action);
    harness.check(mp.get("negativeUnitIncrement") instanceof Action);
    harness.check(mp.get("negativeBlockIncrement") instanceof Action);
View Full Code Here

    harness.check(mp.get("positiveBlockIncrement") instanceof Action);
    harness.check(mp.get("negativeUnitIncrement") instanceof Action);
    harness.check(mp.get("negativeBlockIncrement") instanceof Action);
    harness.check(mp.get("minScroll") instanceof Action);
    harness.check(mp.get("maxScroll") instanceof Action);
    harness.check(mp.keys().length, 6);
  }
}
View Full Code Here

  {
    // this is the original version of the test - it shows no actions for
    // a regular label...
    JScrollPane p = new JScrollPane();
    ActionMap m = p.getActionMap();
    harness.check(m.keys(), null);
    ActionMap mp = m.getParent();
    harness.check(mp.get("scrollLeft") instanceof Action);
    harness.check(mp.get("scrollEnd") instanceof Action);
    harness.check(mp.get("unitScrollUp") instanceof Action);
    harness.check(mp.get("unitScrollLeft") instanceof Action);
View Full Code Here

{
  public void test(TestHarness harness)
  {
    JMenuBar mb = new JMenuBar();
    ActionMap m = mb.getActionMap();
    harness.check(m.keys(), null);
    ActionMap mp = m.getParent();
    //Object[] keys = mp.keys();
    //for (int i = 0; i < keys.length; i++)
    //    System.out.println(keys[i]);
    harness.check(mp.get("takeFocus") instanceof Action);
View Full Code Here

    ActionMap mp = m.getParent();
    //Object[] keys = mp.keys();
    //for (int i = 0; i < keys.length; i++)
    //    System.out.println(keys[i]);
    harness.check(mp.get("takeFocus") instanceof Action);
    harness.check(mp.keys().length, 1);
  }
}
View Full Code Here

  {
    // this is the original version of the test - it shows no actions for
    // a regular label...
    JLabel label = new JLabel("XYZ");
    ActionMap m = label.getActionMap();
    harness.check(m.keys(), null);
    ActionMap mp = m.getParent();
    harness.check(mp, null);
   
    // but then I remembered that when a label has a mnemonic and target
    // component, you can get the focus for the target component via the
View Full Code Here

    private void maybeInstallTextActions(JTextComponent text) {
        ActionMap actionMap = text.getActionMap();
        if (actionMap.get(markerActionKey) == null) {
            actionMap.put(markerActionKey, markerAction);
            ActionMap textActions = getContext().getActionMap(getClass(), this);
            for (Object key : textActions.keys()) {
                actionMap.put(key, textActions.get(key));
            }
        }
    }
View Full Code Here

                        inputMap.remove(key);
                    }
                }
            }
            ActionMap actionMap = contentPane.getActionMap();
            Object[] actionsKeys = actionMap.keys();
            if (actionsKeys != null) {
                for (Object key : actionsKeys) {
                    if (key instanceof String && ((String)key).startsWith("MapMover.")) {
                        actionMap.remove(key);
                    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.