commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgi...@apache.org
Subject svn commit: r331124 - in /jakarta/commons/proper/jelly/trunk/jelly-tags/swing: src/java/org/apache/commons/jelly/tags/swing/CardLayoutTag.java src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java xdocs/changes.xml
Date Sun, 06 Nov 2005 18:02:02 GMT
Author: hgilde
Date: Sun Nov  6 10:01:25 2005
New Revision: 331124

URL: http://svn.apache.org/viewcvs?rev=331124&view=rev
Log:
Adds CardLayout per JELLY-222

Added:
    jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/CardLayoutTag.java
Modified:
    jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java
    jakarta/commons/proper/jelly/trunk/jelly-tags/swing/xdocs/changes.xml

Added: jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/CardLayoutTag.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/CardLayoutTag.java?rev=331124&view=auto
==============================================================================
--- jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/CardLayoutTag.java
(added)
+++ jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/CardLayoutTag.java
Sun Nov  6 10:01:25 2005
@@ -0,0 +1,67 @@
+/*
+ * Created on Nov 6, 2005
+ *
+ */
+package org.apache.commons.jelly.tags.swing;
+
+import java.awt.CardLayout;
+import java.awt.LayoutManager;
+
+/** Implements CardLayout. Takes parameters hgap, vgap per the class. You can
+ * set the "var" attribute of this tag, this will store the layout manager
+ * in that context attribute, for later use.
+ * 
+ * @author Hans Gilde
+ *
+ */
+public class CardLayoutTag extends LayoutTagSupport {
+    private int hgap;
+    private boolean hgapSet = false;
+    private int vgap;
+    private boolean vgapSet = false;
+
+    protected LayoutManager createLayoutManager() {
+        CardLayout cl = new CardLayout();
+
+        if (hgapSet) {
+            cl.setHgap(hgap);
+        }
+        
+        if (vgapSet) {
+            cl.setVgap(vgap);
+        }
+        
+        return cl;
+    }
+
+    /**
+     * @return Returns the hgap.
+     */
+    public int getHgap() {
+        return hgap;
+    }
+
+    /**
+     * @param hgap The hgap to set.
+     */
+    public void setHgap(int hgap) {
+        this.hgap = hgap;
+        hgapSet = true;
+    }
+
+    /**
+     * @return Returns the vgap.
+     */
+    public int getVgap() {
+        return vgap;
+    }
+
+    /**
+     * @param vgap The vgap to set.
+     */
+    public void setVgap(int vgap) {
+        this.vgap = vgap;
+        vgapSet = true;
+    }
+
+}

Modified: jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java?rev=331124&r1=331123&r2=331124&view=diff
==============================================================================
--- jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java
(original)
+++ jakarta/commons/proper/jelly/trunk/jelly-tags/swing/src/java/org/apache/commons/jelly/tags/swing/SwingTagLibrary.java
Sun Nov  6 10:01:25 2005
@@ -20,23 +20,50 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.swing.*;
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JComboBox;
+import javax.swing.JDesktopPane;
+import javax.swing.JEditorPane;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JPopupMenu;
+import javax.swing.JProgressBar;
+import javax.swing.JRadioButton;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+import javax.swing.JTree;
 
 import org.apache.commons.beanutils.ConvertUtils;
-
 import org.apache.commons.jelly.JellyException;
 import org.apache.commons.jelly.Tag;
 import org.apache.commons.jelly.TagLibrary;
-import org.apache.commons.jelly.impl.TagScript;
 import org.apache.commons.jelly.impl.TagFactory;
+import org.apache.commons.jelly.impl.TagScript;
+import org.apache.commons.jelly.tags.swing.converters.ColorConverter;
 import org.apache.commons.jelly.tags.swing.converters.DimensionConverter;
 import org.apache.commons.jelly.tags.swing.converters.PointConverter;
-import org.apache.commons.jelly.tags.swing.converters.ColorConverter;
-import org.apache.commons.jelly.tags.swing.converters.DebugGraphicsConverter;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.xml.sax.Attributes;
 
 /**
@@ -96,6 +123,9 @@
         // BorderLayout
         registerTag( "borderLayout", BorderLayoutTag.class );
         registerTag( "borderAlign", BorderAlignTag.class );
+        
+        //CardLayout
+        registerTag( "cardLayout", CardLayoutTag.class);
 
         // Dialog
         registerTag( "dialog", DialogTag.class );

Modified: jakarta/commons/proper/jelly/trunk/jelly-tags/swing/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jelly/trunk/jelly-tags/swing/xdocs/changes.xml?rev=331124&r1=331123&r2=331124&view=diff
==============================================================================
--- jakarta/commons/proper/jelly/trunk/jelly-tags/swing/xdocs/changes.xml (original)
+++ jakarta/commons/proper/jelly/trunk/jelly-tags/swing/xdocs/changes.xml Sun Nov  6 10:01:25
2005
@@ -26,6 +26,7 @@
   <body>
     <release version="1.1-SNAPSHOT" date="in CVS">
       <action dev="dion" type="fix" issue="JELLY-10" due-to="Hans Gilde">JellySwing
should be strict on the attribute names it uses.</action>
+      <action dev="hgilde" type="add" issue="JELLY-222">Add </action>
     </release>
     
     <release version="1.0" date="2004-09-12">



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message