morgand 2003/01/25 23:50:23 Modified: jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing ActionTag.java BorderAlignTag.java BorderLayoutTag.java BorderTagSupport.java ComponentTag.java DialogTag.java FontTag.java LayoutTagSupport.java TableLayoutTag.java TableModelColumnTag.java TdTag.java TitledBorderTag.java TrTag.java WindowListenerTag.java jelly/src/java/org/apache/commons/jelly DynaBeanTagSupport.java DynaTagSupport.java jelly/src/java/org/apache/commons/jelly/tags/core UseListTag.java Log: converted swing taglib from Exception to JellyTagException Revision Changes Path 1.7 +0 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ActionTag.java Index: ActionTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ActionTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ActionTag.java 24 Jan 2003 22:53:33 -0000 1.6 +++ ActionTag.java 26 Jan 2003 07:50:23 -0000 1.7 @@ -68,7 +68,6 @@ import javax.swing.AbstractAction; import javax.swing.Action; -import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.MissingAttributeException; import org.apache.commons.jelly.XMLOutput; 1.6 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/BorderAlignTag.java Index: BorderAlignTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/BorderAlignTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- BorderAlignTag.java 24 Jan 2003 22:53:33 -0000 1.5 +++ BorderAlignTag.java 26 Jan 2003 07:50:23 -0000 1.6 @@ -94,7 +94,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { invokeBody(output); } 1.4 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/BorderLayoutTag.java Index: BorderLayoutTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/BorderLayoutTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BorderLayoutTag.java 11 Dec 2002 12:40:57 -0000 1.3 +++ BorderLayoutTag.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -123,7 +123,7 @@ /** * Creates a BorderLayout */ - protected LayoutManager createLayoutManager() throws Exception { + protected LayoutManager createLayoutManager() { return new BorderLayout(hgap, vgap); } } 1.5 +4 -4 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/BorderTagSupport.java Index: BorderTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/BorderTagSupport.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BorderTagSupport.java 11 Dec 2002 12:40:57 -0000 1.4 +++ BorderTagSupport.java 26 Jan 2003 07:50:23 -0000 1.5 @@ -63,7 +63,7 @@ import javax.swing.border.Border; -import org.apache.commons.jelly.JellyException; +import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.TagSupport; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; @@ -88,7 +88,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { Border border = createBorder(); @@ -104,7 +104,7 @@ } else { if (var == null) { - throw new JellyException( "Either the 'var' attribute must be specified to export this Border or this tag must be nested within a JellySwing widget tag" ); + throw new JellyTagException( "Either the 'var' attribute must be specified to export this Border or this tag must be nested within a JellySwing widget tag" ); } } } @@ -128,5 +128,5 @@ /** * Factory method to create a new Border instance. */ - protected abstract Border createBorder() throws Exception; + protected abstract Border createBorder(); } 1.14 +33 -10 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java Index: ComponentTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/ComponentTag.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ComponentTag.java 24 Jan 2003 22:53:33 -0000 1.13 +++ ComponentTag.java 26 Jan 2003 07:50:23 -0000 1.14 @@ -81,7 +81,6 @@ import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.ConvertUtils; -import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.MissingAttributeException; import org.apache.commons.jelly.XMLOutput; @@ -139,29 +138,45 @@ /** * Sets the Font of this component */ - public void setFont(Font font) throws Exception { + public void setFont(Font font) throws JellyTagException { Component component = getComponent(); if ( component != null ) { // lets just try set the 'font' property - BeanUtils.setProperty( component, "font", font ); + try { + BeanUtils.setProperty( component, "font", font ); + } + catch (IllegalAccessException e) { + throw new JellyTagException(e); + } + catch (InvocationTargetException e) { + throw new JellyTagException(e); + } } } /** * Sets the Border of this component */ - public void setBorder(Border border) throws Exception { + public void setBorder(Border border) throws JellyTagException { Component component = getComponent(); if ( component != null ) { - // lets just try set the 'border' property - BeanUtils.setProperty( component, "border", border ); + try { + // lets just try set the 'border' property + BeanUtils.setProperty( component, "border", border ); + } + catch (IllegalAccessException e) { + throw new JellyTagException(e); + } + catch (InvocationTargetException e) { + throw new JellyTagException(e); + } } } /** * Sets the LayoutManager of this component */ - public void setLayout(LayoutManager layout) throws Exception { + public void setLayout(LayoutManager layout) throws JellyTagException { Component component = getComponent(); if ( component != null ) { if ( component instanceof RootPaneContainer ) { @@ -169,15 +184,23 @@ component = rpc.getContentPane(); } - // lets just try set the 'layout' property - BeanUtils.setProperty( component, "layout", layout ); + try { + // lets just try set the 'layout' property + BeanUtils.setProperty( component, "layout", layout ); + } + catch (IllegalAccessException e) { + throw new JellyTagException(e); + } + catch (InvocationTargetException e) { + throw new JellyTagException(e); + } } } /** * Adds a WindowListener to this component */ - public void addWindowListener(WindowListener listener) throws Exception { + public void addWindowListener(WindowListener listener) { Component component = getComponent(); if ( component instanceof Window ) { Window window = (Window) component; 1.4 +5 -6 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/DialogTag.java Index: DialogTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/DialogTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DialogTag.java 24 Jan 2003 22:53:33 -0000 1.3 +++ DialogTag.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -68,7 +68,6 @@ import java.util.Map; import javax.swing.JDialog; -import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.tags.core.UseBeanTag; 1.4 +3 -3 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/FontTag.java Index: FontTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/FontTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FontTag.java 30 Oct 2002 19:16:19 -0000 1.3 +++ FontTag.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -64,7 +64,7 @@ import java.awt.Font; import java.util.Map; -import org.apache.commons.jelly.JellyException; +import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.MapTagSupport; import org.apache.commons.jelly.XMLOutput; @@ -104,7 +104,7 @@ } */ - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { Map attributes = getAttributes(); String var = (String) attributes.remove("var"); @@ -120,7 +120,7 @@ tag.setFont(font); } else { - throw new JellyException( "this tag must be nested within a JellySwing widget tag or the 'var' attribute must be specified" ); + throw new JellyTagException( "this tag must be nested within a JellySwing widget tag or the 'var' attribute must be specified" ); } } } 1.6 +2 -2 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/LayoutTagSupport.java Index: LayoutTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/LayoutTagSupport.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- LayoutTagSupport.java 24 Jan 2003 22:53:33 -0000 1.5 +++ LayoutTagSupport.java 26 Jan 2003 07:50:23 -0000 1.6 @@ -97,7 +97,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { LayoutManager layout = createLayoutManager(); @@ -141,5 +141,5 @@ /** * Factory method to create a new LayoutManager instance. */ - protected abstract LayoutManager createLayoutManager() throws Exception; + protected abstract LayoutManager createLayoutManager(); } 1.4 +4 -3 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableLayoutTag.java Index: TableLayoutTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableLayoutTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TableLayoutTag.java 11 Dec 2002 12:40:57 -0000 1.3 +++ TableLayoutTag.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -64,6 +64,7 @@ import java.awt.GridBagLayout; import java.awt.LayoutManager; +import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.tags.swing.impl.Cell; import org.apache.commons.logging.Log; @@ -88,7 +89,7 @@ /** * Adds a new cell to the current grid */ - public void addCell(Cell cell) throws Exception { + public void addCell(Cell cell) throws JellyTagException { // find the parent container and add the component with the grid bag constraints addLayoutComponent(cell.getComponent(), cell.getConstraints()); } @@ -102,7 +103,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { rowCount = 0; super.doTag(output); } @@ -114,7 +115,7 @@ /** * Creates a GridBagLayout */ - protected LayoutManager createLayoutManager() throws Exception { + protected LayoutManager createLayoutManager() { return new GridBagLayout(); } } 1.7 +1 -2 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableModelColumnTag.java Index: TableModelColumnTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TableModelColumnTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TableModelColumnTag.java 24 Jan 2003 22:53:33 -0000 1.6 +++ TableModelColumnTag.java 26 Jan 2003 07:50:23 -0000 1.7 @@ -61,7 +61,6 @@ */ package org.apache.commons.jelly.tags.swing; -import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.tags.core.UseBeanTag; @@ -79,7 +78,7 @@ return (ExpressionTableColumn) getBean(); } - public Class getAttributeType(String name) throws JellyException { + public Class getAttributeType(String name) throws JellyTagException { if (name.equals("value")) { return Expression.class; } 1.7 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TdTag.java Index: TdTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TdTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TdTag.java 24 Jan 2003 22:53:33 -0000 1.6 +++ TdTag.java 26 Jan 2003 07:50:23 -0000 1.7 @@ -110,7 +110,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { invokeBody(output); } 1.4 +3 -2 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TitledBorderTag.java Index: TitledBorderTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TitledBorderTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TitledBorderTag.java 11 Dec 2002 12:40:57 -0000 1.3 +++ TitledBorderTag.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -68,6 +68,7 @@ import javax.swing.border.Border; import javax.swing.border.TitledBorder; +import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.MissingAttributeException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; @@ -96,7 +97,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws MissingAttributeException, JellyTagException { if ( title == null) { throw new MissingAttributeException("title"); } @@ -151,7 +152,7 @@ /** * Factory method to create a new Border instance. */ - protected Border createBorder() throws Exception { + protected Border createBorder() { if (border != null) { if (titleJustification != null && titlePosition != null) { int justification = asTitleJustification(titleJustification); 1.6 +1 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TrTag.java Index: TrTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/TrTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TrTag.java 24 Jan 2003 22:53:33 -0000 1.5 +++ TrTag.java 26 Jan 2003 07:50:23 -0000 1.6 @@ -104,7 +104,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { tableLayoutTag = (TableLayoutTag) findAncestorWithClass( TableLayoutTag.class ); if (tableLayoutTag == null) { throw new JellyTagException( "this tag must be nested within a <tableLayout> tag" ); 1.4 +2 -1 jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/WindowListenerTag.java Index: WindowListenerTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/WindowListenerTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- WindowListenerTag.java 11 Dec 2002 12:40:57 -0000 1.3 +++ WindowListenerTag.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -64,6 +64,7 @@ import java.awt.event.WindowEvent; import java.awt.event.WindowListener; +import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.TagSupport; import org.apache.commons.jelly.XMLOutput; @@ -97,7 +98,7 @@ // Tag interface //------------------------------------------------------------------------- - public void doTag(final XMLOutput output) throws Exception { + public void doTag(final XMLOutput output) throws JellyTagException { // now lets add this action to its parent if we have one ComponentTag tag = (ComponentTag) findAncestorWithClass( ComponentTag.class ); 1.10 +1 -1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/DynaBeanTagSupport.java Index: DynaBeanTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/DynaBeanTagSupport.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DynaBeanTagSupport.java 25 Jan 2003 18:59:23 -0000 1.9 +++ DynaBeanTagSupport.java 26 Jan 2003 07:50:23 -0000 1.10 @@ -103,7 +103,7 @@ * @return the type of the given attribute. By default just return * Object.class if this is not known. */ - public Class getAttributeType(String name) throws JellyException { + public Class getAttributeType(String name) throws JellyTagException { DynaProperty property = getDynaBean().getDynaClass().getDynaProperty(name); if (property != null) { return property.getType(); 1.4 +1 -1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/DynaTagSupport.java Index: DynaTagSupport.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/DynaTagSupport.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DynaTagSupport.java 24 Jan 2003 05:54:37 -0000 1.3 +++ DynaTagSupport.java 26 Jan 2003 07:50:23 -0000 1.4 @@ -77,7 +77,7 @@ * @return the type of the given attribute. By default just return * Object.class if this is not known. */ - public Class getAttributeType(String name) throws JellyException { + public Class getAttributeType(String name) throws JellyTagException { return Object.class; } } 1.8 +1 -2 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseListTag.java Index: UseListTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseListTag.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- UseListTag.java 24 Jan 2003 22:53:34 -0000 1.7 +++ UseListTag.java 26 Jan 2003 07:50:23 -0000 1.8 @@ -61,7 +61,6 @@ import java.util.List; import java.util.Map; -import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.JellyTagException; import org.apache.commons.jelly.expression.Expression; import org.apache.commons.jelly.impl.CollectionTag; @@ -96,7 +95,7 @@ // DynaTag interface //------------------------------------------------------------------------- - public Class getAttributeType(String name) throws JellyException { + public Class getAttributeType(String name) throws JellyTagException { if (name.equals("items")) { return Expression.class; }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>