[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units While.java,NONE,1.1
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2004-09-11 20:08:48
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19267/src/net/sourceforge/idrs/deploy/compile/units Added Files: While.java Log Message: Added a "while" tag that allows a condition for looping : <while condition="value < x"> . . . </while> Previosly a script block had to be used to do while loops. The condition is in the form of whatever the scriptcontext uses --- NEW FILE: While.java --- /* Copyright (C) 2002-2004 Marc Boorshtein The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. */ package net.sourceforge.idrs.deploy.compile.units; import java.util.Vector; import net.sourceforge.idrs.core.report.TagLine; import net.sourceforge.idrs.core.report.WhileLine; import net.sourceforge.idrs.deploy.compile.CompilerState; import org.xml.sax.Attributes; /** * @author mlb * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class While extends Body { String condition; private WhileLine whileLine; /** *allows for a compiler to use the attributes of the calling tag */ public void setAttributes(Attributes atts) throws Exception { this.atts = atts; condition = atts.getValue("condition"); this.whileLine = new WhileLine(condition); } /** *allows for the compiler to work with the current state of the page compilation */ public void setState(CompilerState state) throws Exception { this.state = state; state.sealLine(); state.pushLines(); //state.addRepeatLine(id,color1,color2); } /** *Retrieves the current repeat line */ public WhileLine getWhileLine() { return this.whileLine; } /** * allows for the execution of any wrap-up code at the hitting of the end tag */ public void seal() throws Exception { //if (state.getCurrentLine() != null) state.sealLine(); Vector lines = state.popLines(); //System.out.println("num lines repeat : " + lines.size()); whileLine.setLines(lines); state.setLine(whileLine); state.sealLine(); } } |