# HG changeset patch # User wenzelm # Date 1284060633 -7200 # Node ID e9a442606db3c8cca122b7da23333da90517ba92 # Parent a0c0698e56c06bf4f8320ac640938be2c8dd6b2d Isabelle.load_icon with some sanity checks; diff -r a0c0698e56c0 -r e9a442606db3 src/Tools/jEdit/src/jedit/isabelle_markup.scala --- a/src/Tools/jEdit/src/jedit/isabelle_markup.scala Thu Sep 09 20:09:13 2010 +0200 +++ b/src/Tools/jEdit/src/jedit/isabelle_markup.scala Thu Sep 09 21:30:33 2010 +0200 @@ -11,7 +11,6 @@ import java.awt.Color -import org.gjt.sp.jedit.GUIUtilities import org.gjt.sp.jedit.syntax.Token @@ -31,8 +30,8 @@ { def >= (that: Icon): Boolean = this.priority >= that.priority } - val warning_icon = new Icon(1, GUIUtilities.loadIcon("16x16/status/dialog-warning.png")) - val error_icon = new Icon(2, GUIUtilities.loadIcon("16x16/status/dialog-error.png")) + val warning_icon = new Icon(1, Isabelle.load_icon("16x16/status/dialog-warning.png")) + val error_icon = new Icon(2, Isabelle.load_icon("16x16/status/dialog-error.png")) /* command status */ diff -r a0c0698e56c0 -r e9a442606db3 src/Tools/jEdit/src/jedit/plugin.scala --- a/src/Tools/jEdit/src/jedit/plugin.scala Thu Sep 09 20:09:13 2010 +0200 +++ b/src/Tools/jEdit/src/jedit/plugin.scala Thu Sep 09 21:30:33 2010 +0200 @@ -15,12 +15,15 @@ import scala.collection.mutable -import org.gjt.sp.jedit.{jEdit, EBMessage, EBPlugin, Buffer, EditPane, ServiceManager, View} +import org.gjt.sp.jedit.{jEdit, GUIUtilities, EBMessage, EBPlugin, + Buffer, EditPane, ServiceManager, View} import org.gjt.sp.jedit.buffer.JEditBuffer import org.gjt.sp.jedit.textarea.{JEditTextArea, TextArea} import org.gjt.sp.jedit.msg.{BufferUpdate, EditPaneUpdate, PropertiesChanged} import org.gjt.sp.jedit.gui.DockableWindowManager +import org.gjt.sp.util.Log + object Isabelle { @@ -106,6 +109,17 @@ } + /* icons */ + + def load_icon(name: String): javax.swing.Icon = + { + val icon = GUIUtilities.loadIcon(name) + if (icon.getIconWidth < 0 || icon.getIconHeight < 0) + Log.log(Log.ERROR, icon, "Bad icon: " + name); + icon + } + + /* settings */ def default_logic(): String =