- add way to show "USERINFO" notfications via logging

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10261 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 0c403cfc9c
commit 116eaf1bb8
  1. 5
      sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java
  2. 9
      sdk/jme3-core/src/com/jme3/gde/core/scene/ApplicationLogHandler.java

@ -35,8 +35,8 @@ import com.jme3.asset.AssetEventListener;
import com.jme3.asset.AssetKey;
import com.jme3.export.Savable;
import com.jme3.export.binary.BinaryExporter;
import com.jme3.gde.core.scene.ApplicationLogHandler.LogLevel;
import com.jme3.gde.core.scene.SceneApplication;
import com.jme3.gde.core.util.notify.NotifyUtil;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
@ -52,7 +52,6 @@ import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.awt.StatusDisplayer;
import org.openide.cookies.SaveCookie;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
@ -223,7 +222,7 @@ public class AssetDataObject extends MultiDataObject {
}
}
progressHandle.finish();
NotifyUtil.info("Saved file", "File " + getPrimaryFile().getNameExt() + " saved successfully.");
logger.log(LogLevel.USERINFO, "File {0} saved successfully", getPrimaryFile().getNameExt());
setModified(false);
}

@ -50,6 +50,13 @@ import org.openide.windows.InputOutput;
*/
public class ApplicationLogHandler extends Handler implements Callable<JButton> {
public static class LogLevel extends Level {
public static final Level USERINFO = new LogLevel("User Info", 801, "User Info Log Level");
public LogLevel(String name, int level, String string) {
super(name, level, string);
}
}
InputOutput io = IOProvider.getDefault().getIO("Application", true);
JmeFormatter formatter = new JmeFormatter();
ActionListener listener = new ActionListener() {
@ -78,7 +85,7 @@ public class ApplicationLogHandler extends Handler implements Callable<JButton>
NotifyUtil.show("Warning", formatter.formatMessage(record), MessageType.WARNING, listener, 5000);
} else if (record.getLevel().equals(Level.INFO)) {
io.getOut().println(formatter.formatMessage(record));
} else if (record.getLevel().intValue()>800) {
} else if (record.getLevel().intValue() > 800) {
//larger than INFO:
NotifyUtil.show("Info", formatter.formatMessage(record), MessageType.INFO, listener, 3000);
io.getOut().println(formatter.formatMessage(record));

Loading…
Cancel
Save