directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r759446 - in /directory/sandbox/seelmann/trunk: ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/ ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/ ldapbrowser-co...
Date Sat, 28 Mar 2009 09:39:06 GMT
Author: seelmann
Date: Sat Mar 28 09:39:06 2009
New Revision: 759446

URL: http://svn.apache.org/viewvc?rev=759446&view=rev
Log:
Partial fix for DIRSTUDIO-167 (Show custom icons for various kinds of schema elements while
browsing schema data)

Added:
    directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/ObjectClassIconPair.java
Modified:
    directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/BrowserCommonPreferencesInitializer.java
    directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
    directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
    directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferences.java
    directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java

Modified: directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/BrowserCommonPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/BrowserCommonPreferencesInitializer.java?rev=759446&r1=759445&r2=759446&view=diff
==============================================================================
--- directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/BrowserCommonPreferencesInitializer.java
(original)
+++ directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/BrowserCommonPreferencesInitializer.java
Sat Mar 28 09:39:06 2009
@@ -24,8 +24,11 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeValueEditorRelation;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassIconPair;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SyntaxValueEditorRelation;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.apache.directory.studio.valueeditors.ValueEditorManager.ValueEditorExtension;
@@ -134,6 +137,53 @@
         store.setDefault( BrowserCommonConstants.PREFERENCE_BROWSER_CONTAINER_ENTRIES_FIRST,
false );
         store.setDefault( BrowserCommonConstants.PREFERENCE_BROWSER_META_ENTRIES_LAST, true
);
 
+        // default icons
+        ObjectClassIconPair[] objectClassIcons = new ObjectClassIconPair[]
+            {
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.PERSON_OC_OID, SchemaConstants.ORGANIZATIONAL_PERSON_OC_OID,
+                        SchemaConstants.INET_ORG_PERSON_OC_OID }, BrowserCommonConstants.IMG_ENTRY_PERSON
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.POSIX_ACCOUNT_OC_OID }, BrowserCommonConstants.IMG_ENTRY_PERSON
),
+
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.ORGANIZATION_OC_OID }, BrowserCommonConstants.IMG_ENTRY_ORG
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.ORGANIZATIONAL_UNIT_OC_OID }, BrowserCommonConstants.IMG_ENTRY_ORG
),
+
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.COUNTRY_OC_OID }, BrowserCommonConstants.IMG_ENTRY_DC
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.LOCALITY_OC_OID }, BrowserCommonConstants.IMG_ENTRY_DC
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.DC_OBJECT_OC_OID }, BrowserCommonConstants.IMG_ENTRY_DC
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.DOMAIN_OC_OID }, BrowserCommonConstants.IMG_ENTRY_DC
),
+
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.GROUP_OF_NAMES_OC_OID }, BrowserCommonConstants.IMG_ENTRY_GROUP
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC_OID }, BrowserCommonConstants.IMG_ENTRY_GROUP
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.POSIX_GROUP_OC_OID }, BrowserCommonConstants.IMG_ENTRY_GROUP
),
+
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.SUBENTRY_OC_OID }, BrowserCommonConstants.IMG_BROWSER_SCHEMABROWSEREDITOR
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.REFERRAL_OC_OID }, BrowserCommonConstants.IMG_ENTRY_REF
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.ALIAS_OC_OID }, BrowserCommonConstants.IMG_ENTRY_ALIAS
),
+
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.META_SCHEMA_OC_OID }, BrowserCommonConstants.IMG_BROWSER_SCHEMABROWSEREDITOR
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.META_OBJECT_CLASS_OC_OID }, BrowserCommonConstants.IMG_OCD
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.META_ATTRIBUTE_TYPE_OC_OID }, BrowserCommonConstants.IMG_ATD
),
+                new ObjectClassIconPair( new String[]
+                    { SchemaConstants.META_MATCHING_RULE_OC_OID }, BrowserCommonConstants.IMG_MRD
), };
+        BrowserCorePlugin.getDefault().getCorePreferences().setDefaultObjectClassIcons( objectClassIcons
);
+
         // Entry Editor
         store.setDefault( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_ENABLE_FOLDING, true
);
         store.setDefault( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_FOLDING_THRESHOLD,
10 );
@@ -149,8 +199,6 @@
         store.setDefault( BrowserCommonConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_ORDER,
             BrowserCoreConstants.SORT_ORDER_ASCENDING );
 
