r1185 - in jaxx/trunk/jaxx-compiler-api: . src/main/java/jaxx/compiler src/main/java/jaxx/tags
Author: tchemit Date: 2009-01-24 20:59:24 +0000 (Sat, 24 Jan 2009) New Revision: 1185 Modified: jaxx/trunk/jaxx-compiler-api/changelog.txt jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/compiler/CompilerOptions.java jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/tags/DefaultComponentHandler.java Log: introduce a flag useUIManagerForIcon to retreave icons from UIManager Modified: jaxx/trunk/jaxx-compiler-api/changelog.txt =================================================================== --- jaxx/trunk/jaxx-compiler-api/changelog.txt 2009-01-24 10:44:23 UTC (rev 1184) +++ jaxx/trunk/jaxx-compiler-api/changelog.txt 2009-01-24 20:59:24 UTC (rev 1185) @@ -1,4 +1,5 @@ 1.1 chemit 200901?? + * 20090124 [chemit] - introduce a flag useUIManagerForIcon to retreave icons from UIManager * 20090123 [chemit] - cache the lineSeparator property in JAXXCompiler - can directly give the icon relatif path (in /icons/ directory) - add an actionIcon attribute to be surronded in the Util.createActionIcon Modified: jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/compiler/CompilerOptions.java =================================================================== --- jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/compiler/CompilerOptions.java 2009-01-24 10:44:23 UTC (rev 1184) +++ jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/compiler/CompilerOptions.java 2009-01-24 20:59:24 UTC (rev 1185) @@ -1,5 +1,7 @@ package jaxx.compiler; +import org.apache.commons.lang.builder.ToStringBuilder; + import java.io.File; /** @@ -31,10 +33,14 @@ /** default error ui */ private Class<?> defaultErrorUI; - + private ClassLoader classLoader; private Class<? extends JAXXCompiler> compilerClass; + + /** a flag to use {@link javax.swing.UIManager} to retreave icons. */ + private boolean useUIManagerForIcon; + /** * Returns the target directory, generally specified with the "-d" option on the command line. * @@ -173,6 +179,10 @@ return i18nable; } + public boolean isUseUIManagerForIcon() { + return useUIManagerForIcon; + } + public void setI18nable(boolean i18nable) { this.i18nable = i18nable; } @@ -209,22 +219,13 @@ this.resetAfterCompile = resetAfterCompile; } + public void setUseUIManagerForIcon(boolean useUIManagerForIcon) { + this.useUIManagerForIcon = useUIManagerForIcon; + } + @Override public String toString() { - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("\nclassPath : ").append(getClassPath()); - sb.append("\ncompilerClass : ").append(compilerClass); - sb.append("\njavaOut : ").append(getTargetDirectory()); - sb.append("\noutClass : ").append(getJavacTargetDirectory()); - sb.append("\njavacOpts : ").append(getJavacOpts()); - sb.append("\nverbose : ").append(isVerbose()); - sb.append("\noptiomize : ").append(getOptimize()); - sb.append("\ni18nable : ").append(isI18nable()); - sb.append("\naddLogger : ").append(isAddLogger()); - sb.append("\nresetAfterCompile : ").append(isResetAfterCompile()); - sb.append("\njaxxContextImplementorClass : ").append(getJaxxContextImplementorClass()); - sb.append("\nextraImports : ").append(getExtraImports()); - return sb.toString(); + return ToStringBuilder.reflectionToString(this); } Modified: jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/tags/DefaultComponentHandler.java =================================================================== --- jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/tags/DefaultComponentHandler.java 2009-01-24 10:44:23 UTC (rev 1184) +++ jaxx/trunk/jaxx-compiler-api/src/main/java/jaxx/tags/DefaultComponentHandler.java 2009-01-24 20:59:24 UTC (rev 1185) @@ -200,7 +200,11 @@ if ("icon".equals(propertyName)) { if (!(stringValue.startsWith("{") || stringValue.endsWith("}"))) { // this is a customized icon, add the icon creation code - stringValue = "{" + jaxx.runtime.Util.class.getName() + ".createImageIcon(\"" + stringValue + "\")}"; + if (compiler.getOptions().isUseUIManagerForIcon()) { + stringValue = "{" + jaxx.runtime.Util.class.getName() + ".getUIManagerIcon(\"" + stringValue + "\")}"; + } else { + stringValue = "{" + jaxx.runtime.Util.class.getName() + ".createImageIcon(\"" + stringValue + "\")}"; + } } } else if ("actionIcon".equals(propertyName)) { // customized actionIcon property @@ -210,7 +214,11 @@ return; } propertyName = "icon"; - stringValue = "{" + jaxx.runtime.Util.class.getName() + ".createActionIcon(\"" + stringValue + "\")}"; + if (compiler.getOptions().isUseUIManagerForIcon()) { + stringValue = "{" + jaxx.runtime.Util.class.getName() + ".getUIManagerActionIcon(\"" + stringValue + "\")}"; + } else { + stringValue = "{" + jaxx.runtime.Util.class.getName() + ".createActionIcon(\"" + stringValue + "\")}"; + } } super.setAttribute(object, propertyName, stringValue, inline, compiler); }
participants (1)
-
tchemit@users.labs.libre-entreprise.org