directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r478154 - /directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/AttributesViewController.java
Date Wed, 22 Nov 2006 13:07:02 GMT
Author: pamarcelot
Date: Wed Nov 22 05:07:01 2006
New Revision: 478154

URL: http://svn.apache.org/viewvc?view=rev&rev=478154
Log:
Disabling the 'Edit Attribute' item  when multiple attributes are selected in the Attributes
View. Setting the name and tooltip of the 'Delete attribute' item to 'Delete attributes' when
multiple attributes are selected in the Attributes View.

Modified:
    directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/AttributesViewController.java

Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/AttributesViewController.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/AttributesViewController.java?view=diff&rev=478154&r1=478153&r2=478154
==============================================================================
--- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/AttributesViewController.java
(original)
+++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/AttributesViewController.java
Wed Nov 22 05:07:01 2006
@@ -32,6 +32,7 @@
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.ui.ISelectionListener;
@@ -163,7 +164,25 @@
                 }
                 else
                 {
-                    attributeEditAction.setEnabled( true );
+                    if ( ( ( StructuredSelection ) selection).size() == 1 )
+                    {
+                        attributeEditAction.setEnabled( true );
+                        if ( attributeDeleteAction.getText().equals( "Delete attributes"
) )
+                        {
+                            attributeDeleteAction.setText( "Delete attribute" );
+                            attributeDeleteAction.setToolTipText( "Delete attribute" );
+                        }
+                    }
+                    else
+                    {
+                        attributeEditAction.setEnabled( false );
+                        if ( attributeDeleteAction.getText().equals( "Delete attribute" )
)
+                        {
+                            attributeDeleteAction.setText( "Delete attributes" );
+                            attributeDeleteAction.setToolTipText( "Delete attributes" );
+                        }
+                    }
+                    
                     attributeDeleteAction.setEnabled( true );
                 }
             }



Mime
View raw message