|
|
|
@ -27,27 +27,120 @@ |
|
|
|
|
|
|
|
package userinterface; |
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.undo.UndoManager; |
|
|
|
|
|
|
|
import java.awt.Toolkit; |
|
|
|
import java.awt.datatransfer.Clipboard; |
|
|
|
import java.awt.datatransfer.FlavorEvent; |
|
|
|
import java.awt.datatransfer.FlavorListener; |
|
|
|
import java.awt.event.*; |
|
|
|
|
|
|
|
import userinterface.util.*; |
|
|
|
/** |
|
|
|
* |
|
|
|
* @author ug60axh |
|
|
|
* This class gets notified through pluginChanged when the plugin in |
|
|
|
* focus has changed. The undo/redo actions can be implemented cleanly |
|
|
|
* by implementing the getUndoManager() function in GUIPlugin. Once this |
|
|
|
* is done it should work automatically, including enabledness of these actions. |
|
|
|
* |
|
|
|
* The clipboard functions paste/copy/cut/select all/delete work slightly more |
|
|
|
* complicated. This class listens on the focussed plugin's selectionChangeManager |
|
|
|
* and calls canDoClipboardFunction on this plugin to determine enabledness. |
|
|
|
* There is no need to pass changes in the clipboard state to the |
|
|
|
* selectionChangeManager, as this is done automatically. Hence, only notify when |
|
|
|
* a change in selection occurs. |
|
|
|
* |
|
|
|
* All actions can be and should be used as menu items. |
|
|
|
* |
|
|
|
* @author ug60axh, mxk |
|
|
|
*/ |
|
|
|
public class GUIClipboard extends GUIPlugin |
|
|
|
{ |
|
|
|
/* the current GUIPlugin undoManager */ |
|
|
|
private GUIPrism prism; |
|
|
|
private GUIPlugin plugin; |
|
|
|
private GUIUndoManager undoManager; |
|
|
|
private JMenu editMenu; |
|
|
|
private JToolBar editToolBar; |
|
|
|
private Action menuActionCut, menuActionCopy, menuActionPaste, menuActionDelete, menuActionSelectAll; |
|
|
|
private Action toolbarActionCut, toolbarActionCopy, toolbarActionPaste, toolbarActionDelete, toolbarActionSelectAll; |
|
|
|
|
|
|
|
|
|
|
|
private Action actionUndo, actionRedo, actionCut, actionCopy, actionPaste, actionDelete, actionSelectAll; |
|
|
|
|
|
|
|
/** Creates a new instance of GUIClipboard */ |
|
|
|
public GUIClipboard(GUIPrism pr) |
|
|
|
{ |
|
|
|
super(pr, false); |
|
|
|
this.prism = pr; |
|
|
|
initComponents(); |
|
|
|
doUndoManagerEnables(); |
|
|
|
doClipboardEnables(); |
|
|
|
|
|
|
|
/* Listen to clipboard events. */ |
|
|
|
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); |
|
|
|
clipboard.addFlavorListener(new FlavorListener() { |
|
|
|
@Override |
|
|
|
public void flavorsChanged(FlavorEvent e) { |
|
|
|
doClipboardEnables(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/* gets called when plugin changes. should implement this as an |
|
|
|
* GUIEvent really */ |
|
|
|
public void pluginChanged(GUIPlugin plugin) |
|
|
|
{ |
|
|
|
if (plugin != null) |
|
|
|
plugin.getSelectionChangeHandler().clear(); |
|
|
|
|
|
|
|
// remove listener |
|
|
|
if (undoManager != null) |
|
|
|
undoManager.clear(); |
|
|
|
|
|
|
|
this.plugin = null; |
|
|
|
this.undoManager = null; |
|
|
|
|
|
|
|
if (plugin != null) |
|
|
|
{ |
|
|
|
this.plugin = plugin; |
|
|
|
/* get notified when enabledness of clipboard actions may change */ |
|
|
|
this.plugin.getSelectionChangeHandler().addListener(new GUIEventListener() { |
|
|
|
@Override |
|
|
|
public boolean processGUIEvent(GUIEvent e) { |
|
|
|
doClipboardEnables(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
if (plugin.getUndoManager() != null) |
|
|
|
{ |
|
|
|
undoManager = plugin.getUndoManager(); |
|
|
|
|
|
|
|
/* get notified when undo history may change */ |
|
|
|
undoManager.addListener(new GUIEventListener() { |
|
|
|
@Override |
|
|
|
public boolean processGUIEvent(GUIEvent e) { |
|
|
|
if (e instanceof GUIUndoManagerEvent) |
|
|
|
{ |
|
|
|
doUndoManagerEnables(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
doUndoManagerEnables(); |
|
|
|
doClipboardEnables(); |
|
|
|
} |
|
|
|
|
|
|
|
private void doClipboardEnables() |
|
|
|
{ |
|
|
|
actionCopy.setEnabled(plugin != null && plugin.canDoClipBoardAction(actionCopy)); |
|
|
|
actionCut.setEnabled(plugin != null && plugin.canDoClipBoardAction(actionCut)); |
|
|
|
actionPaste.setEnabled(plugin != null && plugin.canDoClipBoardAction(actionPaste)); |
|
|
|
actionDelete.setEnabled(plugin != null && plugin.canDoClipBoardAction(actionDelete)); |
|
|
|
actionSelectAll.setEnabled(plugin != null && plugin.canDoClipBoardAction(actionSelectAll)); |
|
|
|
} |
|
|
|
|
|
|
|
public void takeCLArgs(String args[]) |
|
|
|
{ |
|
|
|
} |
|
|
|
@ -91,188 +184,173 @@ public class GUIClipboard extends GUIPlugin |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public void doUndoManagerEnables() |
|
|
|
{ |
|
|
|
actionUndo.setEnabled(undoManager != null && undoManager.canUndo()); |
|
|
|
actionRedo.setEnabled(undoManager != null && undoManager.canRedo()); |
|
|
|
} |
|
|
|
|
|
|
|
private void initComponents() |
|
|
|
{ |
|
|
|
setupActions(); |
|
|
|
editMenu = new javax.swing.JMenu(); |
|
|
|
{ |
|
|
|
JMenuItem cut = new javax.swing.JMenuItem(); |
|
|
|
cut.setAction(menuActionCut); |
|
|
|
cut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK)); |
|
|
|
|
|
|
|
JMenuItem copy = new javax.swing.JMenuItem(); |
|
|
|
copy.setAction(menuActionCopy); |
|
|
|
copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK)); |
|
|
|
|
|
|
|
JMenuItem paste = new javax.swing.JMenuItem(); |
|
|
|
paste.setAction(menuActionPaste); |
|
|
|
paste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK)); |
|
|
|
|
|
|
|
JMenuItem delete = new javax.swing.JMenuItem(); |
|
|
|
delete.setAction(menuActionDelete); |
|
|
|
delete.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK)); |
|
|
|
|
|
|
|
JSeparator jSeparator3 = new javax.swing.JSeparator(); |
|
|
|
|
|
|
|
JMenuItem selectAll = new javax.swing.JMenuItem(); |
|
|
|
selectAll.setAction(menuActionSelectAll); |
|
|
|
selectAll.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK)); |
|
|
|
|
|
|
|
editMenu.setMnemonic(KeyEvent.VK_E); |
|
|
|
editMenu.setMnemonic(KeyEvent.VK_E); |
|
|
|
editMenu.setText("Edit"); |
|
|
|
editMenu.add(cut); |
|
|
|
editMenu.add(copy); |
|
|
|
editMenu.add(paste); |
|
|
|
editMenu.add(delete); |
|
|
|
editMenu.add(jSeparator3); |
|
|
|
editMenu.add(selectAll); |
|
|
|
|
|
|
|
editMenu.add(new JMenuItem(actionUndo)); |
|
|
|
editMenu.add(new JMenuItem(actionRedo)); |
|
|
|
editMenu.add(new JSeparator()); |
|
|
|
editMenu.add(new JMenuItem(actionCut)); |
|
|
|
editMenu.add(new JMenuItem(actionCopy)); |
|
|
|
editMenu.add(new JMenuItem(actionPaste)); |
|
|
|
editMenu.add(new JMenuItem(actionDelete)); |
|
|
|
editMenu.add(new JSeparator()); |
|
|
|
editMenu.add(new JMenuItem(actionSelectAll)); |
|
|
|
} |
|
|
|
|
|
|
|
editToolBar = new JToolBar(); |
|
|
|
{ |
|
|
|
JButton b1 = new JButton(toolbarActionCut); |
|
|
|
|
|
|
|
JButton b6 = new JButton(actionUndo); |
|
|
|
b6.setToolTipText("Undo"); |
|
|
|
b6.setText(""); |
|
|
|
editToolBar.add(b6); |
|
|
|
|
|
|
|
JButton b7 = new JButton(actionRedo); |
|
|
|
b7.setToolTipText("Redo"); |
|
|
|
b7.setText(""); |
|
|
|
editToolBar.add(b7); |
|
|
|
|
|
|
|
//editToolBar.add(new JSeparator()); |
|
|
|
|
|
|
|
JButton b1 = new JButton(actionCut); |
|
|
|
b1.setToolTipText("Cut"); |
|
|
|
b1.setText(""); |
|
|
|
|
|
|
|
editToolBar.add(b1); |
|
|
|
|
|
|
|
JButton b2 = new JButton(toolbarActionCopy); |
|
|
|
JButton b2 = new JButton(actionCopy); |
|
|
|
b2.setToolTipText("Copy"); |
|
|
|
b2.setText(""); |
|
|
|
editToolBar.add(b2); |
|
|
|
|
|
|
|
JButton b3 = new JButton(toolbarActionPaste); |
|
|
|
JButton b3 = new JButton(actionPaste); |
|
|
|
b3.setToolTipText("Paste"); |
|
|
|
b3.setText(""); |
|
|
|
editToolBar.add(b3); |
|
|
|
|
|
|
|
JButton b4 = new JButton(toolbarActionDelete); |
|
|
|
JButton b4 = new JButton(actionDelete); |
|
|
|
b4.setToolTipText("Delete"); |
|
|
|
b4.setText(""); |
|
|
|
editToolBar.add(b4); |
|
|
|
|
|
|
|
//editToolBar.add(new JSeparator()); |
|
|
|
|
|
|
|
JButton b5 = new JButton(actionSelectAll); |
|
|
|
b5.setToolTipText("Select all"); |
|
|
|
b5.setText(""); |
|
|
|
editToolBar.add(b5); |
|
|
|
} |
|
|
|
editToolBar.setFloatable(false); |
|
|
|
} |
|
|
|
|
|
|
|
/* Send GUIClipboardEvents to the focussed GUIPlugin */ |
|
|
|
|
|
|
|
private void setupActions() |
|
|
|
{ |
|
|
|
menuActionCut = new AbstractAction() |
|
|
|
actionUndo = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.CUT, getFocussedComponent())); |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.UNDO, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
menuActionCut.putValue(Action.LONG_DESCRIPTION, "Copys the currently selected item/text to the clipboard and then removes it."); |
|
|
|
//actionCut.putValue(Action.SHORT_DESCRIPTION, "Cut"); |
|
|
|
menuActionCut.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_C)); |
|
|
|
menuActionCut.putValue(Action.NAME, "Cut"); |
|
|
|
menuActionCut.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCut.png")); |
|
|
|
actionUndo.putValue(Action.LONG_DESCRIPTION, "Undo the last edit."); |
|
|
|
actionUndo.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_U)); |
|
|
|
actionUndo.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionUndo.putValue(Action.NAME, "Undo"); |
|
|
|
actionUndo.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallUndo.png")); |
|
|
|
|
|
|
|
toolbarActionCut = new AbstractAction() |
|
|
|
actionRedo = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.CUT, getFocussedComponent())); |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.REDO, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
toolbarActionCut.putValue(Action.LONG_DESCRIPTION, "Copys the currently selected item/text to the clipboard and then removes it."); |
|
|
|
toolbarActionCut.putValue(Action.NAME, "Cut"); |
|
|
|
toolbarActionCut.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCut.png")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
menuActionCopy = new AbstractAction() |
|
|
|
actionRedo.putValue(Action.LONG_DESCRIPTION, "Redo the last edit."); |
|
|
|
actionRedo.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_R)); |
|
|
|
actionRedo.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionRedo.putValue(Action.NAME, "Redo"); |
|
|
|
actionRedo.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallRedo.png")); |
|
|
|
|
|
|
|
|
|
|
|
actionCut = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.COPY, getFocussedComponent())); |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.CUT, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
menuActionCopy.putValue(Action.LONG_DESCRIPTION, "Copys the currently selected item/text to the clipboard."); |
|
|
|
menuActionCopy.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_O)); |
|
|
|
menuActionCopy.putValue(Action.NAME, "Copy"); |
|
|
|
menuActionCopy.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCopy.png")); |
|
|
|
|
|
|
|
toolbarActionCopy = new AbstractAction() |
|
|
|
actionCut.putValue(Action.LONG_DESCRIPTION, "Copys the currently selected item/text to the clipboard and then removes it."); |
|
|
|
actionCut.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_C)); |
|
|
|
actionCut.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionCut.putValue(Action.NAME, "Cut"); |
|
|
|
actionCut.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCut.png")); |
|
|
|
|
|
|
|
actionCopy = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.COPY, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
toolbarActionCopy.putValue(Action.LONG_DESCRIPTION, "Copys the currently selected item/text to the clipboard."); |
|
|
|
toolbarActionCopy.putValue(Action.NAME, "Copy"); |
|
|
|
toolbarActionCopy.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCopy.png")); |
|
|
|
|
|
|
|
menuActionPaste = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.PASTE, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
menuActionPaste.putValue(Action.LONG_DESCRIPTION, "Pastes the contents of the clipboard."); |
|
|
|
menuActionPaste.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P)); |
|
|
|
menuActionPaste.putValue(Action.NAME, "Paste"); |
|
|
|
menuActionPaste.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPaste.png")); |
|
|
|
|
|
|
|
toolbarActionPaste = new AbstractAction() |
|
|
|
actionCopy.putValue(Action.LONG_DESCRIPTION, "Copys the currently selected item/text to the clipboard."); |
|
|
|
actionCopy.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_O)); |
|
|
|
actionCopy.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionCopy.putValue(Action.NAME, "Copy"); |
|
|
|
actionCopy.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCopy.png")); |
|
|
|
|
|
|
|
actionPaste = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.PASTE, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
toolbarActionPaste.putValue(Action.LONG_DESCRIPTION, "Pastes the contents of the clipboard."); |
|
|
|
toolbarActionPaste.putValue(Action.NAME, "Paste"); |
|
|
|
toolbarActionPaste.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPaste.png")); |
|
|
|
|
|
|
|
menuActionDelete = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.DELETE, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
menuActionDelete.putValue(Action.LONG_DESCRIPTION, "Removes the currently selected item"); |
|
|
|
menuActionDelete.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_D)); |
|
|
|
menuActionDelete.putValue(Action.NAME, "Delete"); |
|
|
|
menuActionDelete.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallDelete.png")); |
|
|
|
actionPaste.putValue(Action.LONG_DESCRIPTION, "Pastes the contents of the clipboard."); |
|
|
|
actionPaste.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P)); |
|
|
|
actionPaste.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionPaste.putValue(Action.NAME, "Paste"); |
|
|
|
actionPaste.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPaste.png")); |
|
|
|
|
|
|
|
|
|
|
|
toolbarActionDelete = new AbstractAction() |
|
|
|
actionDelete = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.DELETE, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
toolbarActionDelete.putValue(Action.LONG_DESCRIPTION, "Removes the currently selected item"); |
|
|
|
toolbarActionDelete.putValue(Action.NAME, "Delete"); |
|
|
|
toolbarActionDelete.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallDelete.png")); |
|
|
|
|
|
|
|
menuActionSelectAll = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.SELECT_ALL, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
menuActionSelectAll.putValue(Action.LONG_DESCRIPTION, "Selects all items of the focussed component."); |
|
|
|
menuActionSelectAll.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_S)); |
|
|
|
menuActionSelectAll.putValue(Action.NAME, "Select all"); |
|
|
|
menuActionSelectAll.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallSelectAll.png")); |
|
|
|
actionDelete.putValue(Action.LONG_DESCRIPTION, "Removes the currently selected item"); |
|
|
|
actionDelete.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_D)); |
|
|
|
actionDelete.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionDelete.putValue(Action.NAME, "Delete"); |
|
|
|
actionDelete.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallDelete.png")); |
|
|
|
|
|
|
|
toolbarActionSelectAll = new AbstractAction() |
|
|
|
actionSelectAll = new AbstractAction() |
|
|
|
{ |
|
|
|
public void actionPerformed(ActionEvent e) |
|
|
|
{ |
|
|
|
notifyEventListeners(new GUIClipboardEvent(GUIClipboardEvent.SELECT_ALL, getFocussedComponent())); |
|
|
|
} |
|
|
|
}; |
|
|
|
toolbarActionSelectAll.putValue(Action.LONG_DESCRIPTION, "Selects all items of the focussed component."); |
|
|
|
toolbarActionSelectAll.putValue(Action.NAME, "Select all"); |
|
|
|
toolbarActionSelectAll.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallSelectAll.png")); |
|
|
|
actionSelectAll.putValue(Action.LONG_DESCRIPTION, "Selects all items of the focussed component."); |
|
|
|
actionSelectAll.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_S)); |
|
|
|
actionSelectAll.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); |
|
|
|
actionSelectAll.putValue(Action.NAME, "Select all"); |
|
|
|
actionSelectAll.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallSelectAll.png")); |
|
|
|
} |
|
|
|
|
|
|
|
public OptionsPanel getOptions() |
|
|
|
@ -282,5 +360,40 @@ public class GUIClipboard extends GUIPlugin |
|
|
|
|
|
|
|
public void notifySettings(prism.PrismSettings settings) |
|
|
|
{} |
|
|
|
|
|
|
|
public Action getUndoAction() { |
|
|
|
return actionUndo; |
|
|
|
} |
|
|
|
|
|
|
|
public Action getRedoAction() { |
|
|
|
return actionRedo; |
|
|
|
} |
|
|
|
|
|
|
|
public Action getCutAction() { |
|
|
|
return actionCut; |
|
|
|
} |
|
|
|
|
|
|
|
public Action getCopyAction() { |
|
|
|
return actionCopy; |
|
|
|
} |
|
|
|
|
|
|
|
public Action getPasteAction() { |
|
|
|
return actionPaste; |
|
|
|
} |
|
|
|
|
|
|
|
public Action getDeleteAction() { |
|
|
|
return actionDelete; |
|
|
|
} |
|
|
|
|
|
|
|
public Action getSelectAllAction() { |
|
|
|
return actionSelectAll; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |