You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/07/27 08:13:43 UTC

svn commit: r798032 - in /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content: ListViewItemEditor.java TableViewCellEditor.java TableViewRowEditor.java TreeViewNodeEditor.java

Author: tvolkert
Date: Mon Jul 27 06:13:43 2009
New Revision: 798032

URL: http://svn.apache.org/viewvc?rev=798032&view=rev
Log:
Added protected getEditor() methods to the stock editors - allowing subclasses to run preprocessing before calling super.save()

Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java?rev=798032&r1=798031&r2=798032&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java Mon Jul 27 06:13:43 2009
@@ -138,6 +138,22 @@
         }
     };
 
+    /**
+     * Gets the text input that serves as the editor component. This component
+     * will only be non-<tt>null</tt> while editing.
+     *
+     * @return
+     * This editor's component, or <tt>null</tt> if an edit is not in progress
+     *
+     * @see #isEditing()
+     */
+    protected final TextInput getEditor() {
+        return textInput;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void edit(ListView listView, int index) {
         if (this.listView != null) {
             throw new IllegalStateException("Currently editing.");
@@ -201,6 +217,9 @@
         return (listView != null);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @SuppressWarnings("unchecked")
     public void save() {
         if (!isEditing()) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java?rev=798032&r1=798031&r2=798032&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java Mon Jul 27 06:13:43 2009
@@ -163,6 +163,22 @@
     private TextInput textInput = null;
     private Window popup = null;
 
+    /**
+     * Gets the text input that serves as the editor component. This component
+     * will only be non-<tt>null</tt> while editing.
+     *
+     * @return
+     * This editor's component, or <tt>null</tt> if an edit is not in progress
+     *
+     * @see #isEditing()
+     */
+    protected final TextInput getEditor() {
+        return textInput;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     @SuppressWarnings("unchecked")
     public void edit(TableView tableView, int rowIndex, int columnIndex) {
         if (isEditing()) {
@@ -220,6 +236,9 @@
         return (tableView != null);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @SuppressWarnings("unchecked")
     public void save() {
         if (!isEditing()) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java?rev=798032&r1=798031&r2=798032&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java Mon Jul 27 06:13:43 2009
@@ -420,6 +420,19 @@
         return cellEditors;
     }
 
+    /**
+     * Gets the container that houses the individual cell editors.
+     *
+     * @return
+     * This editor's container editor
+     */
+    protected final Container getRowEditor() {
+        return editorTablePane;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     @SuppressWarnings("unchecked")
     public void edit(TableView tableView, int rowIndex, int columnIndex) {
         if (isEditing()) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java?rev=798032&r1=798031&r2=798032&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java Mon Jul 27 06:13:43 2009
@@ -176,6 +176,22 @@
     private Window popup = null;
     private TextInput textInput = null;
 
+    /**
+     * Gets the text input that serves as the editor component. This component
+     * will only be non-<tt>null</tt> while editing.
+     *
+     * @return
+     * This editor's component, or <tt>null</tt> if an edit is not in progress
+     *
+     * @see #isEditing()
+     */
+    protected final TextInput getEditor() {
+        return textInput;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void edit(TreeView treeView, Path path) {
         if (isEditing()) {
             throw new IllegalStateException();
@@ -239,6 +255,9 @@
         return (treeView != null);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @SuppressWarnings("unchecked")
     public void save() {
         if (!isEditing()) {