-        
-
         // Text Format
         store.setDefault( BrowserCommonConstants.PREFERENCE_FORMAT_TABLE_ATTRIBUTEDELIMITER,
"\t" ); //$NON-NLS-1$
         store.setDefault( BrowserCommonConstants.PREFERENCE_FORMAT_TABLE_VALUEDELIMITER,
"|" ); //$NON-NLS-1$

Modified: directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java?rev=759446&r1=759445&r2=759446&view=diff
==============================================================================
--- directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
(original)
+++ directory/sandbox/seelmann/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserLabelProvider.java
Sat Mar 28 09:39:06 2009
@@ -21,14 +21,18 @@
 package org.apache.directory.studio.ldapbrowser.common.widgets.browser;
 
 
+import java.util.Collection;
 import java.util.Iterator;
 
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescription;
 import org.apache.directory.studio.connection.core.Utils;
 import org.apache.directory.studio.connection.core.jobs.StudioRunnableWithProgress;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IQuickSearch;
@@ -39,6 +43,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.impl.BaseDNEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DirectoryMetadataEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassIconPair;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.eclipse.jface.viewers.IColorProvider;
 import org.eclipse.jface.viewers.IFontProvider;
 import org.eclipse.jface.viewers.LabelProvider;
@@ -274,7 +281,7 @@
         if ( obj instanceof IEntry )
         {
             IEntry entry = ( IEntry ) obj;
-            return getImageByRdn( entry );
+            return getImageByObjectClass( entry );
         }
         else if ( obj instanceof BrowserEntryPage )
         {
@@ -308,7 +315,7 @@
         {
             ISearchResult sr = ( ISearchResult ) obj;
             IEntry entry = sr.getEntry();
-            return getImageByRdn( entry );
+            return getImageByObjectClass( entry );
         }
         else if ( obj instanceof StudioRunnableWithProgress )
         {
@@ -434,87 +441,63 @@
     }
 
 
-    // private Image getImageByObjectclass(IEntry entry) {
-    // IAttribute oc = entry.getAttribute(IAttribute.OBJECTCLASS_ATTRIBUTE);
-    // if(oc != null && oc.getStringValues() != null) {
-    // String[] ocValues = oc.getStringValues();
-    // Set ocSet = new HashSet();
-    // for(int i=0; i<ocValues.length; i++) {
-    // ocSet.add(ocValues[i].toUpperCase());
-    // }
-    //			
-    // if(entry instanceof IRootDSE) {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY_ROOT);
-    // }
-    // else
-    // if(entry.getDn().equals(entry.getConnection().getSchema().getDn()))
-    // {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_BROWSER_SCHEMABROWSEREDITOR);
-    // }
-    // else if(ocSet.contains(ObjectClassDescription.OC_ALIAS.toUpperCase())
-    // || ocSet.contains(ObjectClassDescription.OC_REFERRAL.toUpperCase()))
-    // {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY_REF);
-    // }
-    // else
-    // if(ocSet.contains(ObjectClassDescription.OC_PERSON.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_ORGANIZATIONALPERSON.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_INETORGPERSON.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_RESIDENTIALPERSON.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_PILOTPERSON.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_NEWPILOTPERSON.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_ORGANIZATIONALROLE.toUpperCase())
-    // || ocSet.contains(ObjectClassDescription.OC_ACCOUNT.toUpperCase())) {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY_PERSON);
-    // }
-    // else
-    // if(ocSet.contains(ObjectClassDescription.OC_ORGANIZATION.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_ORGANIZATIONALUNIT.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_PILOTORGANIZATION.toUpperCase())
-    // || ocSet.contains(ObjectClassDescription.OC_DMD.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_APPLICATIONPROCESS.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_APPLICATIONENTITY.toUpperCase()))
-    // {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY_ORG);
-    // }
-    // else
-    // if(ocSet.contains(ObjectClassDescription.OC_COUNTRY.toUpperCase())
-    // || ocSet.contains(ObjectClassDescription.OC_LOCALITY.toUpperCase())
-    // || ocSet.contains(ObjectClassDescription.OC_DCOBJECT.toUpperCase())
-    // || ocSet.contains(ObjectClassDescription.OC_DOMAIN.toUpperCase())) {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY_DC);
-    // }
-    // else
-    // if(ocSet.contains(ObjectClassDescription.OC_GROUPOFNAMES.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_GROUPOFUNIQUENAMES.toUpperCase())
-    // ||
-    // ocSet.contains(ObjectClassDescription.OC_POSIXGROUP.toUpperCase())) {
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY_GROUP);
-    // }
-    //			
-    // }
-    //		
-    // return
-    // Activator.getDefault().getImage(BrowserWidgetsConstants.IMG_ENTRY);
-    // }
+    private Image getImageByObjectClass(IEntry entry) {
+        
+        if(entry instanceof IRootDSE) {
+            return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_ENTRY_ROOT
);
+        }
+        else if ( entry instanceof DirectoryMetadataEntry && ( ( DirectoryMetadataEntry
) entry ).isSchemaEntry() )
+        {
+            return BrowserCommonActivator.getDefault()
+                .getImage( BrowserCommonConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
+        }
+        else if ( entry.getDn().equals( entry.getBrowserConnection().getSchema().getDn()
) )
+        {
+            return BrowserCommonActivator.getDefault()
+                .getImage( BrowserCommonConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
+        }
+        
+        Schema schema = entry.getBrowserConnection().getSchema();
+        Collection<ObjectClassDescription> ocds = entry.getObjectClassDescriptions();
+        if ( ocds != null )
+        {
+            Collection<String> numericOids = SchemaUtils.getNumericOids( ocds );
+            ObjectClassIconPair[] objectClassIcons = BrowserCorePlugin.getDefault().getCorePreferences().getObjectClassIcons();
+            int maxWeight = 0;
+            ObjectClassIconPair maxObjectClassIconPair = null;
+            for ( ObjectClassIconPair objectClassIconPair : objectClassIcons )
+            {
+                int weight = 0;
+                String[] ocNumericOids = objectClassIconPair.getOcNumericOids();
+                for ( String ocNumericOid : ocNumericOids )
+                {
+                    if(numericOids.contains( ocNumericOid ))
+                    {
+                        ObjectClassDescription ocd = schema.getObjectClassDescription( ocNumericOid
);
+                        if(ocd.getKind() == ObjectClassTypeEnum.STRUCTURAL)
+                        {
+                            weight += 3;
+                        }
+                        else if(ocd.getKind() == ObjectClassTypeEnum.AUXILIARY)
+                        {
+                            weight += 2;
+                        }
+                    }
+                }
+                if(weight > maxWeight)
+                {
+                    maxObjectClassIconPair = objectClassIconPair;
+                }
+            }
+            
+            if(maxObjectClassIconPair != null)
+            {
+                return BrowserCommonActivator.getDefault().getImage( maxObjectClassIconPair.getIconPath()
);   
+            }
+        }
+
+        return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_ENTRY
);
+    }
 
     /**
      * {@inheritDoc}

Modified: directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java?rev=759446&r1=759445&r2=759446&view=diff
==============================================================================
--- directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
(original)
+++ directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
Sat Mar 28 09:39:06 2009
@@ -40,6 +40,8 @@
 
     public static final String PREFERENCE_BINARY_ATTRIBUTES = "binaryAttributes"; //$NON-NLS-1$
 
+    public static final String PREFERENCE_OBJECT_CLASS_ICONS = "objectClassIcons"; //$NON-NLS-1$
+
     public static final String BINARY = "BINARY"; //$NON-NLS-1$
 
     public static final String LINE_SEPARATOR = System.getProperty( "line.separator" ); //$NON-NLS-1$

Modified: directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferences.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferences.java?rev=759446&r1=759445&r2=759446&view=diff
==============================================================================
--- directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferences.java
(original)
+++ directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferences.java
Sat Mar 28 09:39:06 2009
@@ -26,6 +26,7 @@
 
 import org.apache.directory.studio.ldapbrowser.core.model.schema.BinaryAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.BinarySyntax;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassIconPair;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.core.runtime.Preferences;
 
@@ -193,6 +194,52 @@
 
 
     /**
+     * Gets the object class icons.
+     * 
+     * @return the object class icons
+     */
+    public ObjectClassIconPair[] getObjectClassIcons()
+    {
+        ObjectClassIconPair[] ocIcons = ( ObjectClassIconPair[] ) load( BrowserCoreConstants.PREFERENCE_OBJECT_CLASS_ICONS
);
+        return ocIcons;
+    }
+
+
+    /**
+     * Sets the object class icons.
+     * 
+     * @param ocIcons the new object class icons
+     */
+    public void setObjectClassIcons( ObjectClassIconPair[] ocIcons )
+    {
+        store( BrowserCoreConstants.PREFERENCE_OBJECT_CLASS_ICONS, ocIcons );
+    }
+
+
+    /**
+     * Gets the default object class icon.
+     * 
+     * @return the default object class icon
+     */
+    public ObjectClassIconPair[] getDefaultObjectClassIcon()
+    {
+        ObjectClassIconPair[] ocIcons = ( ObjectClassIconPair[] ) loadDefault( BrowserCoreConstants.PREFERENCE_OBJECT_CLASS_ICONS
);
+        return ocIcons;
+    }
+
+
+    /**
+     * Sets the default object class icons.
+     * 
+     * @param ocIcons the new default object class icons
+     */
+    public void setDefaultObjectClassIcons( ObjectClassIconPair[] ocIcons )
+    {
+        storeDefault( BrowserCoreConstants.PREFERENCE_OBJECT_CLASS_ICONS, ocIcons );
+    }
+
+
+    /**
      * Loads the current value of the string-valued property with the given name.
      *
      * @param key

Added: directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/ObjectClassIconPair.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/ObjectClassIconPair.java?rev=759446&view=auto
==============================================================================
--- directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/ObjectClassIconPair.java
(added)
+++ directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/ObjectClassIconPair.java
Sat Mar 28 09:39:06 2009
@@ -0,0 +1,105 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapbrowser.core.model.schema;
+
+
+/**
+ * A pair of object classes to the related icon.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ObjectClassIconPair
+{
+
+    /** The object classes numeric OIDs. */
+    private String[] objectClassNumericOIDs;
+
+    /** The path to the icon. */
+    private String iconPath;
+
+
+    /**
+     * Creates a new instance of ObjectClassIconPair.
+     */
+    public ObjectClassIconPair()
+    {
+    }
+
+
+    /**
+     * Creates a new instance of ObjectClassIconPair.
+     *
+     * @param objectClassNumericOIDs the object class numeric OIDs
+     * @param iconPath the icon path
+     */
+    public ObjectClassIconPair( String[] objectClassNumericOIDs, String iconPath )
+    {
+        super();
+        this.objectClassNumericOIDs = objectClassNumericOIDs;
+        this.iconPath = iconPath;
+    }
+
+
+    /**
+     * Gets the object class numeric OIDs.
+     * 
+     * @return the object class numeric OIDs
+     */
+    public String[] getOcNumericOids()
+    {
+        return objectClassNumericOIDs;
+    }
+
+
+    /**
+     * Sets the object class numeric OIDs.
+     * 
+     * @param objectClassNumericOIDs the object class numeric OIDs
+     */
+    public void setOcNumericOids( String[] objectClassNumericOIDs )
+    {
+        this.objectClassNumericOIDs = objectClassNumericOIDs;
+    }
+
+
+    /**
+     * Gets the icon path.
+     * 
+     * @return the icon path
+     */
+    public String getIconPath()
+    {
+        return iconPath;
+    }
+
+
+    /**
+     * Sets the icon path.
+     * 
+     * @param iconPath the new icon path
+     */
+    public void setIconPath( String iconPath )
+    {
+        this.iconPath = iconPath;
+    }
+
+}

Modified: directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java?rev=759446&r1=759445&r2=759446&view=diff
==============================================================================
--- directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java
(original)
+++ directory/sandbox/seelmann/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java
Sat Mar 28 09:39:06 2009
@@ -211,7 +211,7 @@
      * 
      * @return the numeric OIDs of the given schema descriptions
      */
-    public Collection<String> getNumericOids( Collection<? extends AbstractSchemaDescription>
descritpions )
+    public static Collection<String> getNumericOids( Collection<? extends AbstractSchemaDescription>
descritpions )
     {
         Set<String> oids = new HashSet<String>();
         for ( AbstractSchemaDescription asd : descritpions )



Mime
View raw message