directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r500238 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin: ressources/icons/ src/main/java/org/apache/directory/ldapstudio/schemas/view/ src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/ src/main/java/org/apache/d...
Date Fri, 26 Jan 2007 13:34:01 GMT
Author: pamarcelot
Date: Fri Jan 26 05:34:00 2007
New Revision: 500238

URL: http://svn.apache.org/viewvc?view=rev&rev=500238
Log:
Modified display for attribute types and object classes folders.

Added:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_at.gif  
(with props)
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_oc.gif  
(with props)
Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/IImageKeys.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchicalContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/PoolManagerContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/IntermediateNode.java

Added: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_at.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_at.gif?view=auto&rev=500238
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_at.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_oc.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_oc.gif?view=auto&rev=500238
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/ressources/icons/folder_oc.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/IImageKeys.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/IImageKeys.java?view=diff&rev=500238&r1=500237&r2=500238
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/IImageKeys.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/IImageKeys.java
Fri Jan 26 05:34:00 2007
@@ -44,6 +44,8 @@
     public static final String LINK_WITH_EDITOR = "ressources/icons/link_with_editor.gif";
//$NON-NLS-1$
 
     // Images for Views
+    public static final String FOLDER_ATTRIBUTE_TYPE = "ressources/icons/folder_at.gif";
//$NON-NLS-1$
+    public static final String FOLDER_OBJECT_CLASS = "ressources/icons/folder_oc.gif"; //$NON-NLS-1$
     public static final String ATTRIBUTE_TYPE = "ressources/icons/attribute_type.gif"; //$NON-NLS-1$
     public static final String OBJECT_CLASS = "ressources/icons/object_class.gif"; //$NON-NLS-1$
     public static final String OBJECT_CLASS_WARNING = "ressources/icons/object_class_warning.gif";
//$NON-NLS-1$

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchicalContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchicalContentProvider.java?view=diff&rev=500238&r1=500237&r2=500238
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchicalContentProvider.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchicalContentProvider.java
Fri Jan 26 05:34:00 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.AttributeTypeWrapper;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.IntermediateNode;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.ObjectClassWrapper;
+import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.IntermediateNode.IntermediateNodeType;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.TreeViewer;
@@ -100,17 +101,16 @@
      */
     public Object[] getChildren( Object parentElement )
     {
-
         if ( parentElement instanceof ObjectClassWrapper )
         {
             //we are looking for the childrens of the contained objectClass
             ObjectClass objectClass =  ( ( ObjectClassWrapper ) parentElement ).getMyObjectClass();
 
-            IntermediateNode sub = new IntermediateNode( "Sub-types", ( ObjectClassWrapper
) parentElement, this ); //$NON-NLS-1$
+            IntermediateNode sub = new IntermediateNode( "Sub-types", ( ObjectClassWrapper
) parentElement, this, IntermediateNodeType.OBJECT_CLASS_FOLDER ); //$NON-NLS-1$
             IntermediateNode may = new IntermediateNode(
-                "Optionnal Attributes", ( ObjectClassWrapper ) parentElement, this ); //$NON-NLS-1$
+                "Optionnal Attributes", ( ObjectClassWrapper ) parentElement, this, IntermediateNodeType.ATTRIBUTE_TYPE_FOLDER
); //$NON-NLS-1$
             IntermediateNode must = new IntermediateNode(
-                "Mandatory Attributes", ( ObjectClassWrapper ) parentElement, this ); //$NON-NLS-1$
+                "Mandatory Attributes", ( ObjectClassWrapper ) parentElement, this, IntermediateNodeType.ATTRIBUTE_TYPE_FOLDER
); //$NON-NLS-1$
 
             //-> we need to compare each and every other objectClass's sup against them

             //-> we also need to find a better way to do this (complexity wise)

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/PoolManagerContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/PoolManagerContentProvider.java?view=diff&rev=500238&r1=500237&r2=500238
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/PoolManagerContentProvider.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/PoolManagerContentProvider.java
Fri Jan 26 05:34:00 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.PoolManagerAttributeTypeWrapper;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.PoolManagerObjectClassWrapper;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.SchemaWrapper;
+import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.IntermediateNode.IntermediateNodeType;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.TreeViewer;
@@ -117,9 +118,9 @@
             Schema schema = ( ( ( SchemaWrapper ) parentElement ).getMySchema() );
 
             IntermediateNode attributeTypes = new IntermediateNode(
-                "Attribute Types", ( SchemaWrapper ) parentElement, this ); //$NON-NLS-1$
+                "Attribute Types", ( SchemaWrapper ) parentElement, this, IntermediateNodeType.ATTRIBUTE_TYPE_FOLDER
); //$NON-NLS-1$
             IntermediateNode objectClasses = new IntermediateNode(
-                "Object Classes", ( SchemaWrapper ) parentElement, this ); //$NON-NLS-1$
+                "Object Classes", ( SchemaWrapper ) parentElement, this, IntermediateNodeType.OBJECT_CLASS_FOLDER
); //$NON-NLS-1$
 
             // Let's get all Attribute Types defined in the schema
             AttributeType[] attributeTypeList = schema.getAttributeTypesAsArray();

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/IntermediateNode.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/IntermediateNode.java?view=diff&rev=500238&r1=500237&r2=500238
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/IntermediateNode.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/wrappers/IntermediateNode.java
Fri Jan 26 05:34:00 2007
@@ -24,10 +24,13 @@
 import java.util.ArrayList;
 import java.util.Collections;
 
