Browse Source

Merge branch 'feature/10.0' of https://cloud.finedevelop.com/scm/~wim.zhai/Xdesign into feature/10.0

research/11.0
Wim.Zhai 5 years ago
parent
commit
09fb6f5b66
  1. 34
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

34
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -199,6 +200,7 @@ public class DesignerLogHandler {
jTextArea.addMouseListener(new MouseAdapter() { jTextArea.addMouseListener(new MouseAdapter() {
// check for right click // check for right click
@Override
public void mousePressed(MouseEvent event) { public void mousePressed(MouseEvent event) {
if (event.getButton() == MouseEvent.BUTTON3) { if (event.getButton() == MouseEvent.BUTTON3) {
@ -219,6 +221,7 @@ public class DesignerLogHandler {
ActionMap actionMap = resultPane.getActionMap(); ActionMap actionMap = resultPane.getActionMap();
actionMap.put("clear", new AbstractAction() { actionMap.put("clear", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
resultPane.setText(""); resultPane.setText("");
@ -260,20 +263,24 @@ public class DesignerLogHandler {
printMessage(message, intLevel, date, null); printMessage(message, intLevel, date, null);
} }
private void printMessage(String msg, int intLevel, Date date, Throwable e) { private void printMessage(final String msg, final int intLevel, final Date date, final Throwable e) {
UIUtil.invokeLaterIfNeeded(new Runnable() {
this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0); @Override
String message = appendLocaleMark(msg, intLevel); public void run() {
this.log(message, intLevel); LogHandlerArea.this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0);
setMessage(message, intLevel); String message = appendLocaleMark(msg, intLevel);
if (e == null) { LogHandlerArea.this.log(message, intLevel);
return; setMessage(message, intLevel);
} if (e == null) {
return;
}
StackTraceElement[] traceElements = e.getStackTrace(); StackTraceElement[] traceElements = e.getStackTrace();
for (int i = 0; i < traceElements.length; i++) { for (StackTraceElement traceElement : traceElements) {
this.log("\t" + "at " + traceElements[i].toString() + "\n", 0); LogHandlerArea.this.log("\t" + "at " + traceElement.toString() + "\n", 0);
} }
}
});
} }
private void log(String str, int style) { private void log(String str, int style) {
@ -346,6 +353,7 @@ public class DesignerLogHandler {
ActionListener popupListener = new ActionListener() { ActionListener popupListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.selectAll.getText())) { if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.selectAll.getText())) {

Loading…
Cancel
Save