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; }
protected ActionMap createActions() { final AbstractAction 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; }
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; }
/** * Creates an ActionMap to be installed on the text component. * * @return an ActionMap to be installed on the text component */ private ActionMap getActionMap() { // Note: There are no .actionMap entries in the standard L&Fs. However, // with the RI it is possible to install action maps via such keys, so // we must load them too. It can be observed that when there is no // .actionMap entry in the UIManager, one gets installed after a text // component of that type has been loaded. String prefix = getPropertyPrefix(); String amName = prefix + ".actionMap"; ActionMap am = (ActionMap) UIManager.get(amName); if (am == null) { am = createActionMap(); UIManager.put(amName, am); } ActionMap map = new ActionMapUIResource(); map.setParent(am); return map; }
/** * Creates a default ActionMap for text components that have no UI default * for this (the standard for the built-in L&Fs). The ActionMap is copied * from the text component's getActions() method. * * @returna default ActionMap */ private ActionMap createActionMap() { ActionMap am = new ActionMapUIResource(); Action[] actions = textComponent.getActions(); for (int i = actions.length - 1; i >= 0; i--) { Action action = actions[i]; am.put(action.getValue(Action.NAME), action); } // Add TransferHandler's actions here. They don't seem to be in the // JTextComponent's default actions, and I can't make up a better place // to add them. Action copyAction = TransferHandler.getCopyAction(); am.put(copyAction.getValue(Action.NAME), copyAction); Action cutAction = TransferHandler.getCutAction(); am.put(cutAction.getValue(Action.NAME), cutAction); Action pasteAction = TransferHandler.getPasteAction(); am.put(pasteAction.getValue(Action.NAME), pasteAction); return am; }
/** * Installs look and feel keyboard actions on the root pane. * * @param rp the root pane to install the keyboard actions to */ protected void installKeyboardActions(JRootPane rp) { // Install the keyboard actions. ActionMapUIResource am = new ActionMapUIResource(); am.put("press", new DefaultPressAction(rp)); am.put("release", new DefaultReleaseAction(rp)); SwingUtilities.replaceUIActionMap(rp, am); // Install the input map from the UIManager. It seems like the actual // bindings are installed in the JRootPane only when the defaultButton // property receives a value. So we also only install an empty // input map here, and fill it in propertyChange. ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp); SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW, im); }
/** * Creates the default actions when there are none specified by the L&F. * * @return the default actions */ private ActionMap createDefaultActions() { ActionMapUIResource am = new ActionMapUIResource(); Action action = new NavigateAction("selectNext"); am.put(action.getValue(Action.NAME), action); action = new NavigateAction("selectPrevious"); am.put(action.getValue(Action.NAME), action); action = new NavigateAction("selectParent"); am.put(action.getValue(Action.NAME), action); action = new NavigateAction("selectChild"); am.put(action.getValue(Action.NAME), action); action = new NavigateAction("return"); am.put(action.getValue(Action.NAME), action); action = new NavigateAction("cancel"); am.put(action.getValue(Action.NAME), action); return am; }
ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); map.put("navigatePageDown", new NavigatePageDownAction()); map.put("navigatePageUp", new NavigatePageUpAction()); map.put("navigateDown", new NavigateAction("navigateDown", SwingConstants.SOUTH)); map.put("navigateUp", new NavigateAction("navigateUp", SwingConstants.NORTH)); map.put("navigateLeft", new NavigateAction("navigateLeft", SwingConstants.WEST)); map.put("navigateRight", new NavigateAction("navigateRight", SwingConstants.EAST)); map.put("requestFocusForVisibleComponent", new RequestFocusForVisibleComponentAction()); map.put("requestFocus", new RequestFocusAction()); return map; }
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; }
ActionMap loadActionMap() { ActionMap map = new ActionMapUIResource(); put(map, new Actions(Actions.NEXT)); put(map, new Actions(Actions.PREVIOUS)); put(map, new Actions(Actions.RIGHT)); put(map, new Actions(Actions.LEFT)); put(map, new Actions(Actions.UP)); put(map, new Actions(Actions.DOWN)); put(map, new Actions(Actions.PAGE_UP)); put(map, new Actions(Actions.PAGE_DOWN)); put(map, new Actions(Actions.REQUEST_FOCUS)); put(map, new Actions(Actions.REQUEST_FOCUS_FOR_VISIBLE)); put(map, new Actions(Actions.SET_SELECTED)); put(map, new Actions(Actions.SELECT_FOCUSED)); put(map, new Actions(Actions.SCROLL_FORWARD)); put(map, new Actions(Actions.SCROLL_BACKWARD)); return map; }
protected ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); Action refreshAction = new AbstractVFSUIAction(VFSFilePane.ACTION_REFRESH) { public void actionPerformed(ActionEvent evt) { getFileChooser().rescanCurrentDirectory(); } }; map.put(VFSFilePane.ACTION_APPROVE_SELECTION, getApproveSelectionAction()); map.put(VFSFilePane.ACTION_CANCEL, getCancelSelectionAction()); map.put(VFSFilePane.ACTION_REFRESH, refreshAction); map.put(VFSFilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY, getChangeToParentDirectoryAction()); return map; }
final void installUIActionMap() { UIDefaults uiDefaults = UIManager.getLookAndFeelDefaults(); String propertyName = getPropertyPrefix() + ".actionMap"; ActionMap actionMap1 = new ActionMapUIResource(); putActionToActionMap(focusAction, actionMap1); Object actionMap2 = uiDefaults.get(propertyName); if (actionMap2 == null) { ActionMapUIResource map = new ActionMapUIResource(); Action[] actions = component.getActions(); for (int i = 0; i < actions.length; i++) { putActionToActionMap(actions[i], map); } putActionToActionMap(TransferHandler.getPasteAction(), map); putActionToActionMap(TransferHandler.getCutAction(), map); putActionToActionMap(TransferHandler.getCopyAction(), map); actionMap2 = map; if (!(component instanceof JEditorPane)) { uiDefaults.put(propertyName, map); } } actionMap1.setParent((ActionMap)actionMap2); SwingUtilities.replaceUIActionMap(component, actionMap1); }
protected void installKeyboardActions() { createInternalFrameListener(); frame.addInternalFrameListener(internalFrameListener); ActionMapUIResource actionMap = new ActionMapUIResource(); actionMap.put("showSystemMenu", new AbstractAction() { public void actionPerformed(final ActionEvent e) { if (titlePane != null) { titlePane.showSystemMenu(); } } }); actionMap.setParent(((BasicLookAndFeel)UIManager.getLookAndFeel()) .getAudioActionMap()); SwingUtilities.replaceUIActionMap(frame, actionMap); }
protected ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); Action refreshAction = new AbstractVFSUIAction(VFSFilePane.ACTION_REFRESH) { @Override public void actionPerformed(ActionEvent evt) { getFileChooser().rescanCurrentDirectory(); } }; map.put(VFSFilePane.ACTION_APPROVE_SELECTION, getApproveSelectionAction()); map.put(VFSFilePane.ACTION_CANCEL, getCancelSelectionAction()); map.put(VFSFilePane.ACTION_REFRESH, refreshAction); map.put(VFSFilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY, getChangeToParentDirectoryAction()); return map; }
protected ActionMap createActions() { final AbstractAction escAction = new AbstractAction() { private static final long serialVersionUID = -3976059968191425942L; 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; }
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; }
private ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); map.put("increment", nextButtonHandler); map.put("decrement", previousButtonHandler); return map; }
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; }