You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(16) |
Mar
(41) |
Apr
(19) |
May
(3) |
Jun
(34) |
Jul
(40) |
Aug
(40) |
Sep
(166) |
Oct
(78) |
Nov
(42) |
Dec
(54) |
2005 |
Jan
(2) |
Feb
(19) |
Mar
(19) |
Apr
(31) |
May
(50) |
Jun
(16) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(29) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
(5) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Kurt R. <kr...@us...> - 2005-04-22 15:11:41
|
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31179/src/net/sf/xframe/xsddoc Modified Files: Processor.java Log Message: fixed bug [1165772] xsddoc maven plugin fails with Java 1.5 Index: Processor.java =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/Processor.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Processor.java 22 Apr 2005 14:46:08 -0000 1.38 --- Processor.java 22 Apr 2005 15:11:32 -0000 1.39 *************** *** 609,612 **** --- 609,613 ---- private void initTransformers() throws TransformerConfigurationException, IOException { + Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); tFactory = TransformerFactory.newInstance(); tFactory.setErrorListener(new ProcessorErrorListener()); |
From: Kurt R. <kr...@us...> - 2005-04-22 14:59:02
|
Update of /cvsroot/xframe/xsddoc/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22919/xdocs Modified Files: index.xml usage-maven.xml news.xml Log Message: version updated to uncoming release 0.8beta Index: news.xml =================================================================== RCS file: /cvsroot/xframe/xsddoc/xdocs/news.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** news.xml 26 Feb 2005 14:44:11 -0000 1.5 --- news.xml 22 Apr 2005 14:58:52 -0000 1.6 *************** *** 33,36 **** --- 33,70 ---- <section name="News and Status"> + <subsection name="Apr. 24, 2005 - xsddoc 0.8 beta released"> + <p>The xframe team is pleased to announce release 0.8-beta + of the sub project xsddoc.</p> + <p>The xsddoc subproject of xframe is an Open Source documentation tool + for W3C XML Schema based on XSLT and XalanJ. With xsddoc you can + generate documentation of your XML Schema in a JavaDoc like visualisation.</p> + <p>This Announcement notes the significant changes in Release 0.7-beta + compared to Release to 0.7-beta:</p> + <p>New features:</p> + <ul> + <li>New command-line and Apache Ant argument: -cf (create out folder if missing)</li> + <li>New command-line and Apache Ant argument: -launch (launch documentation in browser)</li> + <li>Nested Elements Detail section removed (didn't provide any information)</li> + <li>maven-plugin: exclude property</li> + <li>maven-plugin: load schema thru proxy</li> + </ul> + <p>Fixes for the following bugs:</p> + <ul> + <li>1151806 Duplicate message output on all errors and warnings</li> + <li>1151805 Short documentation missing in namespace summary</li> + <li>1151802 @type ref to included schema not shown</li> + <li>1151800 Nested element summary</li> + <li>1151799 Attributes of base type of restriction not included</li> + <li>1151790 imported from redefined not in overview pages</li> + <li>1151295 xsddoc generates broken links</li> + <li>1123251 maven plugin can't find xalan</li> + <li>1089703 [maven-xsddoc-plugin] fails if maven.xsddoc.src not present</li> + <li>1084493 invalid href in source: element references</li> + <li>1082836 missing namespace refs on summary if only redefineds</li> + <li>1082834 circular loop with redefined attribute groups</li> + <li>1045819 Cyclic includes in XSDs cause xsddoc to fail</li> + </ul> + </subsection> + <subsection name="Feb. 26, 2005 - xsddoc 0.7 beta released"> <p>The xframe team is pleased to announce release 0.7-beta Index: index.xml =================================================================== RCS file: /cvsroot/xframe/xsddoc/xdocs/index.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.xml 9 Dec 2004 12:43:54 -0000 1.5 --- index.xml 22 Apr 2005 14:58:52 -0000 1.6 *************** *** 57,63 **** <section name="Status"> ! <p>The latest version of <code>xsddoc</code> is release 0.7 beta.</p> <p>This release contains fixes for bugs reported by the ! community since the previous release.</p> <p>The future plan is to release a new version approximately every three months until all missing features are --- 57,64 ---- <section name="Status"> ! <p>The latest version of <code>xsddoc</code> is release 0.8 beta.</p> <p>This release contains fixes for bugs reported by the ! community since the previous release and some usefull new options ! for easier integration into existing tools.</p> <p>The future plan is to release a new version approximately every three months until all missing features are *************** *** 68,74 **** <a target="_bank" href="http://sourceforge.net/project/showfiles.php?group_id=48863&package_id=42075">here</a>.</p> <p>If you have Apache XalanJ installed, you can download the standard ! distribution file <code>xsddoc-0.7-beta.zip</code>. Only in case you don't have Apache XalanJ, you should download the distribution file ! <code>xsddoc-0.7-beta-full.zip</code> in order to have all files necessary to run xsddoc. All distribution files contain the full source code of the project.</p> --- 69,75 ---- <a target="_bank" href="http://sourceforge.net/project/showfiles.php?group_id=48863&package_id=42075">here</a>.</p> <p>If you have Apache XalanJ installed, you can download the standard ! distribution file <code>xsddoc-0.8-beta.zip</code>. Only in case you don't have Apache XalanJ, you should download the distribution file ! <code>xsddoc-0.8-beta-full.zip</code> in order to have all files necessary to run xsddoc. All distribution files contain the full source code of the project.</p> Index: usage-maven.xml =================================================================== RCS file: /cvsroot/xframe/xsddoc/xdocs/usage-maven.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** usage-maven.xml 9 Dec 2004 12:43:54 -0000 1.4 --- usage-maven.xml 22 Apr 2005 14:58:52 -0000 1.5 *************** *** 39,43 **** <groupId>xsddoc</groupId> <artifactId>maven-xsddoc-plugin</artifactId> ! <version>0.7</version> </dependency> </pre> --- 39,43 ---- <groupId>xsddoc</groupId> <artifactId>maven-xsddoc-plugin</artifactId> ! <version>0.8</version> </dependency> </pre> |
From: Kurt R. <kr...@us...> - 2005-04-22 14:53:23
|
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18245/src/net/sf/xframe/xsddoc Modified Files: Main.java Log Message: version updated to uncoming release 0.8beta Index: Main.java =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/Main.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Main.java 22 Apr 2005 14:46:08 -0000 1.25 --- Main.java 22 Apr 2005 14:53:12 -0000 1.26 *************** *** 55,59 **** /** version info. */ ! private static final String VERSION = "0.7-beta"; /** --- 55,59 ---- /** version info. */ ! private static final String VERSION = "0.8-beta"; /** |
From: Kurt R. <kr...@us...> - 2005-04-22 14:49:16
|
Update of /cvsroot/xframe/xsddoc/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15909/xdocs Modified Files: install-stylusstudio.xml Log Message: documentation improved Index: install-stylusstudio.xml =================================================================== RCS file: /cvsroot/xframe/xsddoc/xdocs/install-stylusstudio.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** install-stylusstudio.xml 15 Apr 2005 15:56:31 -0000 1.1 --- install-stylusstudio.xml 22 Apr 2005 14:49:07 -0000 1.2 *************** *** 31,34 **** --- 31,41 ---- <body> + <section name="Disclaimer"> + <p>The following is a very simple and not very sofisicated integration of xsddoc into + Stylus Studio. It does just a simple call to xsddoc with the folder of the schema + as the output folder. This is mostly not very good. We are examining better + alternatives, maybe with some simple additional batch-file. Any further suggestions are welcome.</p> + </section> + <section name="Requirements"> <p>You should have a current version of <a href="http://www.stylusstudio.com" target="_blank">Stylus Studio</a> installed.</p> *************** *** 48,55 **** <tt>xsddoc</tt> for the currently open file. The output folder is the same folder as the folder of your schema file. If this is not desired, ! you could e.g. active the option <tt>Prompt for arguments</tt> in the Custom Tools settings of xsddoc, so you can change it before the tool runs.</p> ! <p><img src="./images/stylusstudio-use-xsddoc"/></p> </section> --- 55,62 ---- <tt>xsddoc</tt> for the currently open file. The output folder is the same folder as the folder of your schema file. If this is not desired, ! you could e.g. activate the option <tt>Prompt for arguments</tt> in the Custom Tools settings of xsddoc, so you can change it before the tool runs.</p> ! <p><img src="./images/stylusstudio-use-xsddoc.png"/></p> </section> |
From: Kurt R. <kr...@us...> - 2005-04-22 14:48:57
|
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15511/src/net/sf/xframe/xsddoc/xslt Modified Files: xml2html.xsl Log Message: section of nested components detail removed (doesn't provide any usefull information) Index: xml2html.xsl =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/xml2html.xsl,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** xml2html.xsl 26 Feb 2005 14:59:10 -0000 1.37 --- xml2html.xsl 22 Apr 2005 14:48:49 -0000 1.38 *************** *** 1004,1022 **** </table> </xsl:if> - <xsl:if test="$nested"> - <br/> - <table border="1" cellpadding="3" cellspacing="0" width="100%"> - <tr bgcolor="#CCCCFF" class="TableHeadingColor"> - <td colspan="2"> - <font size="+2"> - <b>Nested Element Detail</b> - </font> - </td> - </tr> - </table> - <xsl:apply-templates select="$nested" mode="detail"> - <xsl:sort select="@name"/> - </xsl:apply-templates> - </xsl:if> <xsl:if test="doc:attribute"> <br/> --- 1004,1007 ---- *************** *** 1209,1213 **** <td> <code> ! <a href="{concat('#elem_', @name)}"> <xsl:value-of select="@name"/> </a> --- 1194,1198 ---- <td> <code> ! <a href="{@href}"> <xsl:value-of select="@name"/> </a> |
From: Kurt R. <kr...@us...> - 2005-04-22 14:47:52
|
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15149/src/net/sf/xframe/xsddoc/xslt Modified Files: component.xsl Log Message: minor change Index: component.xsl =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/component.xsl,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** component.xsl 21 Mar 2005 14:16:32 -0000 1.29 --- component.xsl 22 Apr 2005 14:47:44 -0000 1.30 *************** *** 224,229 **** </xsl:if> </xsl:if> - - <xsl:if test="$type = 'complexType'"> <xsl:choose> --- 224,227 ---- |
From: Kurt R. <kr...@us...> - 2005-04-22 14:47:37
|
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15091/src/net/sf/xframe/xsddoc/util Added Files: BrowserLauncher.java Log Message: Broser launcher added (thanks to Eric Albert) --- NEW FILE: BrowserLauncher.java --- package net.sf.xframe.xsddoc.util; import java.io.File; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** * BrowserLauncher is a class that provides one static method, openURL, which opens the default * web browser for the current user of the system to the given URL. It may support other * protocols depending on the system -- mailto, ftp, etc. -- but that has not been rigorously * tested and is not guaranteed to work. * <p> * Yes, this is platform-specific code, and yes, it may rely on classes on certain platforms * that are not part of the standard JDK. What we're trying to do, though, is to take something * that's frequently desirable but inherently platform-specific -- opening a default browser -- * and allow programmers (you, for example) to do so without worrying about dropping into native * code or doing anything else similarly evil. * <p> * Anyway, this code is completely in Java and will run on all JDK 1.1-compliant systems without * modification or a need for additional libraries. All classes that are required on certain * platforms to allow this to run are dynamically loaded at runtime via reflection and, if not * found, will not cause this to do anything other than returning an error when opening the * browser. * <p> * There are certain system requirements for this class, as it's running through Runtime.exec(), * which is Java's way of making a native system call. Currently, this requires that a Macintosh * have a Finder which supports the GURL event, which is true for Mac OS 8.0 and 8.1 systems that * have the Internet Scripting AppleScript dictionary installed in the Scripting Additions folder * in the Extensions folder (which is installed by default as far as I know under Mac OS 8.0 and * 8.1), and for all Mac OS 8.5 and later systems. On Windows, it only runs under Win32 systems * (Windows 95, 98, and NT 4.0, as well as later versions of all). On other systems, this drops * back from the inherently platform-sensitive concept of a default browser and simply attempts * to launch Netscape via a shell command. * <p> * This code is Copyright 1999-2001 by Eric Albert (eja...@cs...) and may be * redistributed or modified in any form without restrictions as long as the portion of this * comment from this paragraph through the end of the comment is not removed. The author * requests that he be notified of any application, applet, or other binary that makes use of * this code, but that's more out of curiosity than anything and is not required. This software * includes no warranty. The author is not repsonsible for any loss of data or functionality * or any adverse or unexpected effects of using this software. * <p> * Credits: * <br>Steven Spencer, JavaWorld magazine * (<a href="http://www.javaworld.com/javaworld/javatips/jw-javatip66.html">Java Tip 66</a>) * <br>Thanks also to Ron B. Yeh, Eric Shapiro, Ben Engber, Paul Teitlebaum, Andrea Cantatore, * Larry Barowski, Trevor Bedzek, Frank Miedrich, and Ron Rabakukk * * @author Eric Albert (<a href="mailto:eja...@cs...">eja...@cs...</a>) * @version 1.4b1 (Released June 20, 2001) */ public final class BrowserLauncher { /** * The Java virtual machine that we are running on. Actually, in most cases we only care * about the operating system, but some operating systems require us to switch on the VM. */ private static int jvm; /** The browser for the system */ private static Object browser; /** * Caches whether any classes, methods, and fields that are not part of the JDK and need to * be dynamically loaded at runtime loaded successfully. * <p> * Note that if this is <code>false</code>, <code>openURL()</code> will always return an * IOException. */ private static boolean loadedWithoutErrors; /** The com.apple.mrj.MRJFileUtils class */ private static Class mrjFileUtilsClass; /** The com.apple.mrj.MRJOSType class */ private static Class mrjOSTypeClass; /** The com.apple.MacOS.AEDesc class */ private static Class aeDescClass; /** The <init>(int) method of com.apple.MacOS.AETarget */ private static Constructor aeTargetConstructor; /** The <init>(int, int, int) method of com.apple.MacOS.AppleEvent */ private static Constructor appleEventConstructor; /** The <init>(String) method of com.apple.MacOS.AEDesc */ private static Constructor aeDescConstructor; /** The findFolder method of com.apple.mrj.MRJFileUtils */ private static Method findFolder; /** The getFileCreator method of com.apple.mrj.MRJFileUtils */ private static Method getFileCreator; /** The getFileType method of com.apple.mrj.MRJFileUtils */ private static Method getFileType; /** The openURL method of com.apple.mrj.MRJFileUtils */ private static Method openURL; /** The makeOSType method of com.apple.MacOS.OSUtils */ private static Method makeOSType; /** The putParameter method of com.apple.MacOS.AppleEvent */ private static Method putParameter; /** The sendNoReply method of com.apple.MacOS.AppleEvent */ private static Method sendNoReply; /** Actually an MRJOSType pointing to the System Folder on a Macintosh */ private static Object kSystemFolderType; /** The keyDirectObject AppleEvent parameter type */ private static Integer keyDirectObject; /** The kAutoGenerateReturnID AppleEvent code */ private static Integer kAutoGenerateReturnID; /** The kAnyTransactionID AppleEvent code */ private static Integer kAnyTransactionID; /** The linkage object required for JDirect 3 on Mac OS X. */ private static Object linkage; /** JVM constant for MRJ 2.0 */ private static final int MRJ_2_0 = 0; /** JVM constant for MRJ 2.1 or later */ private static final int MRJ_2_1 = 1; /** JVM constant for Java on Mac OS X 10.0 (MRJ 3.0) */ private static final int MRJ_3_0 = 3; /** JVM constant for MRJ 3.1 */ private static final int MRJ_3_1 = 4; /** JVM constant for any Windows NT JVM */ private static final int WINDOWS_NT = 5; /** JVM constant for any Windows 9x JVM */ private static final int WINDOWS_9X = 6; /** JVM constant for any other platform */ private static final int OTHER = -1; /** * The file type of the Finder on a Macintosh. Hardcoding "Finder" would keep non-U.S. English * systems from working properly. */ private static final String FINDER_TYPE = "FNDR"; /** * The creator code of the Finder on a Macintosh, which is needed to send AppleEvents to the * application. */ private static final String FINDER_CREATOR = "MACS"; /** The name for the AppleEvent type corresponding to a GetURL event. */ private static final String GURL_EVENT = "GURL"; /** * The first parameter that needs to be passed into Runtime.exec() to open the default web * browser on Windows. */ private static final String FIRST_WINDOWS_PARAMETER = "/c"; /** The second parameter for Runtime.exec() on Windows. */ private static final String SECOND_WINDOWS_PARAMETER = "start"; /** * The third parameter for Runtime.exec() on Windows. This is a "title" * parameter that the command line expects. Setting this parameter allows * URLs containing spaces to work. */ private static final String THIRD_WINDOWS_PARAMETER = "\"\""; /** * The shell parameters for Netscape that opens a given URL in an already-open copy of Netscape * on many command-line systems. */ private static final String NETSCAPE_REMOTE_PARAMETER = "-remote"; private static final String NETSCAPE_OPEN_PARAMETER_START = "'openURL("; private static final String NETSCAPE_OPEN_PARAMETER_END = ")'"; /** * The message from any exception thrown throughout the initialization process. */ private static String errorMessage; /** * An initialization block that determines the operating system and loads the necessary * runtime data. */ static { loadedWithoutErrors = true; String osName = System.getProperty("os.name"); if (osName.startsWith("Mac OS")) { String mrjVersion = System.getProperty("mrj.version"); String majorMRJVersion = mrjVersion.substring(0, 3); try { double version = Double.valueOf(majorMRJVersion).doubleValue(); if (version == 2) { jvm = MRJ_2_0; } else if (version >= 2.1 && version < 3) { // Assume that all 2.x versions of MRJ work the same. MRJ 2.1 actually // works via Runtime.exec() and 2.2 supports that but has an openURL() method // as well that we currently ignore. jvm = MRJ_2_1; } else if (version == 3.0) { jvm = MRJ_3_0; } else if (version >= 3.1) { // Assume that all 3.1 and later versions of MRJ work the same. jvm = MRJ_3_1; } else { loadedWithoutErrors = false; errorMessage = "Unsupported MRJ version: " + version; } } catch (NumberFormatException nfe) { loadedWithoutErrors = false; errorMessage = "Invalid MRJ version: " + mrjVersion; } } else if (osName.startsWith("Windows")) { if (osName.indexOf("9") != -1) { jvm = WINDOWS_9X; } else { jvm = WINDOWS_NT; } } else { jvm = OTHER; } if (loadedWithoutErrors) { // if we haven't hit any errors yet loadedWithoutErrors = loadClasses(); } } /** * This class should be never be instantiated; this just ensures so. */ private BrowserLauncher() { } /** * Called by a static initializer to load any classes, fields, and methods required at runtime * to locate the user's web browser. * @return <code>true</code> if all intialization succeeded * <code>false</code> if any portion of the initialization failed */ private static boolean loadClasses() { switch (jvm) { case MRJ_2_0: try { Class aeTargetClass = Class.forName("com.apple.MacOS.AETarget"); Class osUtilsClass = Class.forName("com.apple.MacOS.OSUtils"); Class appleEventClass = Class.forName("com.apple.MacOS.AppleEvent"); Class aeClass = Class.forName("com.apple.MacOS.ae"); aeDescClass = Class.forName("com.apple.MacOS.AEDesc"); aeTargetConstructor = aeTargetClass.getDeclaredConstructor(new Class [] {int.class }); appleEventConstructor = appleEventClass.getDeclaredConstructor(new Class[] {int.class, int.class, aeTargetClass, int.class, int.class }); aeDescConstructor = aeDescClass.getDeclaredConstructor(new Class[] {String.class }); makeOSType = osUtilsClass.getDeclaredMethod("makeOSType", new Class [] {String.class }); putParameter = appleEventClass.getDeclaredMethod("putParameter", new Class[] {int.class, aeDescClass }); sendNoReply = appleEventClass.getDeclaredMethod("sendNoReply", new Class[] {}); Field keyDirectObjectField = aeClass.getDeclaredField("keyDirectObject"); keyDirectObject = (Integer) keyDirectObjectField.get(null); Field autoGenerateReturnIDField = appleEventClass.getDeclaredField("kAutoGenerateReturnID"); kAutoGenerateReturnID = (Integer) autoGenerateReturnIDField.get(null); Field anyTransactionIDField = appleEventClass.getDeclaredField("kAnyTransactionID"); kAnyTransactionID = (Integer) anyTransactionIDField.get(null); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); return false; } catch (NoSuchMethodException nsme) { errorMessage = nsme.getMessage(); return false; } catch (NoSuchFieldException nsfe) { errorMessage = nsfe.getMessage(); return false; } catch (IllegalAccessException iae) { errorMessage = iae.getMessage(); return false; } break; case MRJ_2_1: try { mrjFileUtilsClass = Class.forName("com.apple.mrj.MRJFileUtils"); mrjOSTypeClass = Class.forName("com.apple.mrj.MRJOSType"); Field systemFolderField = mrjFileUtilsClass.getDeclaredField("kSystemFolderType"); kSystemFolderType = systemFolderField.get(null); findFolder = mrjFileUtilsClass.getDeclaredMethod("findFolder", new Class[] {mrjOSTypeClass }); getFileCreator = mrjFileUtilsClass.getDeclaredMethod("getFileCreator", new Class[] {File.class }); getFileType = mrjFileUtilsClass.getDeclaredMethod("getFileType", new Class[] {File.class }); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); return false; } catch (NoSuchFieldException nsfe) { errorMessage = nsfe.getMessage(); return false; } catch (NoSuchMethodException nsme) { errorMessage = nsme.getMessage(); return false; } catch (SecurityException se) { errorMessage = se.getMessage(); return false; } catch (IllegalAccessException iae) { errorMessage = iae.getMessage(); return false; } break; case MRJ_3_0: try { Class linker = Class.forName("com.apple.mrj.jdirect.Linker"); Constructor constructor = linker.getConstructor(new Class[] {Class.class }); linkage = constructor.newInstance(new Object[] {BrowserLauncher.class }); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); return false; } catch (NoSuchMethodException nsme) { errorMessage = nsme.getMessage(); return false; } catch (InvocationTargetException ite) { errorMessage = ite.getMessage(); return false; } catch (InstantiationException ie) { errorMessage = ie.getMessage(); return false; } catch (IllegalAccessException iae) { errorMessage = iae.getMessage(); return false; } break; case MRJ_3_1: try { mrjFileUtilsClass = Class.forName("com.apple.mrj.MRJFileUtils"); openURL = mrjFileUtilsClass.getDeclaredMethod("openURL", new Class[] {String.class }); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); return false; } catch (NoSuchMethodException nsme) { errorMessage = nsme.getMessage(); return false; } break; default: break; } return true; } /** * Attempts to locate the default web browser on the local system. Caches results so it * only locates the browser once for each use of this class per JVM instance. * @return The browser for the system. Note that this may not be what you would consider * to be a standard web browser; instead, it's the application that gets called to * open the default web browser. In some cases, this will be a non-String object * that provides the means of calling the default browser. */ private static Object locateBrowser() { if (browser != null) { return browser; } switch (jvm) { case MRJ_2_0: try { Integer finderCreatorCode = (Integer) makeOSType.invoke(null, new Object[] {FINDER_CREATOR }); Object aeTarget = aeTargetConstructor.newInstance(new Object[] {finderCreatorCode }); Integer gurlType = (Integer) makeOSType.invoke(null, new Object[] {GURL_EVENT }); Object appleEvent = appleEventConstructor.newInstance(new Object[] {gurlType, gurlType, aeTarget, kAutoGenerateReturnID, kAnyTransactionID }); // Don't set browser = appleEvent because then the next time we call // locateBrowser(), we'll get the same AppleEvent, to which we'll already have // added the relevant parameter. Instead, regenerate the AppleEvent every time. // There's probably a way to do this better; if any has any ideas, please let // me know. return appleEvent; } catch (IllegalAccessException iae) { browser = null; errorMessage = iae.getMessage(); return browser; } catch (InstantiationException ie) { browser = null; errorMessage = ie.getMessage(); return browser; } catch (InvocationTargetException ite) { browser = null; errorMessage = ite.getMessage(); return browser; } case MRJ_2_1: File systemFolder; try { systemFolder = (File) findFolder.invoke(null, new Object[] {kSystemFolderType }); } catch (IllegalArgumentException iare) { browser = null; errorMessage = iare.getMessage(); return browser; } catch (IllegalAccessException iae) { browser = null; errorMessage = iae.getMessage(); return browser; } catch (InvocationTargetException ite) { browser = null; errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage(); return browser; } String[] systemFolderFiles = systemFolder.list(); // Avoid a FilenameFilter because that can't be stopped mid-list for (int i = 0; i < systemFolderFiles.length; i++) { try { File file = new File(systemFolder, systemFolderFiles[i]); if (!file.isFile()) { continue; } // We're looking for a file with a creator code of 'MACS' and // a type of 'FNDR'. Only requiring the type results in non-Finder // applications being picked up on certain Mac OS 9 systems, // especially German ones, and sending a GURL event to those // applications results in a logout under Multiple Users. Object fileType = getFileType.invoke(null, new Object[] {file }); if (FINDER_TYPE.equals(fileType.toString())) { Object fileCreator = getFileCreator.invoke(null, new Object[] {file }); if (FINDER_CREATOR.equals(fileCreator.toString())) { browser = file.toString(); // Actually the Finder, but that's OK return browser; } } } catch (IllegalArgumentException iare) { browser = browser; errorMessage = iare.getMessage(); return null; } catch (IllegalAccessException iae) { browser = null; errorMessage = iae.getMessage(); return browser; } catch (InvocationTargetException ite) { browser = null; errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage(); return browser; } } browser = null; break; case MRJ_3_0: case MRJ_3_1: browser = ""; // Return something non-null break; case WINDOWS_NT: browser = "cmd.exe"; break; case WINDOWS_9X: browser = "command.com"; break; case OTHER: default: browser = "netscape"; break; } return browser; } /** * Attempts to open the default web browser to the given URL. * @param url The URL to open * @throws IOException If the web browser could not be located or does not run */ public static void openURL(final String url) throws IOException { if (!loadedWithoutErrors) { throw new IOException("Exception in finding browser: " + errorMessage); } Object currentBrowser = locateBrowser(); if (currentBrowser == null) { throw new IOException("Unable to locate browser: " + errorMessage); } switch (jvm) { case MRJ_2_0: Object aeDesc = null; try { aeDesc = aeDescConstructor.newInstance(new Object[] {url }); putParameter.invoke(currentBrowser, new Object[] {keyDirectObject, aeDesc }); sendNoReply.invoke(currentBrowser, new Object[] {}); } catch (InvocationTargetException ite) { throw new IOException("InvocationTargetException while creating AEDesc: " + ite.getMessage()); } catch (IllegalAccessException iae) { throw new IOException("IllegalAccessException while building AppleEvent: " + iae.getMessage()); } catch (InstantiationException ie) { throw new IOException("InstantiationException while creating AEDesc: " + ie.getMessage()); } finally { aeDesc = null; // Encourage it to get disposed if it was created currentBrowser = null; // Ditto } break; case MRJ_2_1: Runtime.getRuntime().exec(new String[] {(String) currentBrowser, url }); break; case MRJ_3_0: int[] instance = new int[1]; int result = ICStart(instance, 0); if (result == 0) { int[] selectionStart = new int[] {0 }; byte[] urlBytes = url.getBytes(); int[] selectionEnd = new int[] {urlBytes.length }; result = ICLaunchURL(instance[0], new byte[] {0 }, urlBytes, urlBytes.length, selectionStart, selectionEnd); if (result == 0) { // Ignore the return value; the URL was launched successfully // regardless of what happens here. ICStop(instance); } else { throw new IOException("Unable to launch URL: " + result); } } else { throw new IOException("Unable to create an Internet Config instance: " + result); } break; case MRJ_3_1: try { openURL.invoke(null, new Object[] {url }); } catch (InvocationTargetException ite) { throw new IOException("InvocationTargetException while calling openURL: " + ite.getMessage()); } catch (IllegalAccessException iae) { throw new IOException("IllegalAccessException while calling openURL: " + iae.getMessage()); } break; case WINDOWS_NT: case WINDOWS_9X: // Add quotes around the URL to allow ampersands and other special // characters to work. Process process = Runtime.getRuntime().exec(new String[] {(String) currentBrowser, FIRST_WINDOWS_PARAMETER, SECOND_WINDOWS_PARAMETER, THIRD_WINDOWS_PARAMETER, '"' + url + '"' }); // This avoids a memory leak on some versions of Java on Windows. // That's hinted at in <http://developer.java.sun.com/developer/qow/archive/68/>. try { process.waitFor(); process.exitValue(); } catch (InterruptedException ie) { throw new IOException("InterruptedException while launching browser: " + ie.getMessage()); } break; case OTHER: // Assume that we're on Unix and that Netscape is installed // First, attempt to open the URL in a currently running session of Netscape process = Runtime.getRuntime().exec( new String[] {(String) currentBrowser, NETSCAPE_REMOTE_PARAMETER, NETSCAPE_OPEN_PARAMETER_START + url + NETSCAPE_OPEN_PARAMETER_END }); try { int exitCode = process.waitFor(); if (exitCode != 0) { // if Netscape was not open Runtime.getRuntime().exec(new String[] {(String) currentBrowser, url }); } } catch (InterruptedException ie) { throw new IOException("InterruptedException while launching browser: " + ie.getMessage()); } break; default: // This should never occur, but if it does, we'll try the simplest thing possible Runtime.getRuntime().exec(new String[] {(String) currentBrowser, url }); break; } } /** * Methods required for Mac OS X. The presence of native methods does not cause * any problems on other platforms. */ private static native int ICStart(final int[] instance, final int signature); private static native int ICStop(final int[] instance); private static native int ICLaunchURL(final int instance, final byte[] hint, final byte[] data, final int len, final int[] selectionStart, final int[] selectionEnd); } |
From: Kurt R. <kr...@us...> - 2005-04-22 14:46:54
|
Update of /cvsroot/xframe/xsddoc/samples/XMLSchema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14807/samples/XMLSchema Added Files: .cvsignore XMLSchema.dtd XMLSchema.xsd datatypes.dtd xml.xsd Log Message: readded XMLSchema.xsd sample --- NEW FILE: .cvsignore --- bin html *dmp *.xml *.xsl --- NEW FILE: XMLSchema.xsd --- <?xml version="1.0" encoding="UTF-8"?> <!-- XML Schema schema for XML Schemas: Part 1: Structures --> <!-- Note this schema is NOT the normative structures schema. --> <!-- The prose copy in the structures REC is the normative --> <!-- version (which shouldn't differ from this one except for --> <!-- this comment and entity expansions, but just in case --> <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [ <!-- provide ID type information even for parsers which only read the internal subset --> <!ATTLIST xs:schema id ID #IMPLIED > <!ATTLIST xs:complexType id ID #IMPLIED > <!ATTLIST xs:complexContent id ID #IMPLIED > <!ATTLIST xs:simpleContent [...2257 lines suppressed...] </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="pattern" id="pattern"> <xs:annotation> <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:restriction base="xs:noFixedFacet"> <xs:sequence> <xs:element ref="xs:annotation" minOccurs="0"/> </xs:sequence> <xs:attribute name="value" type="xs:string" use="required"/> <xs:anyAttribute namespace="##other" processContents="lax"/> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:element> </xs:schema> --- NEW FILE: datatypes.dtd --- <!-- DTD for XML Schemas: Part 2: Datatypes $Id$ Note this DTD is NOT normative, or even definitive. - - the prose copy in the datatypes REC is the definitive version (which shouldn't differ from this one except for this comment and entity expansions, but just in case) --> <!-- This DTD cannot be used on its own, it is intended only for incorporation in XMLSchema.dtd, q.v. --> <!-- Define all the element names, with optional prefix --> <!ENTITY % simpleType "%p;simpleType"> <!ENTITY % restriction "%p;restriction"> <!ENTITY % list "%p;list"> <!ENTITY % union "%p;union"> <!ENTITY % maxExclusive "%p;maxExclusive"> <!ENTITY % minExclusive "%p;minExclusive"> <!ENTITY % maxInclusive "%p;maxInclusive"> <!ENTITY % minInclusive "%p;minInclusive"> <!ENTITY % totalDigits "%p;totalDigits"> <!ENTITY % fractionDigits "%p;fractionDigits"> <!ENTITY % length "%p;length"> <!ENTITY % minLength "%p;minLength"> <!ENTITY % maxLength "%p;maxLength"> <!ENTITY % enumeration "%p;enumeration"> <!ENTITY % whiteSpace "%p;whiteSpace"> <!ENTITY % pattern "%p;pattern"> <!-- Customisation entities for the ATTLIST of each element type. Define one of these if your schema takes advantage of the anyAttribute='##other' in the schema for schemas --> <!ENTITY % simpleTypeAttrs ""> <!ENTITY % restrictionAttrs ""> <!ENTITY % listAttrs ""> <!ENTITY % unionAttrs ""> <!ENTITY % maxExclusiveAttrs ""> <!ENTITY % minExclusiveAttrs ""> <!ENTITY % maxInclusiveAttrs ""> <!ENTITY % minInclusiveAttrs ""> <!ENTITY % totalDigitsAttrs ""> <!ENTITY % fractionDigitsAttrs ""> <!ENTITY % lengthAttrs ""> <!ENTITY % minLengthAttrs ""> <!ENTITY % maxLengthAttrs ""> <!ENTITY % enumerationAttrs ""> <!ENTITY % whiteSpaceAttrs ""> <!ENTITY % patternAttrs ""> <!-- Define some entities for informative use as attribute types --> <!ENTITY % URIref "CDATA"> <!ENTITY % XPathExpr "CDATA"> <!ENTITY % QName "NMTOKEN"> <!ENTITY % QNames "NMTOKENS"> <!ENTITY % NCName "NMTOKEN"> <!ENTITY % nonNegativeInteger "NMTOKEN"> <!ENTITY % boolean "(true|false)"> <!ENTITY % simpleDerivationSet "CDATA"> <!-- #all or space-separated list drawn from derivationChoice --> <!-- Note that the use of 'facet' below is less restrictive than is really intended: There should in fact be no more than one of each of minInclusive, minExclusive, maxInclusive, maxExclusive, totalDigits, fractionDigits, length, maxLength, minLength within datatype, and the min- and max- variants of Inclusive and Exclusive are mutually exclusive. On the other hand, pattern and enumeration may repeat. --> <!ENTITY % minBound "(%minInclusive; | %minExclusive;)"> <!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)"> <!ENTITY % bounds "%minBound; | %maxBound;"> <!ENTITY % numeric "%totalDigits; | %fractionDigits;"> <!ENTITY % ordered "%bounds; | %numeric;"> <!ENTITY % unordered "%pattern; | %enumeration; | %whiteSpace; | %length; | %maxLength; | %minLength;"> <!ENTITY % facet "%ordered; | %unordered;"> <!ENTITY % facetAttr "value CDATA #REQUIRED id ID #IMPLIED"> <!ENTITY % fixedAttr "fixed %boolean; #IMPLIED"> <!ENTITY % facetModel "(%annotation;)?"> <!ELEMENT %simpleType; ((%annotation;)?, (%restriction; | %list; | %union;))> <!ATTLIST %simpleType; name %NCName; #IMPLIED final %simpleDerivationSet; #IMPLIED id ID #IMPLIED %simpleTypeAttrs;> <!-- name is required at top level --> <!ELEMENT %restriction; ((%annotation;)?, (%restriction1; | ((%simpleType;)?,(%facet;)*)), (%attrDecls;))> <!ATTLIST %restriction; base %QName; #IMPLIED id ID #IMPLIED %restrictionAttrs;> <!-- base and simpleType child are mutually exclusive, one is required. restriction is shared between simpleType and simpleContent and complexContent (in XMLSchema.xsd). restriction1 is for the latter cases, when this is restricting a complex type, as is attrDecls. --> <!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)> <!ATTLIST %list; itemType %QName; #IMPLIED id ID #IMPLIED %listAttrs;> <!-- itemType and simpleType child are mutually exclusive, one is required --> <!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)> <!ATTLIST %union; id ID #IMPLIED memberTypes %QNames; #IMPLIED %unionAttrs;> <!-- At least one item in memberTypes or one simpleType child is required --> <!ELEMENT %maxExclusive; %facetModel;> <!ATTLIST %maxExclusive; %facetAttr; %fixedAttr; %maxExclusiveAttrs;> <!ELEMENT %minExclusive; %facetModel;> <!ATTLIST %minExclusive; %facetAttr; %fixedAttr; %minExclusiveAttrs;> <!ELEMENT %maxInclusive; %facetModel;> <!ATTLIST %maxInclusive; %facetAttr; %fixedAttr; %maxInclusiveAttrs;> <!ELEMENT %minInclusive; %facetModel;> <!ATTLIST %minInclusive; %facetAttr; %fixedAttr; %minInclusiveAttrs;> <!ELEMENT %totalDigits; %facetModel;> <!ATTLIST %totalDigits; %facetAttr; %fixedAttr; %totalDigitsAttrs;> <!ELEMENT %fractionDigits; %facetModel;> <!ATTLIST %fractionDigits; %facetAttr; %fixedAttr; %fractionDigitsAttrs;> <!ELEMENT %length; %facetModel;> <!ATTLIST %length; %facetAttr; %fixedAttr; %lengthAttrs;> <!ELEMENT %minLength; %facetModel;> <!ATTLIST %minLength; %facetAttr; %fixedAttr; %minLengthAttrs;> <!ELEMENT %maxLength; %facetModel;> <!ATTLIST %maxLength; %facetAttr; %fixedAttr; %maxLengthAttrs;> <!-- This one can be repeated --> <!ELEMENT %enumeration; %facetModel;> <!ATTLIST %enumeration; %facetAttr; %enumerationAttrs;> <!ELEMENT %whiteSpace; %facetModel;> <!ATTLIST %whiteSpace; %facetAttr; %fixedAttr; %whiteSpaceAttrs;> <!-- This one can be repeated --> <!ELEMENT %pattern; %facetModel;> <!ATTLIST %pattern; %facetAttr; %patternAttrs;> --- NEW FILE: XMLSchema.dtd --- <!-- DTD for XML Schemas: Part 1: Structures Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN" Official Location: http://www.w3.org/2001/XMLSchema.dtd --> <!-- $Id$ --> <!-- Note this DTD is NOT normative, or even definitive. --> <!--d--> <!-- prose copy in the structures REC is the definitive version --> <!--d--> <!-- (which shouldn't differ from this one except for this --> <!--d--> <!-- comment and entity expansions, but just in case) --> <!--d--> <!-- With the exception of cases with multiple namespace prefixes for the XML Schema namespace, any XML document which is not valid per this DTD given redefinitions in its internal subset of the 'p' and 's' parameter entities below appropriate to its namespace declaration of the XML Schema namespace is almost certainly not a valid schema. --> <!-- The simpleType element and its constituent parts are defined in XML Schema: Part 2: Datatypes --> <!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' > <!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a schema document to establish a different namespace prefix --> <!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must also define %s as the suffix for the appropriate namespace declaration (e.g. :foo) --> <!ENTITY % nds 'xmlns%s;'> <!-- Define all the element names, with optional prefix --> <!ENTITY % schema "%p;schema"> <!ENTITY % complexType "%p;complexType"> <!ENTITY % complexContent "%p;complexContent"> <!ENTITY % simpleContent "%p;simpleContent"> <!ENTITY % extension "%p;extension"> <!ENTITY % element "%p;element"> <!ENTITY % unique "%p;unique"> <!ENTITY % key "%p;key"> <!ENTITY % keyref "%p;keyref"> <!ENTITY % selector "%p;selector"> <!ENTITY % field "%p;field"> <!ENTITY % group "%p;group"> <!ENTITY % all "%p;all"> <!ENTITY % choice "%p;choice"> <!ENTITY % sequence "%p;sequence"> <!ENTITY % any "%p;any"> <!ENTITY % anyAttribute "%p;anyAttribute"> <!ENTITY % attribute "%p;attribute"> <!ENTITY % attributeGroup "%p;attributeGroup"> <!ENTITY % include "%p;include"> <!ENTITY % import "%p;import"> <!ENTITY % redefine "%p;redefine"> <!ENTITY % notation "%p;notation"> <!-- annotation elements --> <!ENTITY % annotation "%p;annotation"> <!ENTITY % appinfo "%p;appinfo"> <!ENTITY % documentation "%p;documentation"> <!-- Customisation entities for the ATTLIST of each element type. Define one of these if your schema takes advantage of the anyAttribute='##other' in the schema for schemas --> <!ENTITY % schemaAttrs ''> <!ENTITY % complexTypeAttrs ''> <!ENTITY % complexContentAttrs ''> <!ENTITY % simpleContentAttrs ''> <!ENTITY % extensionAttrs ''> <!ENTITY % elementAttrs ''> <!ENTITY % groupAttrs ''> <!ENTITY % allAttrs ''> <!ENTITY % choiceAttrs ''> <!ENTITY % sequenceAttrs ''> <!ENTITY % anyAttrs ''> <!ENTITY % anyAttributeAttrs ''> <!ENTITY % attributeAttrs ''> <!ENTITY % attributeGroupAttrs ''> <!ENTITY % uniqueAttrs ''> <!ENTITY % keyAttrs ''> <!ENTITY % keyrefAttrs ''> <!ENTITY % selectorAttrs ''> <!ENTITY % fieldAttrs ''> <!ENTITY % includeAttrs ''> <!ENTITY % importAttrs ''> <!ENTITY % redefineAttrs ''> <!ENTITY % notationAttrs ''> <!ENTITY % annotationAttrs ''> <!ENTITY % appinfoAttrs ''> <!ENTITY % documentationAttrs ''> <!ENTITY % complexDerivationSet "CDATA"> <!-- #all or space-separated list drawn from derivationChoice --> <!ENTITY % blockSet "CDATA"> <!-- #all or space-separated list drawn from derivationChoice + 'substitution' --> <!ENTITY % mgs '%all; | %choice; | %sequence;'> <!ENTITY % cs '%choice; | %sequence;'> <!ENTITY % formValues '(qualified|unqualified)'> <!ENTITY % attrDecls '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'> <!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'> <!-- This is used in part2 --> <!ENTITY % restriction1 '((%mgs; | %group;)?)'> %xs-datatypes; <!-- the duplication below is to produce an unambiguous content model which allows annotation everywhere --> <!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*, ((%simpleType; | %complexType; | %element; | %attribute; | %attributeGroup; | %group; | %notation; ), (%annotation;)*)* )> <!ATTLIST %schema; targetNamespace %URIref; #IMPLIED version CDATA #IMPLIED %nds; %URIref; #FIXED 'http://www.w3.org/2001/XMLSchema' xmlns CDATA #IMPLIED finalDefault %complexDerivationSet; '' blockDefault %blockSet; '' id ID #IMPLIED elementFormDefault %formValues; 'unqualified' attributeFormDefault %formValues; 'unqualified' xml:lang CDATA #IMPLIED %schemaAttrs;> <!-- Note the xmlns declaration is NOT in the Schema for Schemas, because at the Infoset level where schemas operate, xmlns(:prefix) is NOT an attribute! --> <!-- The declaration of xmlns is a convenience for schema authors --> <!-- The id attribute here and below is for use in external references from non-schemas using simple fragment identifiers. It is NOT used for schema-to-schema reference, internal or external. --> <!-- a type is a named content type specification which allows attribute declarations--> <!-- --> <!ELEMENT %complexType; ((%annotation;)?, (%simpleContent;|%complexContent;| %particleAndAttrs;))> <!ATTLIST %complexType; name %NCName; #IMPLIED id ID #IMPLIED abstract %boolean; #IMPLIED final %complexDerivationSet; #IMPLIED block %complexDerivationSet; #IMPLIED mixed (true|false) 'false' %complexTypeAttrs;> <!-- particleAndAttrs is shorthand for a root type --> <!-- mixed is disallowed if simpleContent, overriden if complexContent has one too. --> <!-- If anyAttribute appears in one or more referenced attributeGroups and/or explicitly, the intersection of the permissions is used --> <!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))> <!ATTLIST %complexContent; mixed (true|false) #IMPLIED id ID #IMPLIED %complexContentAttrs;> <!-- restriction should use the branch defined above, not the simple one from part2; extension should use the full model --> <!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))> <!ATTLIST %simpleContent; id ID #IMPLIED %simpleContentAttrs;> <!-- restriction should use the simple branch from part2, not the one defined above; extension should have no particle --> <!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))> <!ATTLIST %extension; base %QName; #REQUIRED id ID #IMPLIED %extensionAttrs;> <!-- an element is declared by either: a name and a type (either nested or referenced via the type attribute) or a ref to an existing element declaration --> <!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?, (%unique; | %key; | %keyref;)*)> <!-- simpleType or complexType only if no type|ref attribute --> <!-- ref not allowed at top level --> <!ATTLIST %element; name %NCName; #IMPLIED id ID #IMPLIED ref %QName; #IMPLIED type %QName; #IMPLIED minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED nillable %boolean; #IMPLIED substitutionGroup %QName; #IMPLIED abstract %boolean; #IMPLIED final %complexDerivationSet; #IMPLIED block %blockSet; #IMPLIED default CDATA #IMPLIED fixed CDATA #IMPLIED form %formValues; #IMPLIED %elementAttrs;> <!-- type and ref are mutually exclusive. name and ref are mutually exclusive, one is required --> <!-- In the absence of type AND ref, type defaults to type of substitutionGroup, if any, else the ur-type, i.e. unconstrained --> <!-- default and fixed are mutually exclusive --> <!ELEMENT %group; ((%annotation;)?,(%mgs;)?)> <!ATTLIST %group; name %NCName; #IMPLIED ref %QName; #IMPLIED minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED id ID #IMPLIED %groupAttrs;> <!ELEMENT %all; ((%annotation;)?, (%element;)*)> <!ATTLIST %all; minOccurs (1) #IMPLIED maxOccurs (1) #IMPLIED id ID #IMPLIED %allAttrs;> <!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)> <!ATTLIST %choice; minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED id ID #IMPLIED %choiceAttrs;> <!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)> <!ATTLIST %sequence; minOccurs %nonNegativeInteger; #IMPLIED maxOccurs CDATA #IMPLIED id ID #IMPLIED %sequenceAttrs;> <!-- an anonymous grouping in a model, or a top-level named group definition, or a reference to same --> <!-- Note that if order is 'all', group is not allowed inside. If order is 'all' THIS group must be alone (or referenced alone) at the top level of a content model --> <!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside --> <!-- Should allow minOccurs=0 inside order='all' . . . --> <!ELEMENT %any; (%annotation;)?> <!ATTLIST %any; namespace CDATA '##any' processContents (skip|lax|strict) 'strict' minOccurs %nonNegativeInteger; '1' maxOccurs CDATA '1' id ID #IMPLIED %anyAttrs;> <!-- namespace is interpreted as follows: ##any - - any non-conflicting WFXML at all ##other - - any non-conflicting WFXML from namespace other than targetNamespace ##local - - any unqualified non-conflicting WFXML/attribute one or - - any non-conflicting WFXML from more URI the listed namespaces references ##targetNamespace ##local may appear in the above list, with the obvious meaning --> <!ELEMENT %anyAttribute; (%annotation;)?> <!ATTLIST %anyAttribute; namespace CDATA '##any' processContents (skip|lax|strict) 'strict' id ID #IMPLIED %anyAttributeAttrs;> <!-- namespace is interpreted as for 'any' above --> <!-- simpleType only if no type|ref attribute --> <!-- ref not allowed at top level, name iff at top level --> <!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)> <!ATTLIST %attribute; name %NCName; #IMPLIED id ID #IMPLIED ref %QName; #IMPLIED type %QName; #IMPLIED use (prohibited|optional|required) #IMPLIED default CDATA #IMPLIED fixed CDATA #IMPLIED form %formValues; #IMPLIED %attributeAttrs;> <!-- type and ref are mutually exclusive. name and ref are mutually exclusive, one is required --> <!-- default for use is optional when nested, none otherwise --> <!-- default and fixed are mutually exclusive --> <!-- type attr and simpleType content are mutually exclusive --> <!-- an attributeGroup is a named collection of attribute decls, or a reference thereto --> <!ELEMENT %attributeGroup; ((%annotation;)?, (%attribute; | %attributeGroup;)*, (%anyAttribute;)?) > <!ATTLIST %attributeGroup; name %NCName; #IMPLIED id ID #IMPLIED ref %QName; #IMPLIED %attributeGroupAttrs;> <!-- ref iff no content, no name. ref iff not top level --> <!-- better reference mechanisms --> <!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)> <!ATTLIST %unique; name %NCName; #REQUIRED id ID #IMPLIED %uniqueAttrs;> <!ELEMENT %key; ((%annotation;)?, %selector;, (%field;)+)> <!ATTLIST %key; name %NCName; #REQUIRED id ID #IMPLIED %keyAttrs;> <!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)> <!ATTLIST %keyref; name %NCName; #REQUIRED refer %QName; #REQUIRED id ID #IMPLIED %keyrefAttrs;> <!ELEMENT %selector; ((%annotation;)?)> <!ATTLIST %selector; xpath %XPathExpr; #REQUIRED id ID #IMPLIED %selectorAttrs;> <!ELEMENT %field; ((%annotation;)?)> <!ATTLIST %field; xpath %XPathExpr; #REQUIRED id ID #IMPLIED %fieldAttrs;> <!-- Schema combination mechanisms --> <!ELEMENT %include; (%annotation;)?> <!ATTLIST %include; schemaLocation %URIref; #REQUIRED id ID #IMPLIED %includeAttrs;> <!ELEMENT %import; (%annotation;)?> <!ATTLIST %import; namespace %URIref; #IMPLIED schemaLocation %URIref; #IMPLIED id ID #IMPLIED %importAttrs;> <!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; | %attributeGroup; | %group;)*> <!ATTLIST %redefine; schemaLocation %URIref; #REQUIRED id ID #IMPLIED %redefineAttrs;> <!ELEMENT %notation; (%annotation;)?> <!ATTLIST %notation; name %NCName; #REQUIRED id ID #IMPLIED public CDATA #REQUIRED system %URIref; #IMPLIED %notationAttrs;> <!-- Annotation is either application information or documentation --> <!-- By having these here they are available for datatypes as well as all the structures elements --> <!ELEMENT %annotation; (%appinfo; | %documentation;)*> <!ATTLIST %annotation; %annotationAttrs;> <!-- User must define annotation elements in internal subset for this to work --> <!ELEMENT %appinfo; ANY> <!-- too restrictive --> <!ATTLIST %appinfo; source %URIref; #IMPLIED id ID #IMPLIED %appinfoAttrs;> <!ELEMENT %documentation; ANY> <!-- too restrictive --> <!ATTLIST %documentation; source %URIref; #IMPLIED id ID #IMPLIED xml:lang CDATA #IMPLIED %documentationAttrs;> <!NOTATION XMLSchemaStructures PUBLIC 'structures' 'http://www.w3.org/2001/XMLSchema.xsd' > <!NOTATION XML PUBLIC 'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' > --- NEW FILE: xml.xsd --- <?xml version="1.0"?> <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd"> <xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en"> <xs:annotation> <xs:documentation>See http://www.w3.org/XML/1998/namespace.html and http://www.w3.org/TR/REC-xml for information about this namespace.</xs:documentation> </xs:annotation> <xs:annotation> <xs:documentation>This schema defines attributes and an attribute group suitable for use by schemas wishing to allow xml:base, xml:lang or xml:space attributes on elements they define. To enable this, such a schema must import this schema for the XML namespace, e.g. as follows: <schema . . .> . . . <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> Subsequently, qualified reference to any of the attributes or the group defined below will have the desired effect, e.g. <type . . .> . . . <attributeGroup ref="xml:specialAttrs"/> will define a type which will schema-validate an instance element with any of those attributes</xs:documentation> </xs:annotation> <xs:annotation> <xs:documentation>In keeping with the XML Schema WG's standard versioning policy, this schema document will persist at http://www.w3.org/2001/03/xml.xsd. At the date of issue it can also be found at http://www.w3.org/2001/xml.xsd. The schema document at that URI may however change in the future, in order to remain compatible with the latest version of XML Schema itself. In other words, if the XML Schema namespace changes, the version of this document at http://www.w3.org/2001/xml.xsd will change accordingly; the version at http://www.w3.org/2001/03/xml.xsd will not change.</xs:documentation> </xs:annotation> <xs:attribute name="lang" type="xs:language"> <xs:annotation> <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter codes as the enumerated possible values . . .</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="space" default="preserve"> <xs:simpleType> <xs:restriction base="xs:NCName"> <xs:enumeration value="default"/> <xs:enumeration value="preserve"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="base" type="xs:anyURI"> <xs:annotation> <xs:documentation>See http://www.w3.org/TR/xmlbase/ for information about this attribute.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attributeGroup name="specialAttrs"> <xs:attribute ref="xml:base"/> <xs:attribute ref="xml:lang"/> <xs:attribute ref="xml:space"/> </xs:attributeGroup> </xs:schema> |
From: Kurt R. <kr...@us...> - 2005-04-22 14:46:22
|
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14473/src/net/sf/xframe/xsddoc Modified Files: Task.java Main.java Processor.java Log Message: support for new paramters -launch and -cf Index: Task.java =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/Task.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Task.java 26 Feb 2005 14:03:38 -0000 1.21 --- Task.java 22 Apr 2005 14:46:08 -0000 1.22 *************** *** 292,304 **** /** * Adds a schema defined by a file name to a mediator schema. * * @param mediatorSchema the meditator schema * @param base base file to resolve relative paths ! * @param schemaLocation the schema to add */ private void addSchema(final Document mediatorSchema, final String base, final String schemaLocation) { - if (verbose) { - System.out.println("found schema " + schemaLocation); - } String namespace = null; namespace = getNamespace(base, schemaLocation); --- 292,303 ---- /** * Adds a schema defined by a file name to a mediator schema. + * If the document at the given schema location is not a schema file, + * the document is not added. * * @param mediatorSchema the meditator schema * @param base base file to resolve relative paths ! * @param schemaLocation location of the schema to add */ private void addSchema(final Document mediatorSchema, final String base, final String schemaLocation) { String namespace = null; namespace = getNamespace(base, schemaLocation); *************** *** 309,312 **** --- 308,314 ---- return; } + if (verbose) { + System.out.println("found schema " + schemaLocation); + } final Element importNode = mediatorSchema.createElementNS(SCHEMA_NS, "import"); final String projectDir = getProject().getBaseDir().getAbsolutePath() + File.separator; *************** *** 317,320 **** --- 319,323 ---- final String schemaLoc; //Does the base have additional information? + // TODO check the following against mail from Gianluca Chiozzi if (base.length() > projectDir.length() && base.startsWith(projectDir)) { String relativePath = base.substring(projectDir.length()); *************** *** 330,337 **** /** * Extracts and returns the target namespace from a schema file. * * @param base base file name to resolve relative paths * @param filename file name of schema file ! * @return target namespace of schema */ private String getNamespace(final String base, final String filename) { --- 333,343 ---- /** * Extracts and returns the target namespace from a schema file. + * The target namespace can be the empty string if the schema has no + * target namespace. If the document is not a XML Schema, the returned value + * is <tt>null</tt>. * * @param base base file name to resolve relative paths * @param filename file name of schema file ! * @return target namespace of schema or <tt>null</tt> if the document is not a schema */ private String getNamespace(final String base, final String filename) { *************** *** 339,342 **** --- 345,351 ---- final Document schema = getDocumentBuilder().parse(new File(base, filename)); final Element root = schema.getDocumentElement(); + if (!root.getLocalName().equals("schema") || !root.getNamespaceURI().equals(Task.SCHEMA_NS)) { + return null; + } return root.getAttribute("targetNamespace"); } catch (Exception e) { *************** *** 595,598 **** --- 604,625 ---- /** + * Setter method for createFolder attribute. + * + * @param createFolder if out folder should be created + */ + protected void setCreateFolder(final boolean createFolder) { + processor.setCreateFolder(createFolder); + } + + /** + * Setter method for lauch attribute. + * + * @param launch if documentation should be launched in browser + */ + protected void setLauch(final boolean launch) { + processor.setLaunch(launch); + } + + /** * An HTML fragment in a nested element of the xsddoc task. * Index: Processor.java =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/Processor.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Processor.java 3 Mar 2005 17:10:13 -0000 1.37 --- Processor.java 22 Apr 2005 14:46:08 -0000 1.38 *************** *** 49,52 **** --- 49,53 ---- import net.sf.xframe.ex.ExceptionUtil; + import net.sf.xframe.xsddoc.util.BrowserLauncher; import net.sf.xframe.xsddoc.util.DomUtil; import net.sf.xframe.xsddoc.util.FileUtil; *************** *** 197,200 **** --- 198,207 ---- private boolean debug = false; + /** if generated documentation should be launched after creation. */ + private boolean launch = false; + + /** if output folder should be created. */ + private boolean createFolder = false; + /** if xml mode or not. */ private boolean xml = false; *************** *** 348,351 **** --- 355,394 ---- /** + * Getter method for createFolder property. + * + * @return if output folder should be created + */ + protected boolean isCreateFolder() { + return createFolder; + } + + /** + * Setter method for createFolder property. + * + * @param theCreateFolder if output folder should be created + */ + protected void setCreateFolder(final boolean theCreateFolder) { + this.createFolder = theCreateFolder; + } + + /** + * Getter method for launch property. + * + * @return if generated documentation should be launched after creation + */ + protected boolean isLaunch() { + return launch; + } + + /** + * Setter method for launch property. + * + * @param theLaunch if generated documentation should be launched after creation + */ + protected void setLaunch(final boolean theLaunch) { + this.launch = theLaunch; + } + + /** * Setter method for xml property. * *************** *** 460,463 **** --- 503,514 ---- } final File outFile = new File(this.out); + + if (!outFile.exists()) { + if (createFolder) { + outFile.mkdirs(); + } else { + throw new ProcessorException("output folder doesn't exist: " + outFile); + } + } if (!outFile.exists()) { throw new ProcessorException("output folder doesn't exist: " + outFile); *************** *** 473,476 **** --- 524,530 ---- } process(); + if (launch) { + BrowserLauncher.openURL(out + FILE_SEP + "index" + getExtension()); + } } catch (Exception e) { throw new ProcessorException(e.getLocalizedMessage(), e); Index: Main.java =================================================================== RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/Main.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Main.java 26 Feb 2005 14:03:38 -0000 1.24 --- Main.java 22 Apr 2005 14:46:08 -0000 1.25 *************** *** 44,47 **** --- 44,49 ---- * -css <css-file> provide external CSS file * -version Only output version of xsddoc + * -launch Launch documentation after creation + * -cf Create output folder if not exists * -d -debug Output debug messages * -? -help Print this help message *************** *** 108,111 **** --- 110,117 ---- } else if ("x".equals(option) || "xml".equals(option)) { processor.setXml(true); + } else if ("cf".equals(option)) { + processor.setCreateFolder(true); + } else if ("launch".equals(option)) { + processor.setLaunch(true); } else if ("version".equals(option)) { System.out.println("xframe - xsddoc version " + VERSION); *************** *** 161,169 **** System.out.println(" -g -hideGroups hide groups in overview pages"); System.out.println(" -a -hideAttributes hide attributes in overview pages"); System.out.println(" -xml output as XML instead of HTML"); System.out.println(" -version Only output version of xsddoc"); System.out.println(" -d -debug Output debug messages"); System.out.println(" -? -help Print this help message"); } - } --- 167,177 ---- System.out.println(" -g -hideGroups hide groups in overview pages"); System.out.println(" -a -hideAttributes hide attributes in overview pages"); + System.out.println(" -css <css-file> provide external CSS file"); System.out.println(" -xml output as XML instead of HTML"); + System.out.println(" -launch Launch documentation after creation"); + System.out.println(" -cf Create output folder if not exists"); System.out.println(" -version Only output version of xsddoc"); System.out.println(" -d -debug Output debug messages"); System.out.println(" -? -help Print this help message"); } } |
From: Kurt R. <kr...@us...> - 2005-04-22 14:41:07
|
Update of /cvsroot/xframe/xsddoc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11971 Modified Files: project.properties Log Message: XMLSchema.xsd readded Index: project.properties =================================================================== RCS file: /cvsroot/xframe/xsddoc/project.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** project.properties 9 Dec 2004 12:44:12 -0000 1.6 --- project.properties 22 Apr 2005 14:40:59 -0000 1.7 *************** *** 37,41 **** # ------------------------------------------------------------------- maven.xsddoc.src=samples ! maven.xsddoc.include=stress/stress.xsd,xsddoc/xsddoc.xsd # ------------------------------------------------------------------- --- 37,41 ---- # ------------------------------------------------------------------- maven.xsddoc.src=samples ! maven.xsddoc.include=stress/stress.xsd,xsddoc/xsddoc.xsd,XMLSchema/XMLSchema.xsd # ------------------------------------------------------------------- |
From: Kurt R. <kr...@us...> - 2005-04-15 15:56:43
|
Update of /cvsroot/xframe/xsddoc/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9803/xdocs Modified Files: navigation.xml Added Files: install-stylusstudio.xml Log Message: new documentation about how to integrate with Stylus Studio Index: navigation.xml =================================================================== RCS file: /cvsroot/xframe/xsddoc/xdocs/navigation.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** navigation.xml 3 Nov 2004 17:23:25 -0000 1.7 --- navigation.xml 15 Apr 2005 15:56:31 -0000 1.8 *************** *** 38,41 **** --- 38,42 ---- <item name="Console" href="install-console.html"/> <item name="Ant" href="install-ant.html"/> + <item name="Stylus Studio" href="install-stylusstudio.html"/> </item> <item name="Usage" href="usage-console.html"> --- NEW FILE: install-stylusstudio.xml --- <?xml version="1.0" encoding="UTF-8"?> <!-- This file is part of the xframe software package hosted at http://xframe.sourceforge.net Copyright (c) 2003 Kurt Riede. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <document> <properties> <author email="kr...@us...">Kurt Riede</author> <title>xframe - xsddoc - documentation tool for W3C XML Schemas</title> </properties> <meta name="keyword" content="XML, XML Schema, XSLT, DOM, GUI, SWT, Swing, Documentation, Generator, schema based programming, applicatio, business model, mapping, sourceforge, automatic, independent, standard, development, Java, Kurt Riede"/> <body> <section name="Requirements"> <p>You should have a current version of <a href="http://www.stylusstudio.com" target="_blank">Stylus Studio</a> installed.</p> </section> <section name="Integration of xsddoc in Stylus Studio"> <p>1. Install <tt>xsddoc</tt> as a <a href="./install-console.html">command line tool</a>.</p> <p>2. Start Stylus Studio.</p> <p>3. Open the <tt>Options</tt> in the <tt>Tools</tt> menu..</p> <p>4. Create a new <tt>Custom Tool</tt> as described in the following screenshot.</p> <p><img src="./images/stylusstudio-customtool.png"/></p> </section> <section name="Usage of xsddoc in Stylus Studio"> <p>Open the XML Schema file that you want to document. Then select the <tt>xsddoc</tt> entry in the <tt>Tools</tt> menu to start <tt>xsddoc</tt> for the currently open file. The output folder is the same folder as the folder of your schema file. If this is not desired, you could e.g. active the option <tt>Prompt for arguments</tt> in the Custom Tools settings of xsddoc, so you can change it before the tool runs.</p> <p><img src="./images/stylusstudio-use-xsddoc"/></p> </section> </body> </document> |
From: Kurt R. <kr...@us...> - 2005-04-15 15:56:43
|
Update of /cvsroot/xframe/xsddoc/xdocs/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9803/xdocs/images Added Files: stylusstudio-customtool.png stylusstudio-use-xsddoc.png Log Message: new documentation about how to integrate with Stylus Studio --- NEW FILE: stylusstudio-use-xsddoc.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stylusstudio-customtool.png --- (This appears to be a binary file; contents omitted.) |
From: Kurt R. <kr...@us...> - 2005-04-09 15:53:51
|
Update of /cvsroot/xframe/swing/samples/net/sf/xframe/swing/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3360/samples/net/sf/xframe/swing/demo Added Files: JXTableDemo4.java Log Message: new tests to demonstrate usage of method prepareRenderer() and class DefaultJXTableCellRenderer --- NEW FILE: JXTableDemo4.java --- package net.sf.xframe.swing.demo; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.ListSelectionModel; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableModel; import net.sf.xframe.swing.JXTable; /** * Demonstrates the use of method * {@link net.sf.xframe.swing.JXTable#prepareRenderer prepareRenderer}. * * @author <a href=mailto:kr...@us...>Kurt Riede</a> */ public final class JXTableDemo4 { /** * Static main method. * @param args arguments */ public static void main(final String[] args) { new JXTableDemo4().run(); } /** * Our own table model. */ private final class MyTableModel extends DefaultTableModel { private MyTableModel(final int rowCount, final int columnCount) { super(rowCount, columnCount); } public boolean isCellEditable(final int row, final int column) { return ((row + column) % 2) == 0; } } /** * Run the demo. */ public void run() { // create the demo frame final JFrame frame = new JFrame("JXTable Demo"); final BorderLayout layout = new BorderLayout(); frame.getContentPane().setLayout(layout); // create and add the table final TableModel model1 = new MyTableModel(15, 23); final TableModel model2 = new MyTableModel(15, 13); final JXTable table = new JXTable(model1, 3) { public Component prepareRenderer(final TableCellRenderer renderer, final int row, final int column) { final Component c = super.prepareRenderer(renderer, row, column); final int col = getColumnModel().getColumn(column).getModelIndex(); if (((row + col) % 2) != 0) { c.setBackground(Color.LIGHT_GRAY); } else { c.setBackground(Color.WHITE); } return c; } }; table.setModel(model2); table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); frame.getContentPane().add(table, BorderLayout.CENTER); // create some buttons to change the number of frozen columns final JPanel buttonPanel = new JPanel(); frame.getContentPane().add(buttonPanel, BorderLayout.NORTH); buttonPanel.setLayout(new FlowLayout()); for (int i = 0; i < 10; i++) { final JButton button = new JButton("Freeze " + i); final int num = i; button.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { table.setFrozenColumns(num); } }); buttonPanel.add(button); } // set size, center and show the demo frame frame.setSize(650, 300); final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); final Dimension frameSize = frame.getSize(); frame.setLocation((screen.width - frameSize.width) / 2, (screen.height - frameSize.height) / 2); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } } |
From: Kurt R. <kr...@us...> - 2005-04-09 15:53:06
|
Update of /cvsroot/xframe/swing/samples/net/sf/xframe/swing/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2837/samples/net/sf/xframe/swing/demo Modified Files: JXTableDemo3.java Log Message: new tests to demonstrate usage of method prepareRenderer() and class DefaultJXTableCellRenderer Index: JXTableDemo3.java =================================================================== RCS file: /cvsroot/xframe/swing/samples/net/sf/xframe/swing/demo/JXTableDemo3.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JXTableDemo3.java 2 Apr 2005 21:12:06 -0000 1.2 --- JXTableDemo3.java 9 Apr 2005 15:52:56 -0000 1.3 *************** *** 2,5 **** --- 2,7 ---- import java.awt.BorderLayout; + import java.awt.Color; + import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; *************** *** 11,22 **** import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.table.DefaultTableModel; - import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; import net.sf.xframe.swing.JXTable; /** ! * Simple demo of the JXTable with frozen columns. * * @author <a href=mailto:kr...@us...>Kurt Riede</a> --- 13,26 ---- import javax.swing.JFrame; import javax.swing.JPanel; + import javax.swing.ListSelectionModel; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; import net.sf.xframe.swing.JXTable; + import net.sf.xframe.swing.table.DefaultJXTabelCellRenderer; /** ! * Demonstrates the use of a ! * {@link net.sf.xframe.swing.DefaultJXTabelCellRenderer DefaultJXTabelCellRenderer}. * * @author <a href=mailto:kr...@us...>Kurt Riede</a> *************** *** 33,36 **** --- 37,70 ---- /** + * Our own table model. + */ + private final class MyTableModel extends DefaultTableModel { + + private MyTableModel(final int rowCount, final int columnCount) { + super(rowCount, columnCount); + } + + public boolean isCellEditable(final int row, final int column) { + return ((row + column) % 2) == 0; + } + } + + /** + * Our own cell renderer. + */ + private class ColoredTableCellRenderer extends DefaultJXTabelCellRenderer { + public Component getTableCellRendererComponent(final JXTable table, final Object value, final boolean selected, + final boolean focused, final int row, final int column) { + final int col = table.getColumnModel().getColumn(column).getModelIndex(); + if (((row + col) % 2) != 0) { + setBackground(Color.LIGHT_GRAY); + } else { + setBackground(null); + } + return this; + } + } + + /** * Run the demo. */ *************** *** 41,51 **** frame.getContentPane().setLayout(layout); // create and add the table ! final TableModel model1 = new DefaultTableModel(15, 3); ! final TableModel model2 = new DefaultTableModel(15, 13); ! final JXTable jxTable = new JXTable(model1); ! final TableColumnModel cm = jxTable.getColumnModel(); ! jxTable.setModel(model2); ! jxTable.setFrozenColumns(2); ! frame.getContentPane().add(jxTable, BorderLayout.CENTER); // create some buttons to change the number of frozen columns final JPanel buttonPanel = new JPanel(); --- 75,88 ---- frame.getContentPane().setLayout(layout); // create and add the table ! final TableModel model1 = new MyTableModel(15, 23); ! final TableModel model2 = new MyTableModel(15, 13); ! final JXTable table = new JXTable(model1, 3); ! table.setModel(model2); ! final ColoredTableCellRenderer renderer = new ColoredTableCellRenderer(); ! for (int i = 0; i < table.getColumnModel().getColumnCount() - 1; i++) { ! table.getColumnModel().getColumn(i).setCellRenderer(renderer); ! } ! table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); ! frame.getContentPane().add(table, BorderLayout.CENTER); // create some buttons to change the number of frozen columns final JPanel buttonPanel = new JPanel(); *************** *** 57,61 **** button.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { ! jxTable.setFrozenColumns(num); } }); --- 94,98 ---- button.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { ! table.setFrozenColumns(num); } }); |
From: Kurt R. <kr...@us...> - 2005-04-09 15:51:26
|
Update of /cvsroot/xframe/swing/samples/net/sf/xframe/swing/demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2273/samples/net/sf/xframe/swing/demo Modified Files: JXTable2Applet.java Log Message: some bugs fixed and updated to new JXTable Index: JXTable2Applet.java =================================================================== RCS file: /cvsroot/xframe/swing/samples/net/sf/xframe/swing/demo/JXTable2Applet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JXTable2Applet.java 2 Apr 2005 21:12:06 -0000 1.4 --- JXTable2Applet.java 9 Apr 2005 15:51:16 -0000 1.5 *************** *** 43,47 **** import javax.swing.JPanel; import javax.swing.RootPaneContainer; - import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; --- 43,46 ---- *************** *** 237,251 **** private void addColumnGroupTable1() { final JXTableHeader header = table1.getTableHeader(); ! final DefaultTableModel model = (DefaultTableModel) table1.getModel(); ! model.addColumn("from"); ! model.addColumn("to"); ! model.fireTableStructureChanged(); final TableColumnModel columnModel = table1.getColumnModel(); final int numColumns = columnModel.getColumnCount(); ! columnModel.addColumn(createColumn(numColumns, SCROLL_BLOCK_WIDTH / 2, "from")); ! columnModel.addColumn(createColumn(numColumns, SCROLL_BLOCK_WIDTH / 2, "to")); ! final ColumnGroup saisonGroup = new ColumnGroup("timeframe " + ((numColumns) / 2 + 1)); ! saisonGroup.add(columnModel.getColumn(numColumns + 0)); saisonGroup.add(columnModel.getColumn(numColumns + 1)); header.addColumnGroup(saisonGroup); } --- 236,249 ---- private void addColumnGroupTable1() { final JXTableHeader header = table1.getTableHeader(); ! final SaisonsTableModel model = (SaisonsTableModel) table1.getModel(); ! model.addSaison(); ! // model.fireTableStructureChanged(); final TableColumnModel columnModel = table1.getColumnModel(); final int numColumns = columnModel.getColumnCount(); ! columnModel.addColumn(createColumn(numColumns + 0, SCROLL_BLOCK_WIDTH / 2, "from")); ! columnModel.addColumn(createColumn(numColumns + 1, SCROLL_BLOCK_WIDTH / 2, "to")); ! final ColumnGroup saisonGroup = new ColumnGroup("timeframe " + ((numColumns + 2) / 2)); saisonGroup.add(columnModel.getColumn(numColumns + 1)); + saisonGroup.add(columnModel.getColumn(numColumns + 2)); header.addColumnGroup(saisonGroup); } *************** *** 266,272 **** columnModel.addColumn(createColumn(numColumns + 2, 40, "P")); final ColumnGroup columnGroup = new ColumnGroup("timeframe " + ((numColumns - TABLE_2_FROZEN_COLS) / 3 + 1)); - columnGroup.add(columnModel.getColumn(numColumns + 0)); columnGroup.add(columnModel.getColumn(numColumns + 1)); columnGroup.add(columnModel.getColumn(numColumns + 2)); header.addColumnGroup(columnGroup); } --- 264,270 ---- columnModel.addColumn(createColumn(numColumns + 2, 40, "P")); final ColumnGroup columnGroup = new ColumnGroup("timeframe " + ((numColumns - TABLE_2_FROZEN_COLS) / 3 + 1)); columnGroup.add(columnModel.getColumn(numColumns + 1)); columnGroup.add(columnModel.getColumn(numColumns + 2)); + columnGroup.add(columnModel.getColumn(numColumns + 3)); header.addColumnGroup(columnGroup); } *************** *** 300,310 **** */ private JXTable createTable1() { - final String[] columnNames = {"from", "to", "from", "to", "from", "to", "from", "to" }; Saisons saisons = getSampleSaisons(); table1Model = new SaisonsTableModel(saisons); - // table1Model = new DefaultTableModel(columnNames, TABLE_1_ROWS); table1 = new JXTable(table1Model); final TableColumnModel columnModel = table1.getColumnModel(); - final JXTableHeader header = table1.getTableHeader(); for (int i = 0; i < columnGroupsCount; i++) { --- 298,305 ---- *************** *** 404,407 **** --- 399,406 ---- ///////////////////////////////////////// + /** + * A simple business model for a list of saisons. + * @see Saison + */ private class Saisons { private List saisons = new ArrayList(); *************** *** 425,428 **** --- 424,430 ---- } + /** + * A simple business model for a saison, consisting of a list of date-ranges. + */ private class Saison { private List durations = new ArrayList(); *************** *** 439,442 **** --- 441,447 ---- } + /** + * A simple business model for a duration (date-range), consisting of two dates (<tt>from</tt> and <tt>to</tt>). + */ private class Duration { private Date from = null; *************** *** 452,465 **** ///////////////////////////////////////// ! private class SaisonsTableModel extends AbstractTableModel { private Saisons saisons; public SaisonsTableModel(final Saisons s) { saisons = s; } public int getColumnCount() { ! return saisons.getSaisonCount() * 2; } public int getRowCount() { ! return saisons.getMaxDurations(); } public boolean isCellEditable(final int rowIndex, final int columnIndex) { --- 457,486 ---- ///////////////////////////////////////// ! private class SaisonsTableModel extends DefaultTableModel { private Saisons saisons; public SaisonsTableModel(final Saisons s) { saisons = s; } + public void addSaison() { + Saison saison = new Saison(); + for (int k = 0; k < 3; k++) { + Duration duration = new Duration(); + saison.addDuration(duration); + } + saisons.addSaison(saison); + // addColumn("from"); + // addColumn("to"); + } public int getColumnCount() { ! if (saisons != null) { ! return saisons.getSaisonCount() * 2; ! } ! return 0; } public int getRowCount() { ! if (saisons != null) { ! return saisons.getMaxDurations(); ! } ! return 0; } public boolean isCellEditable(final int rowIndex, final int columnIndex) { |
From: Kurt R. <kr...@us...> - 2005-04-09 12:48:22
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing/table In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5698/src/net/sf/xframe/swing/table Modified Files: KTable.java Added Files: DefaultJXTabelCellRenderer.java Log Message: fix for bug [1178013] Wrong isCellEditable concept support for cell renderers thru new class DefaultJXTableCellRenderer --- NEW FILE: DefaultJXTabelCellRenderer.java --- /* This file is part of the xframe software package hosted at http://xframe.sourceforge.net Copyright (c) 2003 Kurt Riede. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sf.xframe.swing.table; import java.awt.Component; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellRenderer; import net.sf.xframe.swing.JXTable; /** * The standard class for rendering (displaying) individual cells * in a {@link net.sf.xframe.swing.JXTable JXTable}. * * @author <a href=mailto:kr...@us...>Kurt Riede</a> */ public class DefaultJXTabelCellRenderer extends DefaultTableCellRenderer { /** * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, * java.lang.Object, boolean, boolean, int, int) */ public final Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (table instanceof KTable) { final KTable kTable = (KTable) table; final JXTable jxTable = kTable.getEnclosingJXTable(); if (kTable.getType() == KTable.TYPE_LOCKED) { return getTableCellRendererComponent(jxTable, value, isSelected, hasFocus, row, column); } else if (kTable.getType() == KTable.TYPE_SCROLL) { final int frozenColumns = jxTable.getFrozenColumns(); return getTableCellRendererComponent(jxTable, value, isSelected, hasFocus, row, column + frozenColumns); } } final Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); return c; } /** * Returns the default table cell renderer. * * @param jxTable the <code>JXTable</code> * @param value the value to assign to the cell at * <code>[row, column]</code> * @param isSelected true if cell is selected * @param hasFocus true if cell has focus * @param row the row of the cell to render * @param column the column of the cell to render * @return the default table cell renderer */ public Component getTableCellRendererComponent(final JXTable jxTable, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { final int frozenColumns = jxTable.getFrozenColumns(); if (column < frozenColumns) { final JTable table = jxTable.getLockedTable(); final TableCellRenderer renderer = table.getColumnModel().getColumn(column).getCellRenderer(); return renderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } else { final JTable table = jxTable.getScrollTable(); final TableCellRenderer renderer = table.getColumnModel().getColumn(column - frozenColumns).getCellRenderer(); return renderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column - frozenColumns); } } } Index: KTable.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/table/KTable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** KTable.java 12 Nov 2004 11:37:17 -0000 1.2 --- KTable.java 9 Apr 2005 12:48:13 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- package net.sf.xframe.swing.table; + import java.awt.Component; import java.awt.Rectangle; import java.awt.event.ItemEvent; *************** *** 39,46 **** import javax.swing.table.DefaultTableModel; import javax.swing.table.JTableHeader; ! import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; /** * Internal extension of JTable fixes for common swing problems and additional --- 40,49 ---- import javax.swing.table.DefaultTableModel; import javax.swing.table.JTableHeader; ! import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; import javax.swing.table.TableModel; + import net.sf.xframe.swing.JXTable; + /** * Internal extension of JTable fixes for common swing problems and additional *************** *** 51,57 **** --- 54,72 ---- public final class KTable extends JTable { + /** Identifies a KTable that is a locked table within a {@link net.sf.xframe.swing.JXTable JXTable}. */ + public static final int TYPE_NONE = 0; + + /** Identifies a KTable that is a locked table within a {@link net.sf.xframe.swing.JXTable JXTable}. */ + public static final int TYPE_LOCKED = 1; + + /** Identifies a KTable that is a scrollable table within a {@link net.sf.xframe.swing.JXTable JXTable}. */ + public static final int TYPE_SCROLL = 2; + /** List of event listeners. */ private EventListenerList listenerList = new EventListenerList(); + /** Type of tabel, can be {@link #TYPE_LOCKED}, {@link #TYPE_SCROLL} or {@link #TYPE_NONE}. */ + private int type = TYPE_NONE; + /** * Constructor. *************** *** 117,123 **** * * @param dm the data model for the table */ ! public KTable(final TableModel dm) { ! super(dm); } --- 132,139 ---- * * @param dm the data model for the table + * @param tableType the type of the ({@link #TYPE_LOCKED}, {@link #TYPE_SCROLL} or {@link #TYPE_NONE}) */ ! public KTable(final TableModel dm, final int tableType) { ! this(dm, null, tableType); } *************** *** 131,135 **** */ public KTable(final TableModel dm, final TableColumnModel cm) { ! super(dm, cm); } --- 147,164 ---- */ public KTable(final TableModel dm, final TableColumnModel cm) { ! this(dm, cm, TYPE_NONE); ! } ! ! /** ! * Constructs a table that is initialized with ! * <code>dm</code> as the data model, <code>cm</code> ! * as the column model, and a default selection model. ! * ! * @param dm the data model for the table ! * @param cm the column model for the table ! * @param tableType the type of the ({@link #TYPE_LOCKED}, {@link #TYPE_SCROLL} or {@link #TYPE_NONE}) ! */ ! public KTable(final TableModel dm, final TableColumnModel cm, final int tableType) { ! this(dm, cm, null, tableType); } *************** *** 150,154 **** --- 179,273 ---- */ public KTable(final TableModel dm, final TableColumnModel cm, final ListSelectionModel sm) { + this(dm, cm, sm, TYPE_NONE); + } + + /** + * Constructs a table that is initialized with + * <code>dm</code> as the data model, <code>cm</code> as the + * column model, and <code>sm</code> as the selection model. + * If any of the parameters are <code>null</code> this method + * will initialize the table with the corresponding default model. + * The <code>autoCreateColumnsFromModel</code> flag is set to false + * if <code>cm</code> is non-null, otherwise it is set to true + * and the column model is populated with suitable + * <code>TableColumns</code> for the columns in <code>dm</code>. + * + * @param dm the data model for the table + * @param cm the column model for the table + * @param sm the row selection model for the table + * @param tableType the type of the ({@link #TYPE_LOCKED}, {@link #TYPE_SCROLL} or {@link #TYPE_NONE}) + */ + public KTable(final TableModel dm, final TableColumnModel cm, final ListSelectionModel sm, final int tableType) { super(dm, cm, sm); + type = tableType; + } + + /** + * Getter method for type property. + * + * @return type, can be {@link #LOCKED_TABLE} or {@link #SCROLL_TABLE} + */ + protected int getType() { + return type; + } + + /** + * Sets the parent and type property. + * + * @param pType type of tabel, can be {@link #LOCKED_TABLE} or {@link #SCROLL_TABLE} + */ + protected void setParent(final int pType) { + type = pType; + } + + /** + * @see javax.swing.JTable#isCellEditable(int, int) + */ + public boolean isCellEditable(final int row, final int column) { + final JXTable table = getEnclosingJXTable(); + if (table != null) { + return table.isCellEditable(row, type == TYPE_SCROLL ? column + table.getFrozenColumns() : column); + } + return super.isCellEditable(row, column); + } + + /** + * @see javax.swing.JTable#prepareRenderer(javax.swing.table.TableCellRenderer, int, int) + */ + public Component prepareRenderer(final TableCellRenderer renderer, final int row, final int column) { + final JXTable table = getEnclosingJXTable(); + if (type == TYPE_SCROLL) { + return table.prepareRenderer(renderer, row, column + table.getFrozenColumns()); + } else if (type == TYPE_LOCKED) { + return table.prepareRenderer(renderer, row, column); + } else { + return table.prepareRenderer(renderer, row, column); + } + } + + /** + * Prepares a renderer from the usper class JTable. + * + * @param renderer the <code>TableCellRenderer</code> to prepare + * @param row the row of the cell to render, where 0 is the first row + * @param column the column of the cell to render, + * where 0 is the first column + * @return the <code>Component</code> under the event location + */ + public Component prepareRendererSuper(final TableCellRenderer renderer, final int row, final int column) { + return super.prepareRenderer(renderer, row, column); + } + + /** + * Returns the enclosing JXTable if exists, else <tt>null</tt>. + * + * @return enclosing JXTable or <tt>null</tt> + */ + JXTable getEnclosingJXTable() { + try { + return (JXTable) getParent().getParent().getParent(); + } catch (RuntimeException e) { + return null; + } } *************** *** 390,442 **** /** - * Returns the index of a column in a column model. - * - * @param cm the column model - * @param column the column - * @return the index of the colum nin the column model - */ - private static int indexOf(final TableColumnModel cm, final TableColumn column) { - for (int i = cm.getColumnCount() - 1; i >= 0; --i) { - if (column.equals(cm.getColumn(i))) { - return i; - } - } - return -1; - } - - /** - * Selection change handler. - * - * <p> - * This implementation uses the following conventions: - * <ul> - * <li> <code>toggle</code>: <em>false</em>, <code>extend</code>: <em>false</em>. - * Clear the previous selection and ensure the new cell is selected. - * <li> <code>toggle</code>: <em>false</em>, <code>extend</code>: <em>true</em>. - * Extend the previous selection to include the specified cell. - * <li> <code>toggle</code>: <em>true</em>, <code>extend</code>: <em>false</em>. - * If the specified cell is selected, deselect it. If it is not selected, select it. - * <li> <code>toggle</code>: <em>true</em>, <code>extend</code>: <em>true</em>. - * Leave the selection state as it is, but move the anchor index to the specified location. - * </ul> - * </p> - * - * @param sm the selection model - * @param index the index - * @param toggle see description above - * @param extend if true, extend the current selection - */ - private static void changeTableColumnModels( - final ListSelectionModel sm, - final int index, - final boolean toggle, - final boolean extend) { - final int anchor = sm.getAnchorSelectionIndex(); - final boolean selected = sm.isSelectedIndex(index); - final boolean anchorSelected = anchor != -1 && sm.isSelectedIndex(anchor); - changeTableColumnModels(sm, index, toggle, extend, selected, anchorSelected); - } - - /** * Selection change handler. * --- 509,512 ---- |
From: Kurt R. <kr...@us...> - 2005-04-09 12:48:22
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5698/src/net/sf/xframe/swing Modified Files: JXTable.java Log Message: fix for bug [1178013] Wrong isCellEditable concept support for cell renderers thru new class DefaultJXTableCellRenderer Index: JXTable.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/JXTable.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** JXTable.java 7 Apr 2005 17:30:04 -0000 1.12 --- JXTable.java 9 Apr 2005 12:48:13 -0000 1.13 *************** *** 126,133 **** /** the table with the locked columns. */ ! private final JTable lockedTable; /** The table with the scrollable columns. */ ! private final JTable scrollTable; /** Scroll pane adjuster. */ --- 126,133 ---- /** the table with the locked columns. */ ! private final KTable lockedTable; /** The table with the scrollable columns. */ ! private final KTable scrollTable; /** Scroll pane adjuster. */ *************** *** 269,274 **** } // create the two tables ! lockedTable = new KTable(model, cm1, sm); ! scrollTable = new KTable(model, cm2, sm); lockedHeader = new ColumnGroupHeader(lockedTable.getColumnModel()); scrollHeader = new ColumnGroupHeader(scrollTable.getColumnModel()); --- 269,274 ---- } // create the two tables ! lockedTable = new KTable(model, cm1, sm, KTable.TYPE_LOCKED); ! scrollTable = new KTable(model, cm2, sm, KTable.TYPE_SCROLL); lockedHeader = new ColumnGroupHeader(lockedTable.getColumnModel()); scrollHeader = new ColumnGroupHeader(scrollTable.getColumnModel()); *************** *** 901,918 **** } } /** * Returns true if the cell at <code>row</code> and <code>column</code> ! * is editable. Otherwise, invoking <code>setValueAt</code> on the cell * will have no effect. * <p> ! * <b>Note</b>: The column is specified in the table view's display ! * order, and not in the <code>TableModel</code>'s column ! * order. This is an important distinction because as the ! * user rearranges the columns in the table, ! * the column at a given index in the view will change. ! * Meanwhile the user's actions never affect the model's ! * column ordering. ! * ! * * @param row the row whose value is to be queried * @param column the column whose value is to be queried --- 901,915 ---- } } + /** * Returns true if the cell at <code>row</code> and <code>column</code> ! * is editable. Otherwise, invoking <code>setValueAt</code> on the cell * will have no effect. * <p> ! * <b>Note</b>: The column is specified in the table view's display order, ! * and not in the <code>TableModel</code>'s column order. This is an ! * important distinction because as the user rearranges the columns in the ! * table, the column at a given index in the view will change. Meanwhile the ! * user's actions never affect the model's column ordering. * @param row the row whose value is to be queried * @param column the column whose value is to be queried *************** *** 921,929 **** */ public boolean isCellEditable(final int row, final int column) { ! if (column < frozenColumns) { ! return lockedTable.isCellEditable(row, column); ! } else { ! return scrollTable.isCellEditable(row, column - frozenColumns); ! } } --- 918,922 ---- */ public boolean isCellEditable(final int row, final int column) { ! return getModel().isCellEditable(row, convertColumnIndexToModel(column)); } *************** *** 1573,1593 **** * where 0 is the first column * @return the <code>Component</code> under the event location */ public Component prepareRenderer(final TableCellRenderer renderer, final int row, final int column) { if (column < frozenColumns) { ! return lockedTable.prepareRenderer(renderer, row, column); } else { ! return scrollTable.prepareRenderer(renderer, row, column - frozenColumns); } } /** ! * Removes <code>aColumn</code> from this <code>JTable</code>'s ! * array of columns. Note: this method does not remove the column ! * of data from the model; it just removes the <code>TableColumn</code> ! * that was responsible for displaying it. ! * ! * @param aColumn the <code>TableColumn</code> to be removed ! * @see #addColumn */ public void removeColumn(final TableColumn aColumn) { --- 1566,1586 ---- * where 0 is the first column * @return the <code>Component</code> under the event location + * TODO handle the renderer correctly across the KTables */ public Component prepareRenderer(final TableCellRenderer renderer, final int row, final int column) { if (column < frozenColumns) { ! return lockedTable.prepareRendererSuper(renderer, row, column); } else { ! return scrollTable.prepareRendererSuper(renderer, row, column - frozenColumns); } } /** ! * Removes <code>aColumn</code> from this <code>JTable</code>'s array ! * of columns. Note: this method does not remove the column of data from the ! * model; it just removes the <code>TableColumn</code> that was ! * responsible for displaying it. ! * @param aColumn the <code>TableColumn</code> to be removed ! * @see #addColumn */ public void removeColumn(final TableColumn aColumn) { *************** *** 2708,2712 **** return adjuster; } ! /** * Sets the <code>transferHandler</code> property, --- 2701,2705 ---- return adjuster; } ! /** * Sets the <code>transferHandler</code> property, *************** *** 2715,2723 **** * <p> * If <code>newHandler</code> is not null, and the system property ! * <code>suppressSwingDropSupport</code> is not true, this will * install a <code>DropTarget</code> on the <code>JComponent</code>. * The default for the system property is false, so that a * <code>DropTarget</code> will be added. ! * * @param newHandler mechanism for transfer of data to * and from the component --- 2708,2716 ---- * <p> * If <code>newHandler</code> is not null, and the system property ! * <code>suppressSwingDropSupport</code> is not true, this will * install a <code>DropTarget</code> on the <code>JComponent</code>. * The default for the system property is false, so that a * <code>DropTarget</code> will be added. ! * * @param newHandler mechanism for transfer of data to * and from the component *************** *** 2726,2731 **** * @see javax.swing.JComponent#setTransferHandler(javax.swing.TransferHandler) */ ! public void setTransferHandler(TransferHandler newHandler) ! { //The KTables are the ones that need the handler getLockedTable().setTransferHandler(newHandler); --- 2719,2723 ---- * @see javax.swing.JComponent#setTransferHandler(javax.swing.TransferHandler) */ ! public void setTransferHandler(final TransferHandler newHandler) { //The KTables are the ones that need the handler getLockedTable().setTransferHandler(newHandler); |
From: Kurt R. <kr...@us...> - 2005-04-09 12:42:58
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing/scroll In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3372/src/net/sf/xframe/swing/scroll Modified Files: AbstractScrollBinder.java Log Message: method getComponents() is now final Index: AbstractScrollBinder.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/scroll/AbstractScrollBinder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractScrollBinder.java 2 Apr 2005 21:12:07 -0000 1.3 --- AbstractScrollBinder.java 9 Apr 2005 12:42:46 -0000 1.4 *************** *** 188,192 **** * @return components map */ ! protected HashMap getComponents() { return components; } --- 188,192 ---- * @return components map */ ! protected final HashMap getComponents() { return components; } |
From: Iñaqui M. <ina...@us...> - 2005-04-07 17:30:13
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31168/src/net/sf/xframe/swing Modified Files: JXTable.java Log Message: Fix for bug 1177993: DnD problem Index: JXTable.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/JXTable.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JXTable.java 6 Apr 2005 20:21:38 -0000 1.11 --- JXTable.java 7 Apr 2005 17:30:04 -0000 1.12 *************** *** 47,50 **** --- 47,51 ---- import javax.swing.ScrollPaneConstants; import javax.swing.Scrollable; + import javax.swing.TransferHandler; import javax.swing.border.Border; import javax.swing.event.CellEditorListener; *************** *** 2707,2709 **** --- 2708,2734 ---- return adjuster; } + + /** + * Sets the <code>transferHandler</code> property, + * which is <code>null</code> if the component does + * not support data transfer operations. + * <p> + * If <code>newHandler</code> is not null, and the system property + * <code>suppressSwingDropSupport</code> is not true, this will + * install a <code>DropTarget</code> on the <code>JComponent</code>. + * The default for the system property is false, so that a + * <code>DropTarget</code> will be added. + * + * @param newHandler mechanism for transfer of data to + * and from the component + * + * @see TransferHandler + * @see javax.swing.JComponent#setTransferHandler(javax.swing.TransferHandler) + */ + public void setTransferHandler(TransferHandler newHandler) + { + //The KTables are the ones that need the handler + getLockedTable().setTransferHandler(newHandler); + getScrollTable().setTransferHandler(newHandler); + } } |
From: Kurt R. <kr...@us...> - 2005-04-06 20:25:39
|
Update of /cvsroot/xframe/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18057 Modified Files: xframeCheckstyleSamples Log Message: less restrictive in sample code Index: xframeCheckstyleSamples =================================================================== RCS file: /cvsroot/xframe/swing/xframeCheckstyleSamples,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xframeCheckstyleSamples 27 Dec 2004 15:06:08 -0000 1.1 --- xframeCheckstyleSamples 6 Apr 2005 20:25:29 -0000 1.2 *************** *** 70,74 **** <module name="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"> <property name="ignoreNumbers" value="-1, 0, 1, 2, 3"/> ! <property name="severity" value="warning"/> <property name="tokens" value="NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG"/> </module> --- 70,74 ---- <module name="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"> <property name="ignoreNumbers" value="-1, 0, 1, 2, 3"/> ! <property name="severity" value="ignore"/> <property name="tokens" value="NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG"/> </module> *************** *** 126,152 **** </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"> ! <property name="allowMissingParamTags" value="false"/> ! <property name="allowMissingReturnTag" value="false"/> ! <property name="allowMissingThrowsTags" value="false"/> <property name="allowThrowsTagsForSubclasses" value="false"/> <property name="allowUndeclaredRTE" value="false"/> ! <property name="scope" value="anoninner"/> <property name="severity" value="warning"/> <property name="tokens" value="METHOD_DEF, CTOR_DEF"/> </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"> <property name="checkFirstSentence" value="true"/> <property name="checkHtml" value="true"/> ! <property name="scope" value="anoninner"/> <property name="severity" value="warning"/> <property name="tokens" value="INTERFACE_DEF, CLASS_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"> ! <property name="scope" value="anoninner"/> <property name="severity" value="warning"/> <property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/> </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck"> ! <property name="scope" value="anoninner"/> <property name="severity" value="warning"/> </module> --- 126,156 ---- </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck"> ! <property name="allowMissingParamTags" value="true"/> ! <property name="allowMissingReturnTag" value="true"/> ! <property name="allowMissingThrowsTags" value="true"/> <property name="allowThrowsTagsForSubclasses" value="false"/> <property name="allowUndeclaredRTE" value="false"/> ! <property name="excludeScope" value="nothing"/> ! <property name="scope" value="public"/> <property name="severity" value="warning"/> <property name="tokens" value="METHOD_DEF, CTOR_DEF"/> </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"> + <property name="checkEmptyJavadoc" value="false"/> <property name="checkFirstSentence" value="true"/> <property name="checkHtml" value="true"/> ! <property name="scope" value="public"/> <property name="severity" value="warning"/> <property name="tokens" value="INTERFACE_DEF, CLASS_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/> </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"> ! <property name="excludeScope" value="nothing"/> ! <property name="scope" value="public"/> <property name="severity" value="warning"/> <property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/> </module> <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck"> ! <property name="excludeScope" value="nothing"/> ! <property name="scope" value="public"/> <property name="severity" value="warning"/> </module> |
From: Kurt R. <kr...@us...> - 2005-04-06 20:23:25
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing/table In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16637/src/net/sf/xframe/swing/table Modified Files: JXTableHeader.java Log Message: some fixes in the event handling Index: JXTableHeader.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/table/JXTableHeader.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JXTableHeader.java 2 Apr 2005 21:12:06 -0000 1.6 --- JXTableHeader.java 6 Apr 2005 20:23:15 -0000 1.7 *************** *** 49,53 **** * @author <a href=mailto:kr...@us...>Kurt Riede</a> */ ! public final class JXTableHeader extends JComponent implements /* javax.swing.table.TableHeader, */TableColumnModelListener, Accessible { /** --- 49,53 ---- * @author <a href=mailto:kr...@us...>Kurt Riede</a> */ ! public final class JXTableHeader extends JComponent implements TableColumnModelListener, Accessible { /** *************** *** 259,263 **** * @param theTable the associated table */ ! public final void setTable(final JXTable theTable) { table = theTable; } --- 259,263 ---- * @param theTable the associated table */ ! public void setTable(final JXTable theTable) { table = theTable; } *************** *** 267,271 **** * @return the <code>table</code> property */ ! public final JXTable getTable() { return table; } --- 267,271 ---- * @return the <code>table</code> property */ ! public JXTable getTable() { return table; } *************** *** 541,545 **** TableColumnModelEvent event = new TableColumnModelEvent((TableColumnModel) e.getSource(), frozenColumns, e.getToIndex()); ! scrollHeader.columnAdded(e); } else { final TableColumnModelEvent e1 = new TableColumnModelEvent((TableColumnModel) e.getSource(), --- 541,545 ---- TableColumnModelEvent event = new TableColumnModelEvent((TableColumnModel) e.getSource(), frozenColumns, e.getToIndex()); ! scrollHeader.columnAdded(event); } else { final TableColumnModelEvent e1 = new TableColumnModelEvent((TableColumnModel) e.getSource(), *************** *** 568,572 **** TableColumnModelEvent event = new TableColumnModelEvent((TableColumnModel) e.getSource(), frozenColumns, e.getToIndex()); ! scrollHeader.columnRemoved(e); } else { final TableColumnModelEvent e1 = new TableColumnModelEvent((TableColumnModel) e.getSource(), --- 568,572 ---- TableColumnModelEvent event = new TableColumnModelEvent((TableColumnModel) e.getSource(), frozenColumns, e.getToIndex()); ! scrollHeader.columnRemoved(event); } else { final TableColumnModelEvent e1 = new TableColumnModelEvent((TableColumnModel) e.getSource(), *************** *** 595,599 **** TableColumnModelEvent event = new TableColumnModelEvent((TableColumnModel) e.getSource(), frozenColumns, e.getToIndex()); ! scrollHeader.columnMoved(e); } else { final TableColumnModelEvent e1 = new TableColumnModelEvent((TableColumnModel) e.getSource(), --- 595,599 ---- TableColumnModelEvent event = new TableColumnModelEvent((TableColumnModel) e.getSource(), frozenColumns, e.getToIndex()); ! scrollHeader.columnMoved(event); } else { final TableColumnModelEvent e1 = new TableColumnModelEvent((TableColumnModel) e.getSource(), |
From: Kurt R. <kr...@us...> - 2005-04-06 20:21:48
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15916/src/net/sf/xframe/swing Modified Files: JXTable.java Log Message: fix for bug [1177810] setSelectionModel just sets frozenTable's Index: JXTable.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/JXTable.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JXTable.java 4 Apr 2005 16:06:06 -0000 1.10 --- JXTable.java 6 Apr 2005 20:21:38 -0000 1.11 *************** *** 244,248 **** scrollPane = new JScrollPane(); adjuster = new JScrollPaneAdjuster(scrollPane); - frozenColumns = numFrozenColumns; final TableModel model; if (dm == null) { --- 244,247 ---- *************** *** 251,254 **** --- 250,257 ---- model = dm; } + frozenColumns = numFrozenColumns; + if (frozenColumns > model.getColumnCount()) { + frozenColumns = model.getColumnCount(); + } final TableColumnModel cm1; final TableColumnModel cm2; *************** *** 1815,1819 **** final TableColumnModel lockedColumnModel = lockedTable.getColumnModel(); while (lockedTable.getColumnCount() > 0) { ! lockedColumnModel.removeColumn(lockedColumnModel.getColumn(frozenColumns)); } lockedTable.setModel(dataModel); --- 1818,1822 ---- final TableColumnModel lockedColumnModel = lockedTable.getColumnModel(); while (lockedTable.getColumnCount() > 0) { ! lockedColumnModel.removeColumn(lockedColumnModel.getColumn(0)); } lockedTable.setModel(dataModel); *************** *** 1898,1901 **** --- 1901,1905 ---- public void setRowSelectionInterval(final int index0, final int index1) { lockedTable.setRowSelectionInterval(index0, index1); + scrollTable.setRowSelectionInterval(index0, index1); } *************** *** 1909,1912 **** --- 1913,1917 ---- public void setSelectionModel(final ListSelectionModel newModel) { lockedTable.setSelectionModel(newModel); + scrollTable.setSelectionModel(newModel); } |
From: Kurt R. <kr...@us...> - 2005-04-04 16:06:17
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17295/src/net/sf/xframe/swing Modified Files: JXTable.java Log Message: fixed problem with column resizing Index: JXTable.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/JXTable.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JXTable.java 2 Apr 2005 21:06:45 -0000 1.9 --- JXTable.java 4 Apr 2005 16:06:06 -0000 1.10 *************** *** 485,488 **** --- 485,489 ---- lockedColumnModel.addColumn(column); scrollColumnModel.removeColumn(column); + column.addPropertyChangeListener(new ColumnWidthChangeListener()); } lockedTable.setPreferredScrollableViewportSize(lockedTable.getPreferredSize()); *************** *** 1833,1836 **** --- 1834,1841 ---- lockedColumnModel.removeColumn(lockedColumnModel.getColumn(frozenColumns)); } + // add size listeners to all locked columns + for (int i = 0; i < lockedColumnModel.getColumnCount(); i++) { + lockedColumnModel.getColumn(i).addPropertyChangeListener(new ColumnWidthChangeListener()); + } } |
From: Kurt R. <kr...@us...> - 2005-04-02 21:13:07
|
Update of /cvsroot/xframe/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19372 Modified Files: .checkstyle Log Message: code review Index: .checkstyle =================================================================== RCS file: /cvsroot/xframe/swing/.checkstyle,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** .checkstyle 27 Dec 2004 15:03:07 -0000 1.4 --- .checkstyle 2 Apr 2005 21:12:58 -0000 1.5 *************** *** 1,9 **** <?xml version="1.0" encoding="UTF-8"?> <fileset-config file-format-version="1.0.0"> ! <fileset name="samples" enabled="true" check-config-name="xframeCheckstyleSamples"> ! <file-match-pattern match-pattern="demo/([:print:]*).java$" include-pattern="true"/> </fileset> ! <fileset name="src" enabled="true" check-config-name="xframeCheckstyleSource"> ! <file-match-pattern match-pattern="src/([:print:]*).java$" include-pattern="true"/> </fileset> </fileset-config> --- 1,9 ---- <?xml version="1.0" encoding="UTF-8"?> <fileset-config file-format-version="1.0.0"> ! <fileset check-config-name="xframeCheckstyleSamples" enabled="true" name="samples"> ! <file-match-pattern include-pattern="true" match-pattern="samples/(.*).java"/> </fileset> ! <fileset check-config-name="xframeCheckstyleSource" enabled="true" name="src"> ! <file-match-pattern include-pattern="true" match-pattern="src/(.*).java"/> </fileset> </fileset-config> |
From: Kurt R. <kr...@us...> - 2005-04-02 21:12:16
|
Update of /cvsroot/xframe/swing/src/net/sf/xframe/swing/scroll In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18511/src/net/sf/xframe/swing/scroll Modified Files: AbstractScrollBinder.java Log Message: code review Index: AbstractScrollBinder.java =================================================================== RCS file: /cvsroot/xframe/swing/src/net/sf/xframe/swing/scroll/AbstractScrollBinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractScrollBinder.java 12 Nov 2004 11:37:16 -0000 1.2 --- AbstractScrollBinder.java 2 Apr 2005 21:12:07 -0000 1.3 *************** *** 171,175 **** */ public void adjustmentValueChanged(final AdjustmentEvent e) { ! for (final Iterator iterator = components.keySet().iterator(); iterator.hasNext();) { JComponent component = (JComponent) iterator.next(); if (!component.equals(e.getAdjustable())) { --- 171,175 ---- */ public void adjustmentValueChanged(final AdjustmentEvent e) { ! for (final Iterator iterator = getComponents().keySet().iterator(); iterator.hasNext();) { JComponent component = (JComponent) iterator.next(); if (!component.equals(e.getAdjustable())) { *************** *** 183,185 **** --- 183,193 ---- } } + + /** + * Returns the map of components. + * @return components map + */ + protected HashMap getComponents() { + return components; + } } |