directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r882177 - in /directory/studio/trunk: ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/ ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/
Date Thu, 19 Nov 2009 15:30:36 GMT
Author: pamarcelot
Date: Thu Nov 19 15:30:36 2009
New Revision: 882177

URL: http://svn.apache.org/viewvc?rev=882177&view=rev
Log:
Fix for DIRSTUDIO-595 (The icon of the entry in the 'Outline' view should be the same as the
one in the 'LDAP Browser' view).

Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java?rev=882177&r1=882176&r2=882177&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
Thu Nov 19 15:30:36 2009
@@ -297,7 +297,7 @@
             }
             else
             {
-                return getImageByObjectClass( entry );
+                return BrowserLabelProvider.getImageByObjectClass( entry );
             }
         }
         else if ( obj instanceof BrowserEntryPage )
@@ -336,7 +336,7 @@
         {
             ISearchResult sr = ( ISearchResult ) obj;
             IEntry entry = sr.getEntry();
-            return getImageByObjectClass( entry );
+            return BrowserLabelProvider.getImageByObjectClass( entry );
         }
         else if ( obj instanceof StudioRunnableWithProgress )
         {
@@ -399,7 +399,16 @@
     }
 
 
-    private Image getImageByObjectClass( IEntry entry )
+    /**
+     * Gets the image associated with the entry based 
+     * on the value of its 'objectClass' attribute.
+     *
+     * @param entry
+     *      the entry
+     * @return
+     *      the image associated with then entry
+     */
+    public static Image getImageByObjectClass( IEntry entry )
     {
         Schema schema = entry.getBrowserConnection().getSchema();
         Collection<ObjectClassDescription> ocds = entry.getObjectClassDescriptions();

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java?rev=882177&r1=882176&r2=882177&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
Thu Nov 19 15:30:36 2009
@@ -26,6 +26,8 @@
 import java.util.List;
 
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.common.widgets.browser.BrowserLabelProvider;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -333,8 +335,19 @@
             // Entry
             if ( element instanceof EntryWrapper )
             {
-                EntryWrapper entryWrapper = ( EntryWrapper ) element;
-                return entryWrapper.entry.getDn().getUpName();
+                IEntry entry = ( ( EntryWrapper ) element ).entry;
+
+                // Checking the Root DSE
+                if ( entry.getDn() != null && "".equals( entry.getDn().toString()
) ) //$NON-NLS-1$
+                {
+                    // Root DSE
+                    return "Root DSE"; //$NON-NLS-1$
+                }
+                else
+                {
+                    // Any other case
+                    return entry.getDn().getUpName();
+                }
             }
 
             // Attribute
@@ -366,7 +379,19 @@
             // Entry
             if ( element instanceof EntryWrapper )
             {
-                return LdifEditorActivator.getDefault().getImage( LdifEditorConstants.IMG_ENTRY
);
+                IEntry entry = ( ( EntryWrapper ) element ).entry;
+
+                // Checking the Root DSE
+                if ( entry.getDn() != null && "".equals( entry.getDn().toString()
) ) //$NON-NLS-1$
+                {
+                    // Root DSE
+                    return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_ENTRY_ROOT
);
+                }
+                else
+                {
+                    // Any other case
+                    return BrowserLabelProvider.getImageByObjectClass( entry );
+                }
             }
 
             // Attribute



Mime
View raw message