directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r821691 - /directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java
Date Mon, 05 Oct 2009 06:13:30 GMT
Author: seelmann
Date: Mon Oct  5 06:13:30 2009
New Revision: 821691

URL: http://svn.apache.org/viewvc?rev=821691&view=rev
Log:
Special label for RootDSE

Modified:
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java?rev=821691&r1=821690&r2=821691&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java
Mon Oct  5 06:13:30 2009
@@ -25,6 +25,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.RootDSE;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.resource.ImageDescriptor;
@@ -131,7 +132,20 @@
      */
     public String getName()
     {
-        return getResolvedEntry() != null ? getResolvedEntry().getDn().getUpName() : "";
//$NON-NLS-1$
+        IEntry entry = getResolvedEntry();
+        if ( entry != null )
+        {
+            if ( entry instanceof RootDSE )
+            {
+                return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ); //$NON-NLS-1$
+            }
+            else
+            {
+                return entry.getDn().getUpName();
+            }
+        }
+
+        return ""; //$NON-NLS-1$
     }
 
 
@@ -140,22 +154,21 @@
      */
     public String getToolTipText()
     {
-        if ( getResolvedEntry() != null )
+        IEntry entry = getResolvedEntry();
+        if ( entry != null )
         {
-            IEntry entry = getResolvedEntry();
             IBrowserConnection connection = entry.getBrowserConnection();
             if ( connection != null )
             {
-                return entry.getDn().getUpName() + " - " + connection.getConnection().getName();//$NON-NLS-1$
+                return getName() + " - " + connection.getConnection().getName();//$NON-NLS-1$
             }
             else
             {
-                return entry.getDn().getUpName();
+                return getName();
             }
         }
 
         return ""; //$NON-NLS-1$
-
     }
 
 



Mime
View raw message