List of usage examples for javax.swing RootPaneContainer getRootPane
JRootPane getRootPane();
From source file:Main.java
public static Boolean isFrameModified(RootPaneContainer frame) { synchronized (frame) { JRootPane rootPane = frame.getRootPane(); Object obj = rootPane.getClientProperty(WINDOW_MODIFIED); if (obj == null || !(obj instanceof Boolean)) { return Boolean.FALSE; }//from ww w . ja v a 2 s . c o m return (Boolean) obj; } }
From source file:Main.java
public static void setFrameModified(RootPaneContainer frame, Boolean flag) { synchronized (frame) { JRootPane rootPane = frame.getRootPane(); rootPane.putClientProperty(WINDOW_MODIFIED, flag); }// www .ja v a 2s .co m }
From source file:com.projity.pm.graphic.frames.GraphicManager.java
private void addCtrlAccel(int vk, String actionConstant, Action action) { RootPaneContainer root = (RootPaneContainer) container; InputMap inputMap = root.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); KeyStroke key = KeyStroke.getKeyStroke(vk, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); //claur use getMenuShortcutKeyMask so it work on Mac too. inputMap.put(key, actionConstant);/* w w w .jav a 2 s .c om*/ if (action == null) action = menuManager.getActionFromId(actionConstant); root.getRootPane().getActionMap().put(actionConstant, action); }