ok here's my very first patch :D

I'd also like to add a keylistener so that when a user presses Enter, the
current row will enter into edit-mode. Where can I code for that?

btw, I got this exception when I was trying out the ZOOM effect,

run:
Exception thrown during paint(): java.lang.NullPointerException
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at sun.java2d.SunGraphics2D.getClipBounds(SunGraphics2D.java:1721)
        at org.apache.pivot.wtk.Container.paint(Unknown Source)
        at org.apache.pivot.wtk.Container.paint(Unknown Source)
        at org.apache.pivot.wtk.Container.paint(Unknown Source)
        at org.apache.pivot.wtk.Container.paint(Unknown Source)
        at org.apache.pivot.wtk.Container.paint(Unknown Source)
        at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintDisplay(Unknown
Source)
        at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.paintVolatileBuffered(Unknown
Source)
        at org.apache.pivot.wtk.ApplicationContext$DisplayHost.paint(Unknown
Source)
        at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.update(Unknown Source)
        at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
        at sun.awt.RepaintArea.paint(RepaintArea.java:216)
        at
sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:306)
        at java.awt.Component.dispatchEventImpl(Component.java:4706)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
BUILD SUCCESSFUL (total time: 15 seconds)


thanks!
-
thirdy
Index: wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
===================================================================
--- wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java        
(revision 815808)
+++ wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java        
(working copy)
@@ -145,6 +145,7 @@
             cardPane.add(new ImageView(new ComponentImage(tableView, 
tableView.getRowBounds(rowIndex))));
             cardPane.setSelectedIndex(0);
             cardPane.getStyles().put("selectionChangeEffect", editEffect);
+            cardPane.getStyles().put("selectionChangeDuration", 
editEffectDuration);
 
             tablePane = new TablePane();
             tablePane.getStyles().put("horizontalSpacing", 1);
@@ -567,6 +568,7 @@
     private HashMap<String, Component> cellEditors = new HashMap<String, 
Component>();
 
     private CardPaneSkin.SelectionChangeEffect editEffect = null;
+    private int editEffectDuration = 150;
 
     private static final int IMAGE_CARD_INDEX = 0;
     private static final int EDITOR_CARD_INDEX = 1;
@@ -605,6 +607,17 @@
     }
 
     /**
+     * Gets the effect duration that this editor uses when changing from a 
read-only
+     * row to an editable row. The default value is 150 milliseconds.
+     *
+     * @return
+     * The effect duration in milliseconds.
+     */
+    public int getEditEffectDuration(){
+        return editEffectDuration;
+    }
+
+    /**
      * Sets the effect that this editor uses when changing from a read-only
      * row to an editable row.
      *
@@ -633,6 +646,18 @@
     }
 
     /**
+     * Sets the effect duration that this editor uses when changing from a 
read-only
+     * row to an editable row.
+     *
+     * @param effectDuration
+     * Effect duration in milliseconds
+     *
+     */
+    public void setEditEffectDuration(int effectDuration){
+        this.editEffectDuration = effectDuration;
+    }
+
+    /**
      * {...@inheritdoc}
      */
     @Override

Reply via email to