Browse Source

修logPane的快捷键

master
hzzz 8 years ago
parent
commit
9baf0a4502
  1. 2
      designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextAreaDefaultInputMap.java
  2. 22
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

2
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;

22
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 {
};
}
}
Loading…
Cancel
Save