+import org.apache.directory.ldapstudio.schemas.controller.Application;
+import org.apache.directory.ldapstudio.schemas.view.IImageKeys;
 import org.apache.directory.ldapstudio.schemas.view.viewers.SortableContentProvider;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 
 /**
@@ -40,6 +43,12 @@
 public class IntermediateNode implements DisplayableTreeElement
 {
 
+    /** This enum represent the different types of IntermediateNodes */
+    public enum IntermediateNodeType
+    {
+        NONE, OBJECT_CLASS_FOLDER, ATTRIBUTE_TYPE_FOLDER
+    }
+
     /******************************************
      *               Fields                   *
      ******************************************/
@@ -47,6 +56,7 @@
     private String name;
     private DisplayableTreeElement parent;
     private ArrayList<DisplayableTreeElement> elements;
+    private IntermediateNodeType type;
 
 
     /******************************************
@@ -65,6 +75,28 @@
         this.parent = parent;
         this.contentProvider = contentProvider;
         elements = new ArrayList<DisplayableTreeElement>();
+        this.type = IntermediateNodeType.NONE;
+    }
+
+
+    /**
+     * Default constructor
+     * @param name
+     *      the name that will be displayed in the tree viewer
+     * @param parent
+     *      the parent DisplayableTreeElement in the schema relationship
+     * hierarchy
+     * @param type 
+     *      the type of IntermediateNode
+     */
+    public IntermediateNode( String name, DisplayableTreeElement parent, SortableContentProvider
contentProvider,
+        IntermediateNodeType type )
+    {
+        this.name = name;
+        this.parent = parent;
+        this.contentProvider = contentProvider;
+        elements = new ArrayList<DisplayableTreeElement>();
+        this.type = type;
     }
 
 
@@ -201,6 +233,19 @@
      */
     public Image getDisplayImage()
     {
+        switch ( type )
+        {
+            case NONE:
+                String imageKey = ISharedImages.IMG_OBJ_FOLDER;
+                return PlatformUI.getWorkbench().getSharedImages().getImage( imageKey );
+            case ATTRIBUTE_TYPE_FOLDER:
+                return AbstractUIPlugin.imageDescriptorFromPlugin( Application.PLUGIN_ID,
IImageKeys.FOLDER_ATTRIBUTE_TYPE )
+                .createImage();
+            case OBJECT_CLASS_FOLDER:
+                return AbstractUIPlugin.imageDescriptorFromPlugin( Application.PLUGIN_ID,
IImageKeys.FOLDER_OBJECT_CLASS )
+                .createImage();
+        }
+        
         String imageKey = ISharedImages.IMG_OBJ_FOLDER;
         return PlatformUI.getWorkbench().getSharedImages().getImage( imageKey );
     }
@@ -236,5 +281,29 @@
             }
         }
         return false;
+    }
+
+
+    /**
+     * Gets the type of IntermediateNode
+     *
+     * @return
+     *      the type of IntermediateNode
+     */
+    public IntermediateNodeType getType()
+    {
+        return type;
+    }
+
+
+    /**
+     * Sets the type of IntermediateNode
+     *
+     * @param type
+     *      the type to set
+     */
+    public void setType( IntermediateNodeType type )
+    {
+        this.type = type;
     }
 }



Mime
View raw message