directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r568022 - in /directory/studio/trunk/studio-apacheds-schemaeditor: ./ src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/ src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/
Date Tue, 21 Aug 2007 08:42:57 GMT
Author: pamarcelot
Date: Tue Aug 21 01:42:56 2007
New Revision: 568022

URL: http://svn.apache.org/viewvc?rev=568022&view=rev
Log:
Improved LabelDecorator to handle also AttributeTypeImpl and ObjectClassImpl objects.
Improved the SearchView to add the LabelDecorator in the TableViewer.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorTypeLabelDecorator.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml?rev=568022&r1=568021&r2=568022&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml (original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/plugin.xml Tue Aug 21 01:42:56 2007
@@ -234,6 +234,12 @@
                 <objectClass
                       name="org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ObjectClassWrapper">
                 </objectClass>
+                <objectClass
+                      name="org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl">
+                </objectClass>
+                <objectClass
+                      name="org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl">
+                </objectClass>
              </or>
           </enablement>
           <description>

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorTypeLabelDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorTypeLabelDecorator.java?rev=568022&r1=568021&r2=568022&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorTypeLabelDecorator.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/SchemaEditorTypeLabelDecorator.java
Tue Aug 21 01:42:56 2007
@@ -24,6 +24,8 @@
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl;
+import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.AttributeTypeWrapper;
 import org.apache.directory.studio.apacheds.schemaeditor.view.wrappers.ObjectClassWrapper;
 import org.eclipse.jface.viewers.IDecoration;
@@ -48,10 +50,7 @@
     {
         if ( element instanceof AttributeTypeWrapper )
         {
-            AttributeTypeWrapper atw = ( AttributeTypeWrapper ) element;
-
-            UsageEnum usage = atw.getAttributeType().getUsage();
-
+            UsageEnum usage = ( ( AttributeTypeWrapper ) element ).getAttributeType().getUsage();
             if ( usage == UsageEnum.USER_APPLICATIONS )
             {
                 decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
@@ -66,10 +65,41 @@
         }
         else if ( element instanceof ObjectClassWrapper )
         {
-            ObjectClassWrapper ocw = ( ObjectClassWrapper ) element;
-
-            ObjectClassTypeEnum classType = ocw.getObjectClass().getType();
-
+            ObjectClassTypeEnum classType = ( ( ObjectClassWrapper ) element ).getObjectClass().getType();
+            if ( classType == ObjectClassTypeEnum.ABSTRACT )
+            {
+                decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_ABSTRACT ), IDecoration.BOTTOM_RIGHT
);
+            }
+            else if ( classType == ObjectClassTypeEnum.STRUCTURAL )
+            {
+                decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_STRUCTURAL ), IDecoration.BOTTOM_RIGHT
);
+            }
+            else if ( classType == ObjectClassTypeEnum.AUXILIARY )
+            {
+                decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+                    PluginConstants.IMG_OBJECT_CLASS_OVERLAY_AUXILIARY ), IDecoration.BOTTOM_RIGHT
);
+            }
+        }
+        else if ( element instanceof AttributeTypeImpl )
+        {
+            UsageEnum usage = ( ( AttributeTypeImpl ) element ).getUsage();
+            if ( usage == UsageEnum.USER_APPLICATIONS )
+            {
+                decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+                    PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_USER_APPLICATION ), IDecoration.BOTTOM_RIGHT
);
+            }
+            else if ( ( usage == UsageEnum.DIRECTORY_OPERATION ) || ( usage == UsageEnum.DISTRIBUTED_OPERATION
)
+                || ( usage == UsageEnum.DSA_OPERATION ) )
+            {
+                decoration.addOverlay( Activator.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
+                    PluginConstants.IMG_ATTRIBUTE_TYPE_OVERLAY_OPERATION ), IDecoration.BOTTOM_RIGHT
);
+            }
+        }
+        else if ( element instanceof ObjectClassImpl )
+        {
+            ObjectClassTypeEnum classType = ( ( ObjectClassImpl ) element ).getType();
             if ( classType == ObjectClassTypeEnum.ABSTRACT )
             {
                 decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java?rev=568022&r1=568021&r2=568022&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
Tue Aug 21 01:42:56 2007
@@ -36,6 +36,7 @@
 import org.apache.directory.studio.apacheds.schemaeditor.view.search.SearchPage;
 import org.apache.directory.studio.apacheds.schemaeditor.view.search.SearchPage.SearchScopeEnum;
 import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.DecoratingLabelProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyAdapter;
@@ -402,7 +403,8 @@
 
         // Creating the TableViewer
         resultsTableViewer = new TableViewer( resultsTable );
-        resultsTableViewer.setLabelProvider( new SearchViewLabelProvider() );
+        resultsTableViewer.setLabelProvider( new DecoratingLabelProvider( new SearchViewLabelProvider(),
Activator
+            .getDefault().getWorkbench().getDecoratorManager().getLabelDecorator() ) );
         resultsTableViewer.setContentProvider( new SearchViewContentProvider() );
     }
 



Mime
View raw message