directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1687579 - /directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/AddEditDialog.java
Date Thu, 25 Jun 2015 16:46:27 GMT
Author: elecharny
Date: Thu Jun 25 16:46:26 2015
New Revision: 1687579

URL: http://svn.apache.org/r1687579
Log:
o Stored the selected position in the dialog
o Stored a flag to tell if the dialog has been called by an Add or an Edit action

Modified:
    directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/AddEditDialog.java

Modified: directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/AddEditDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/AddEditDialog.java?rev=1687579&r1=1687578&r2=1687579&view=diff
==============================================================================
--- directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/AddEditDialog.java
(original)
+++ directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/AddEditDialog.java
Thu Jun 25 16:46:26 2015
@@ -44,6 +44,12 @@ public abstract class AddEditDialog<E> e
     
     /** The table's elements */
     private List<E> elements;
+    
+    /** The position of the selected element, if we have any */
+    private int selectedPosition;
+
+    /** A flag set to true when the dialog is opened using the Add button */
+    private boolean isAdd = false;
 
     /** A flag used to tell if the okButton must be disabled */
     protected boolean okDisabled = false;
@@ -116,7 +122,23 @@ public abstract class AddEditDialog<E> e
     {
         this.editedElement = editedElement;
     }
-    
+
+    /**
+     * @return the selectedPosition
+     */
+    public int getSelectedPosition()
+    {
+        return selectedPosition;
+    }
+
+    /**
+     * @param selectedPosition the selectedPosition to set
+     */
+    public void setSelectedPosition( int selectedPosition )
+    {
+        this.selectedPosition = selectedPosition;
+    }
+
     
     /**
      * Stores the TableWidget list of elements
@@ -136,4 +158,31 @@ public abstract class AddEditDialog<E> e
     {
         return elements;
     }
+    
+    
+    /**
+     * Set the isAdd flag to true
+     */
+    public void setAdd()
+    {
+        isAdd = true;
+    }
+    
+    
+    /**
+     * Set the isAdd flag to false
+     */
+    public void setEdit()
+    {
+        isAdd = false;
+    }
+    
+    
+    /**
+     * @return True if the Dialog has been opened using the Add button.
+     */
+    public boolean isAdd()
+    {
+        return isAdd;
+    }
 }



Mime
View raw message