コード例 #1
0
ファイル: TreeUtil.java プロジェクト: jexp/idea2
 @SuppressWarnings({"HardCodedStringLiteral"})
 public static void installActions(final JTree tree) {
   tree.getActionMap()
       .put(
           "scrollUpChangeSelection",
           new AbstractAction() {
             public void actionPerformed(final ActionEvent e) {
               movePageUp(tree);
             }
           });
   tree.getActionMap()
       .put(
           "scrollDownChangeSelection",
           new AbstractAction() {
             public void actionPerformed(final ActionEvent e) {
               movePageDown(tree);
             }
           });
   tree.getActionMap()
       .put(
           "selectPrevious",
           new AbstractAction() {
             public void actionPerformed(final ActionEvent e) {
               moveUp(tree);
             }
           });
   tree.getActionMap()
       .put(
           "selectNext",
           new AbstractAction() {
             public void actionPerformed(final ActionEvent e) {
               moveDown(tree);
             }
           });
   copyAction(tree, "selectLast", "selectLastChangeLead");
   copyAction(tree, "selectFirst", "selectFirstChangeLead");
 }
コード例 #2
0
ファイル: TreeUtil.java プロジェクト: jexp/idea2
 private static void copyAction(final JTree tree, String original, String copyTo) {
   final Action action = tree.getActionMap().get(original);
   if (action != null) {
     tree.getActionMap().put(copyTo, action);
   }
 }