Java Code Examples for javax.swing.plaf.ActionMapUIResource

The following examples show how to use javax.swing.plaf.ActionMapUIResource. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: netbeans   Source File: DirectoryChooserUI.java    License: Apache License 2.0 6 votes vote down vote up
protected ActionMap createActionMap() {
    AbstractAction escAction = new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            getFileChooser().cancelSelection();
        }
        @Override
        public boolean isEnabled(){
            return getFileChooser().isEnabled();
        }
    };
    ActionMap map = new ActionMapUIResource();
    map.put("approveSelection", getApproveSelectionAction());
    map.put("cancelSelection", escAction);
    map.put("Go Up", getChangeToParentDirectoryAction());
    return map;
}
 
Example 2
Source Project: iBioSim   Source File: CloseTabPaneUI.java    License: Apache License 2.0 6 votes vote down vote up
static ActionMap createMyActionMap() {
	ActionMap map = new ActionMapUIResource();
	map.put("navigateNext", new NextAction());
	map.put("navigatePrevious", new PreviousAction());
	map.put("navigateRight", new RightAction());
	map.put("navigateLeft", new LeftAction());
	map.put("navigateUp", new UpAction());
	map.put("navigateDown", new DownAction());
	map.put("navigatePageUp", new PageUpAction());
	map.put("navigatePageDown", new PageDownAction());
	map.put("requestFocus", new RequestFocusAction());
	map.put("requestFocusForVisibleComponent", new RequestFocusForVisibleAction());
	map.put("setSelectedIndex", new SetSelectedIndexAction());
	map.put("scrollTabsForwardAction", new ScrollTabsForwardAction());
	map.put("scrollTabsBackwardAction", new ScrollTabsBackwardAction());
	return map;
}
 
Example 3
protected ActionMap createActions() {
	final Action escAction = new AbstractAction() {

		private static final long serialVersionUID = -3976059968191425942L;

		@Override
		public void actionPerformed(ActionEvent e) {
			FileChooserUI.this.fileList.stopThumbnailGeneration();
			getFileChooser().cancelSelection();
		}

		@Override
		public boolean isEnabled() {
			return getFileChooser().isEnabled();
		}
	};
	final ActionMap map = new ActionMapUIResource();
	map.put("approveSelection", getApproveSelectionAction());
	map.put("cancelSelection", escAction);
	return map;
}
 
Example 4
Source Project: nextreports-designer   Source File: BasicGridUI.java    License: Apache License 2.0 6 votes vote down vote up
private ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();

    map.put("selectNextColumn", new NavigationAction(1, 0));
    map.put("selectPreviousColumn", new NavigationAction(-1, 0));
    map.put("selectNextRow", new NavigationAction(0, 1));
    map.put("selectPreviousRow", new NavigationAction(0, -1));

    map.put("selectNextColumnExtendSelection", new NavigationAction(1, 0, true));
    map.put("selectPreviousColumnExtendSelection", new NavigationAction(-1, 0, true));
    map.put("selectNextRowExtendSelection", new NavigationAction(0, 1, true));
    map.put("selectPreviousRowExtendSelection", new NavigationAction(0, -1, true));

    map.put("startEditing", new StartEditingAction());
    map.put("cancel", new CancelEditingAction());
    map.put("clearCell", new ClearCellAction());
    map.put("cutCell", new CutAction());
    map.put("copyCell", new CopyAction());
    map.put("pasteCell", new PasteAction());

    return map;
}
 
Example 5
Source Project: diirt   Source File: CompareResultImages.java    License: MIT License 6 votes vote down vote up
/**
 * Creates new form CompareResultImages
 */
public CompareResultImages() {
    initComponents();
    toReviewList.setModel(new DefaultListModel());
    fillList();
    setSize(800, 600);
    setExtendedState(getExtendedState() | MAXIMIZED_BOTH);
    actualImage.setStretch(false);
    referenceImage.setStretch(false);
    acceptAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control D"));

    InputMap keyMap = new ComponentInputMap(acceptButton);
    keyMap.put(KeyStroke.getKeyStroke("control D"), "accept");

    ActionMap actionMap = new ActionMapUIResource();
    actionMap.put("accept", acceptAction);

    SwingUtilities.replaceUIActionMap(acceptButton, actionMap);
    SwingUtilities.replaceUIInputMap(acceptButton, JComponent.WHEN_IN_FOCUSED_WINDOW, keyMap);
}
 
