Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /antelope/, /antelope/src/ise/antelope/common/

antelope
Discussion topic

Back to topic list

CVS update: /antelope/, /antelope/src/ise/antelope/common/

Author danson
Full name Dale Anson
Date 2004-03-22 20:15:55 PST
Message User: danson Date: 04/03/22 20:15:55 Modified: /antelope/ build.props /antelope/src/ise/antelope/common/ AntelopePanel.java, SAXNodeHandler.java, version.txt Log: general commit File Changes: Directory: /antelope/ ===================== File [changed]: build.props Url: http://antelope.tigris.org/source/browse/antelope/build.props?r1=1.8&r2=1.9 Delta lines: +1 -1 ------------------- --- build.props 22 Mar 2004 23:40:35 -0000 1.8 +++ build.props 23 Mar 2004 04:15:53 -0000 1.9 @@ -2,7 +2,7 @@ #jedit.install.dir=${user.home}/apps/jedit/4.2pre8 jedit.install.dir=c:/jEdit install.dir=${user.home}/.jedit/jars -build.num=3.0.4 +build.num=3.0.5 #docbook.xsl=file:///usr/share/sgml/docbook/xsl-stylesheets-1.60.1 docbook.xsl=file:///C:/cygwin/usr/share/docbook-xsl Directory: /antelope/src/ise/antelope/common/ ============================================= File [changed]: AntelopePanel.java Url: http://antelope.tigris.org/source/browse/antelope/src/ise/antelope/common/AntelopePanel.java?r1=1.5&r2=1.6 Delta lines: +6 -4 ------------------- --- AntelopePanel.java 22 Mar 2004 05:18:04 -0000 1.5 +++ AntelopePanel.java 23 Mar 2004 04:15:53 -0000 1.6 @@ -1,4 +1,4 @@ -// $Id: AntelopePanel.java,v 1.5 2004/03/22 05:18:04 danson Exp $ +// $Id: AntelopePanel.java,v 1.6 2004/03/23 04:15:53 danson Exp $ /* * Based on the Apache Software License, Version 1.1 * @@ -68,7 +68,7 @@ * progress. * * @author Dale Anson, danson@germane-software.com - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * @created July 23, 2002 */ public class AntelopePanel extends JPanel implements Constants { @@ -1082,8 +1082,10 @@ // ProjectHelper is captured p.addBuildListener( _build_logger ); - ProjectHelper ph = ProjectHelper.getProjectHelper(); - ph.parse(p, build_file); + /// this is the "recommended" way, but throws an NPE + //ProjectHelper ph = ProjectHelper.getProjectHelper(); + //ph.parse(p, build_file); + ProjectHelper.configureProject(p, build_file); p.setProperty( "ant.file", build_file.getAbsolutePath() ); p.setProperty( "ant.version", Main.getAntVersion() ); File [changed]: SAXNodeHandler.java Url: http://antelope.tigris.org/source/browse/antelope/src/ise/antelope/common/SAXNodeHandler.java?r1=1.1&r2=1.2 Delta lines: +37 -7 -------------------- --- SAXNodeHandler.java 15 Feb 2004 22:15:18 -0000 1.1 +++ SAXNodeHandler.java 23 Mar 2004 04:15:53 -0000 1.2 @@ -12,17 +12,18 @@ import org.xml.sax.Attributes; import org.xml.sax.InputSource; -import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.LocatorImpl; + + /** * Builds a tree of TreeNodes as a SAX parser reads an xml file. * * @author Dale Anson, danson@germane-software.com - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ public class SAXNodeHandler extends DefaultHandler { @@ -51,6 +52,11 @@ infile = in; } + public SAXNodeHandler( File in, SAXTreeNode root ) { + infile = in; + rootNode = root; + } + /** * Sets the documentLocator attribute of the SAXNodeHandler object * @@ -89,11 +95,37 @@ public void startElement( String uri, String localName, String qName, Attributes attributes ) throws SAXException { Locator l = new LocatorImpl( locator ); SAXTreeNode child = new SAXTreeNode( qName, new Point( l.getLineNumber(), l.getColumnNumber() ), attributes ); + if ( infile != null ) + child.setFile( infile ); + if ( qName.equals( "import" ) ) { + int index = attributes.getIndex( "file" ); + if ( index > -1 ) { + String filename = attributes.getValue( index ); + File f = new File( filename ); + if ( !f.exists() ) { + f = new File( infile.getParent(), filename ); + } + System.out.println("file = " + f.toString()); + if ( f.exists() ) { + try { + System.out.println("attempting import"); + InputSource source = new InputSource( new FileReader( f ) ); + SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); + SAXNodeHandler handler = new SAXNodeHandler( f, getRoot() ); + handler.setDocumentLocator( locator ); + parser.parse( source, handler ); + } + catch ( Exception e ) { + e.printStackTrace(); + } + } + } + } if ( stack.empty() ) { rootNode = child; } else { - SAXTreeNode parent = (SAXTreeNode)stack.peek(); + SAXTreeNode parent = ( SAXTreeNode ) stack.peek(); parent.add( child ); } stack.push( child ); @@ -121,8 +153,7 @@ * @param systemId Description of the Parameter * @exception SAXException Description of the Exception */ - public void notationDecl( String name, String publicId, String systemId ) throws SAXException { - } + public void notationDecl( String name, String publicId, String systemId ) throws SAXException {} /** @@ -134,8 +165,7 @@ * @param noticationName Description of the Parameter * @exception SAXException Description of the Exception */ - public void unparsedEntityDecl( String name, String publicId, String systemId, String noticationName ) throws SAXException { - } + public void unparsedEntityDecl( String name, String publicId, String systemId, String noticationName ) throws SAXException {} /** * Description of the Method File [changed]: version.txt Url: http://antelope.tigris.org/source/browse/antelope/src/ise/antelope/common/version.txt?r1=1.14&r2=1.15 Delta lines: +1 -1 ------------------- --- version.txt 22 Mar 2004 23:40:36 -0000 1.14 +++ version.txt 23 Mar 2004 04:15:53 -0000 1.15 @@ -1,2 +1,2 @@ -VERSION=3.0.4 +VERSION=3.0.5 DATE=March 22 2004 --------------------------------------------------------------------- To unsubscribe, e-mail: cvs-unsubscribe@antelope.tigris.org For additional commands, e-mail: cvs-help@antelope.tigris.org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /antelope/, /antelope/src/ise/antelope/common/ danson Dale Anson 2004-03-22 20:15:55 PST
Messages per page: