diff --git a/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextAreaDefaultInputMap.java b/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextAreaDefaultInputMap.java index f9171f74a..715ab47fe 100644 --- a/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextAreaDefaultInputMap.java +++ b/designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextAreaDefaultInputMap.java @@ -34,7 +34,7 @@ public class RSyntaxTextAreaDefaultInputMap extends RTADefaultInputMap { */ public RSyntaxTextAreaDefaultInputMap() { - int defaultMod = getDefaultModifier(); + int defaultMod = DEFAULT_MODIFIER; //int ctrl = InputEvent.CTRL_MASK; int shift = InputEvent.SHIFT_MASK; //int alt = InputEvent.ALT_MASK; diff --git a/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 59afdba51..8da862fb6 100644 --- a/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -134,8 +134,7 @@ public class DesignerLogHandler { private UIMenuItem clear; private LogHandlerArea() { - jTextArea = new JTextPane(); - + jTextArea = initLogJTextArea(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); UIScrollPane js = new UIScrollPane(jTextArea); this.add(js, BorderLayout.CENTER); @@ -190,6 +189,23 @@ public class DesignerLogHandler { }); } + private JTextPane initLogJTextArea() { + JTextPane resultPane = new JTextPane(); + InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), "copy"); + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), "select-all"); + ActionMap actionMap = resultPane.getActionMap(); + actionMap.put("clear", new AbstractAction() { + public void actionPerformed(ActionEvent evt) { + resultPane.setText(""); + caption.clearMessage(); + DesignerLogImpl.getInstance().clear(); + } + }); + return resultPane; + } + public void printStackTrace(LogRecordTimeProvider logRecordTime) { LogRecord logRecord = logRecordTime.getLogRecord(); Date date = logRecordTime.getDate(); @@ -299,6 +315,4 @@ public class DesignerLogHandler { }; } - - } \ No newline at end of file