map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
@Override public void actionPerformed(ActionEvent e) { if (DnDList.this.getSelectedValuesList().isEmpty()) { return; } List<ItemList> selectedValues = DnDList.this.getSelectedValuesList(); List<ItemList> siblings = new ArrayList<>(); for (ItemList value: selectedValues) { int valueIndex = DnDList.this.listModel.indexOf(value); if (valueIndex < DnDList.this.listModel.size() - 1) { siblings.add(DnDList.this.listModel.get(valueIndex + 1)); } else if (valueIndex > 0) { siblings.add(DnDList.this.listModel.get(valueIndex - 1)); } } TransferHandler.getCutAction().actionPerformed(e); for (ItemList sibling: siblings) { DnDList.this.setSelectedValue(sibling, true); } }
Action action = this.dndList.getActionMap().get(TransferHandler.getCutAction().getValue(Action.NAME)); if (action != null) { action.actionPerformed(
listActionMap.put(TransferHandler.getCutAction().getValue(Action.NAME), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { if (DnDList.this.getSelectedValuesList().isEmpty()) {
public void actionPerformed(ActionEvent e) { JTable table = getSelectedJTable(); Action cutAction = TransferHandler.getCutAction(); ActionEvent actionEvent = new ActionEvent(table, ActionEvent.ACTION_PERFORMED, "cut"); cutAction.actionPerformed(actionEvent); } });
/** * Create a default action map. This is basically the * set of actions found exported by the component. */ ActionMap createActionMap() { ActionMap map = new ActionMapUIResource(); Action[] actions = editor.getActions(); int n = actions.length; for (int i = 0; i < n; i++) { Action a = actions[i]; map.put(a.getValue(Action.NAME), a); } map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction()); map.put(TransferHandler.getPasteAction().getValue(Action.NAME), TransferHandler.getPasteAction()); return map; }
public void setupCutCopyPaste( JComponent comp, Class<? extends Action> cutActionType, Class<? extends Action> copyActionType) { ActionMap map = comp.getActionMap(); map.put( TransferHandler.getCutAction().getValue(Action.NAME), getAction(cutActionType)); map.put( TransferHandler.getCopyAction().getValue(Action.NAME), getAction(copyActionType)); map.put( TransferHandler.getPasteAction().getValue(Action.NAME), getAction(PasteAction.class)); }
public void setUpDndCCP() { setDragEnabled(true); setDropMode(DropMode.INSERT_ROWS); setTransferHandler(new PlaylistTransferHandler(this)); ActionMap map = getActionMap(); Action cutAction = TransferHandler.getCutAction(); map.put(cutAction.getValue(Action.NAME), cutAction); Action copyAction = TransferHandler.getCopyAction(); map.put(copyAction.getValue(Action.NAME), copyAction); Action pasteAction = TransferHandler.getPasteAction(); map.put(pasteAction.getValue(Action.NAME), pasteAction); }
map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
/** * Fetch an action map to use. The map for a JEditorPane * is not shared because it changes with the EditorKit. */ ActionMap getActionMap() { ActionMap am = new ActionMapUIResource(); am.put("requestFocus", new FocusAction()); Action[] actions = getComponent().getActions(); if (actions != null) { addActions(am, actions); } am.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); am.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction()); am.put(TransferHandler.getPasteAction().getValue(Action.NAME), TransferHandler.getPasteAction()); return am; }
/** * Return the mapping between JTree's input map and JGraph's actions. */ protected ActionMap createActionMap() { ActionMap map = (ActionMap) UIManager.get("ScrollPane.actionMap"); map.put("edit", mxGraphActions.getEditAction()); map.put("delete", mxGraphActions.getDeleteAction()); map.put("home", mxGraphActions.getHomeAction()); map.put("enterGroup", mxGraphActions.getEnterGroupAction()); map.put("exitGroup", mxGraphActions.getExitGroupAction()); map.put("collapse", mxGraphActions.getCollapseAction()); map.put("expand", mxGraphActions.getExpandAction()); map.put("toBack", mxGraphActions.getToBackAction()); map.put("toFront", mxGraphActions.getToFrontAction()); map.put("selectNone", mxGraphActions.getSelectNoneAction()); map.put("selectAll", mxGraphActions.getSelectAllAction()); map.put("selectNext", mxGraphActions.getSelectNextAction()); map.put("selectPrevious", mxGraphActions.getSelectPreviousAction()); map.put("selectParent", mxGraphActions.getSelectParentAction()); map.put("selectChild", mxGraphActions.getSelectChildAction()); map.put("cut", TransferHandler.getCutAction()); map.put("copy", TransferHandler.getCopyAction()); map.put("paste", TransferHandler.getPasteAction()); map.put("group", mxGraphActions.getGroupAction()); map.put("ungroup", mxGraphActions.getUngroupAction()); map.put("zoomIn", mxGraphActions.getZoomInAction()); map.put("zoomOut", mxGraphActions.getZoomOutAction()); return map; }
actions.put("selectAll", new SelectAllAction()); actions.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); actions.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
/** * Return the mapping between JTree's input map and JGraph's actions. */ protected ActionMap createActionMap() { ActionMap map = (ActionMap) UIManager.get("ScrollPane.actionMap"); map.put("edit", mxGraphActions.getEditAction()); map.put("delete", mxGraphActions.getDeleteAction()); map.put("home", mxGraphActions.getHomeAction()); map.put("enterGroup", mxGraphActions.getEnterGroupAction()); map.put("exitGroup", mxGraphActions.getExitGroupAction()); map.put("collapse", mxGraphActions.getCollapseAction()); map.put("expand", mxGraphActions.getExpandAction()); map.put("toBack", mxGraphActions.getToBackAction()); map.put("toFront", mxGraphActions.getToFrontAction()); map.put("selectNone", mxGraphActions.getSelectNoneAction()); map.put("selectAll", mxGraphActions.getSelectAllAction()); map.put("selectNext", mxGraphActions.getSelectNextAction()); map.put("selectPrevious", mxGraphActions.getSelectPreviousAction()); map.put("selectParent", mxGraphActions.getSelectParentAction()); map.put("selectChild", mxGraphActions.getSelectChildAction()); map.put("cut", TransferHandler.getCutAction()); map.put("copy", TransferHandler.getCopyAction()); map.put("paste", TransferHandler.getPasteAction()); map.put("group", mxGraphActions.getGroupAction()); map.put("ungroup", mxGraphActions.getUngroupAction()); map.put("zoomIn", mxGraphActions.getZoomInAction()); map.put("zoomOut", mxGraphActions.getZoomOutAction()); return map; }
map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
if (sourceAction == TransferHandler.getCopyAction()) a = focusOwner.getActionMap().get("copy"); else if (sourceAction == TransferHandler.getCutAction()) a = focusOwner.getActionMap().get("cut"); else if (sourceAction == TransferHandler.getPasteAction())
map.put(new Actions(Actions.MOVE_SELECTION_TO)); map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
map.put(new Actions(Actions.MOVE_SELECTION_TO)); map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
map.put(new Actions(Actions.MOVE_SELECTION_TO)); map.put(TransferHandler.getCutAction().getValue(Action.NAME), TransferHandler.getCutAction()); map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());