- Make log warning/exception bubbles open log.. :)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10255 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 026aa8a235
commit db490dc1c1
  1. 2
      sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java
  2. 17
      sdk/jme3-core/src/com/jme3/gde/core/scene/ApplicationLogHandler.java

@ -223,7 +223,7 @@ public class AssetDataObject extends MultiDataObject {
} }
} }
progressHandle.finish(); progressHandle.finish();
StatusDisplayer.getDefault().setStatusText(getPrimaryFile().getNameExt() + " saved."); NotifyUtil.info("Saved file", "File " + getPrimaryFile().getNameExt() + " saved successfully.");
setModified(false); setModified(false);
} }

@ -31,8 +31,11 @@
*/ */
package com.jme3.gde.core.scene; package com.jme3.gde.core.scene;
import com.jme3.gde.core.util.notify.MessageType;
import com.jme3.gde.core.util.notify.NotifyUtil; import com.jme3.gde.core.util.notify.NotifyUtil;
import com.jme3.util.JmeFormatter; import com.jme3.util.JmeFormatter;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Handler; import java.util.logging.Handler;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.LogRecord; import java.util.logging.LogRecord;
@ -47,6 +50,11 @@ public class ApplicationLogHandler extends Handler {
InputOutput io = IOProvider.getDefault().getIO("Application", true); InputOutput io = IOProvider.getDefault().getIO("Application", true);
JmeFormatter formatter = new JmeFormatter(); JmeFormatter formatter = new JmeFormatter();
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
io.select();
}
};
public ApplicationLogHandler() { public ApplicationLogHandler() {
io.setErrSeparated(true); io.setErrSeparated(true);
@ -57,15 +65,16 @@ public class ApplicationLogHandler extends Handler {
if (record.getLevel().equals(Level.SEVERE)) { if (record.getLevel().equals(Level.SEVERE)) {
Throwable thrown = record.getThrown(); Throwable thrown = record.getThrown();
if (thrown != null) { if (thrown != null) {
NotifyUtil.error("Exception!", formatter.formatMessage(record), false); NotifyUtil.show("Exception!", formatter.formatMessage(record), MessageType.EXCEPTION, listener, 0);
}else{ } else {
NotifyUtil.error("Severe error!", formatter.formatMessage(record), true); NotifyUtil.show("Error!", formatter.formatMessage(record), MessageType.ERROR, listener, 10000);
} }
io.getErr().println(formatter.formatMessage(record)); io.getErr().println(formatter.formatMessage(record));
} else if (record.getLevel().equals(Level.WARNING)) { } else if (record.getLevel().equals(Level.WARNING)) {
io.getErr().println(formatter.formatMessage(record)); io.getErr().println(formatter.formatMessage(record));
NotifyUtil.warn("Warning!", formatter.formatMessage(record), true); NotifyUtil.show("Warning", formatter.formatMessage(record), MessageType.WARNING, listener, 5000);
} else if (record.getLevel().equals(Level.INFO)) { } else if (record.getLevel().equals(Level.INFO)) {
// NotifyUtil.show("Message", formatter.formatMessage(record), MessageType.INFO, listener, 3000);
io.getOut().println(formatter.formatMessage(record)); io.getOut().println(formatter.formatMessage(record));
} else { } else {
io.getOut().println(formatter.formatMessage(record)); io.getOut().println(formatter.formatMessage(record));

Loading…
Cancel
Save