/** * See createPopupMenuActions() in RTextArea. * TODO: Remove these horrible hacks and move localizing of actions into * the editor kits, where it should be! The context menu should contain * actions from the editor kits. */ private static void createRstaPopupMenuActions() { ResourceBundle msg = ResourceBundle.getBundle(MSG); toggleCurrentFoldAction = new RSyntaxTextAreaEditorKit. ToggleCurrentFoldAction(); toggleCurrentFoldAction.setProperties(msg, "Action.ToggleCurrentFold"); collapseAllCommentFoldsAction = new RSyntaxTextAreaEditorKit. CollapseAllCommentFoldsAction(); collapseAllCommentFoldsAction.setProperties(msg, "Action.CollapseCommentFolds"); collapseAllFoldsAction = new RSyntaxTextAreaEditorKit.CollapseAllFoldsAction(true); expandAllFoldsAction = new RSyntaxTextAreaEditorKit.ExpandAllFoldsAction(true); }
cutAction.setProperties(msg, "Action.Cut"); cutAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, mod)); copyAction = new RTextAreaEditorKit.CopyAction(); copyAction.setProperties(msg, "Action.Copy"); copyAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, mod)); pasteAction = new RTextAreaEditorKit.PasteAction(); pasteAction.setProperties(msg, "Action.Paste"); pasteAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, mod)); deleteAction = new RTextAreaEditorKit.DeleteNextCharAction(); deleteAction.setProperties(msg, "Action.Delete"); deleteAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); undoAction = new RTextAreaEditorKit.UndoAction(); undoAction.setProperties(msg, "Action.Undo"); undoAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, mod)); redoAction = new RTextAreaEditorKit.RedoAction(); redoAction.setProperties(msg, "Action.Redo"); redoAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, mod)); selectAllAction = new RTextAreaEditorKit.SelectAllAction(); selectAllAction.setProperties(msg, "Action.SelectAll"); selectAllAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, mod));
/** * See createPopupMenuActions() in RTextArea. * TODO: Remove these horrible hacks and move localizing of actions into * the editor kits, where it should be! The context menu should contain * actions from the editor kits. */ private static void createRstaPopupMenuActions() { ResourceBundle msg = ResourceBundle.getBundle(MSG); toggleCurrentFoldAction = new RSyntaxTextAreaEditorKit. ToggleCurrentFoldAction(); toggleCurrentFoldAction.setProperties(msg, "Action.ToggleCurrentFold"); collapseAllCommentFoldsAction = new RSyntaxTextAreaEditorKit. CollapseAllCommentFoldsAction(); collapseAllCommentFoldsAction.setProperties(msg, "Action.CollapseCommentFolds"); collapseAllFoldsAction = new RSyntaxTextAreaEditorKit.CollapseAllFoldsAction(true); expandAllFoldsAction = new RSyntaxTextAreaEditorKit.ExpandAllFoldsAction(true); }
cutAction.setProperties(msg, "Action.Cut"); cutAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, mod)); copyAction = new RTextAreaEditorKit.CopyAction(); copyAction.setProperties(msg, "Action.Copy"); copyAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, mod)); pasteAction = new RTextAreaEditorKit.PasteAction(); pasteAction.setProperties(msg, "Action.Paste"); pasteAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, mod)); deleteAction = new RTextAreaEditorKit.DeleteNextCharAction(); deleteAction.setProperties(msg, "Action.Delete"); deleteAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); undoAction = new RTextAreaEditorKit.UndoAction(); undoAction.setProperties(msg, "Action.Undo"); undoAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, mod)); redoAction = new RTextAreaEditorKit.RedoAction(); redoAction.setProperties(msg, "Action.Redo"); redoAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, mod)); selectAllAction = new RTextAreaEditorKit.SelectAllAction(); selectAllAction.setProperties(msg, "Action.SelectAll"); selectAllAction.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, mod));