javax.swing.JFileChooser.getActionMap()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中javax.swing.JFileChooser.getActionMap()方法的一些代码示例,展示了JFileChooser.getActionMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFileChooser.getActionMap()方法的具体详情如下:
包路径:javax.swing.JFileChooser
类名称:JFileChooser
方法名:getActionMap

JFileChooser.getActionMap介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

JFrame frame = new JFrame();
JFileChooser  fileChooser = new JFileChooser(".");
Action details = fileChooser.getActionMap().get("viewTypeDetails");
details.actionPerformed(null);
fileChooser.showOpenDialog(frame);

代码示例来源:origin: stackoverflow.com

JFrame frame = new JFrame();
JFileChooser  fileChooser = new JFileChooser(".");
Action details = fileChooser.getActionMap().get("viewTypeDetails");
details.actionPerformed(null);

//  Find the JTable on the file chooser panel and manually do the sort

JTable table = SwingUtils.getDescendantsOfType(JTable.class, fileChooser).get(0);
table.getRowSorter().toggleSortOrder(3);

fileChooser.showOpenDialog(frame);

代码示例来源:origin: stackoverflow.com

JFileChooser chooser = new JFileChooser(".");  
ActionMap am = chooser.getActionMap();  
Action key = am.get("WHATEVER_THEACTIONAME_FOR_OPEN-DIR._IS") //I think it's "Open Folder";
key.setEnabled(false);

代码示例来源:origin: com.l2fprod.common/l2fprod-common-directorychooser

protected void installListeners(JFileChooser fc) {
 super.installListeners(fc);
 tree.addTreeSelectionListener(new SelectionListener());
 
 fc.getActionMap().put("refreshTree", new UpdateAction());
 fc.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
  KeyStroke.getKeyStroke("F5"), "refreshTree");
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-core

chooser.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
  KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "close");
chooser.getActionMap().put("close", close);

代码示例来源:origin: org.netbeans.modules/org-netbeans-core

public void actionPerformed(ActionEvent ae) {
    Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (key != null) {
      //if there was an action, do it first
      Action a = chooser.getActionMap().get(key);
      if (a != null) {
        a.actionPerformed(ae);
      }
    }
    if (comp.getParent() == null) {
      //then we were editing a file name, and the editor
      //was removed - we don't want to close the dialog
      return;
    }
    
    Container c = chooser.getTopLevelAncestor();
    //The action *may* have already hidden the panel (works
    //intermittently)
    if (c instanceof Dialog) {
      if (((Dialog) c).isVisible()) {
        ((Dialog) c).setVisible (false);
        ((Dialog) c).dispose();
      }
    }
  }
};

相关文章

JFileChooser类方法