Example 6
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 7
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 8
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 9
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 10
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 11
Source Project: Bytecoder   Source File: SynthFileChooserUIImpl.java    License: Apache License 2.0 5 votes vote down vote up
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 12
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 13
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 14
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 15
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 16
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 17
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 18
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 19
Source Project: seaglass   Source File: SeaGlassInternalFrameTitlePane.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create the action map for the system menu.
 *
 * @return the action map.
 */
ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();

    map.put("showSystemMenu", new ShowSystemMenuAction(true));
    map.put("hideSystemMenu", new ShowSystemMenuAction(false));

    return map;
}
 
Example 20
Source Project: seaglass   Source File: SeaGlassTitlePane.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create the action map for the system menu.
 *
 * @return the action map.
 */
ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();

    map.put("showSystemMenu", new ShowSystemMenuAction(true));
    map.put("hideSystemMenu", new ShowSystemMenuAction(false));

    return map;
}
 
Example 21
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    // add standard actions
    FilePane.addActionsToMap(map, filePane.getActions());
    // add synth only actions
    map.put("fileNameCompletion", getFileNameCompletionAction());
    return map;
}
 
Example 22
Source Project: darklaf   Source File: DarkFileChooserUIBridge.java    License: MIT License 4 votes vote down vote up
/**
 * Constructs an instance of {@code ActionMap}.
 *
 * @return an instance of {@code ActionMap}
 */
protected ActionMap createActionMap() {
    ActionMap map = new ActionMapUIResource();
    FilePane.addActionsToMap(map, filePane.getActions());
    return map;
}
 
Example 23
Source Project: dragonwell8_jdk   Source File: Test4856008.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}
 
Example 24
Source Project: dragonwell8_jdk   Source File: Test6978482.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}
 
Example 25
Source Project: TencentKona-8   Source File: Test4856008.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}
 
Example 26
Source Project: TencentKona-8   Source File: Test6978482.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}
 
Example 27
Source Project: jdk8u60   Source File: Test4856008.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}
 
Example 28
Source Project: jdk8u60   Source File: Test6978482.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}
 
Example 29
/**
 * Installs the maps on the root pane of the originating component of
 * the first popup panel of the specified sequence to trace the ESC key
 * and dismiss the shown popup panels.
 *
 * @param shownPath Popup panel sequence.
 */
private void traceRootPane(List<PopupPanelManager.PopupInfo> shownPath) {
    JComponent originator = shownPath.get(0).getPopupOriginator();
    this.tracedRootPane = SwingUtilities.getRootPane(originator);

    if (this.tracedRootPane != null) {
        newInputMap = new ComponentInputMapUIResource(tracedRootPane);
        newInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
                "hidePopupPanel");

        newActionMap = new ActionMapUIResource();
        newActionMap.put("hidePopupPanel", new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) {
                // Hide the last sequence popup for every ESC keystroke.
                // There is special case - if the keytips are shown
                // for the *second* panel of the app menu popup panel,
                // do not dismiss the popup
                List<PopupPanelManager.PopupInfo> popups = PopupPanelManager
                        .defaultManager().getShownPath();
                if (popups.size() > 0) {
                    PopupPanelManager.PopupInfo lastPopup = popups
                            .get(popups.size() - 1);
                    if (lastPopup.getPopupPanel() instanceof JRibbonApplicationMenuPopupPanel) {
                        JRibbonApplicationMenuPopupPanel appMenuPopupPanel =
                                (JRibbonApplicationMenuPopupPanel) lastPopup
                                        .getPopupPanel();
                        KeyTipManager.KeyTipChain currentlyShownKeyTipChain = KeyTipManager
                                .defaultManager().getCurrentlyShownKeyTipChain();
                        if ((currentlyShownKeyTipChain != null)
                                && (currentlyShownKeyTipChain.chainParentComponent == appMenuPopupPanel
                                .getPanelLevel2()))
                            return;
                    }
                }
                PopupPanelManager.defaultManager().hideLastPopup();
            }
        });

        addUIInputMap(tracedRootPane, newInputMap);
        addUIActionMap(tracedRootPane, newActionMap);
    }
}
 
Example 30
Source Project: openjdk-jdk8u   Source File: Test4856008.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
protected ActionMap createActionMap() {
    return new ActionMapUIResource();
}