directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r519991 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin: ./ src/main/java/org/apache/directory/ldapstudio/schemas/ src/main/java/org/apache/directory/ldapstudio/schemas/controller/ src/main/java/org/apache/directory/ldapstudio/sc...
Date Mon, 19 Mar 2007 16:17:51 GMT
Author: pamarcelot
Date: Mon Mar 19 09:17:49 2007
New Revision: 519991

URL: http://svn.apache.org/viewvc?view=rev&rev=519991
Log:
Added an action that opens the currently selected item in the Hierarchy View.
Added a Preference Page for the Hierarchy View.
Code Cleaning.
Refactoring.

Added:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenHierarchyViewPreferencesAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewPreferencesAction.java
      - copied, changed from r519885, directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpencSchemaElementsViewPreferencesAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenTypeHierarchyAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/HierarchyViewPreferencePage.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewContentProvider.java
      - copied, changed from r519885, directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewSortDialog.java
      - copied, changed from r519885, directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsSortDialog.java
Removed:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpencSchemaElementsViewPreferencesAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsSortDialog.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/PluginConstants.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/HierarchyViewController.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/PreferenceInitializer.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemaElementsController.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemasViewController.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenLocalFileAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewSortDialogAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemasViewPreferencesAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/perspectives/Perspective.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewLabelProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsView.java

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml Mon Mar 19 09:17:49 2007
@@ -117,6 +117,11 @@
       <category
             id="org.apache.directory.ldapstudio.schemas.category"
             name="%ldapstudio-schemas-plugin.commands.category.name"/>
+      <command
+            categoryId="org.apache.directory.ldapstudio.schemas.category"
+            description="Opens Type Hierarchy"
+            id="org.apache.directory.ldapstudio.schemas.cmd.OpenTypeHierarchy"
+            name="Open Type Hierarchy"/>
    </extension>
    <extension
          point="org.eclipse.ui.bindings">
@@ -125,6 +130,10 @@
             schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
             sequence="CTRL+O">
       </key>
+      <key
+            commandId="org.apache.directory.ldapstudio.schemas.cmd.OpenTypeHierarchy"
+            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+            sequence="F4"/>
    </extension>
    <extension
          point="org.eclipse.ui.editors">
@@ -192,6 +201,11 @@
             class="org.apache.directory.ldapstudio.schemas.view.preferences.SchemasViewPreferencePage"
             id="org.apache.directory.ldapstudio.schemas.preferences.schemasView"
             name="Schemas View"/>
+      <page
+            category="org.apache.directory.ldapstudio.schemas.preferences.general"
+            class="org.apache.directory.ldapstudio.schemas.view.preferences.HierarchyViewPreferencePage"
+            id="org.apache.directory.ldapstudio.schemas.preferences.hierarchyView"
+            name="Hierarchy View"/>
    </extension>
    <extension
          point="org.eclipse.core.runtime.preferences">

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/PluginConstants.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/PluginConstants.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/PluginConstants.java Mon Mar 19 09:17:49 2007
@@ -21,6 +21,7 @@
 package org.apache.directory.ldapstudio.schemas;
 
 
+import org.apache.directory.ldapstudio.schemas.view.preferences.HierarchyViewPreferencePage;
 import org.apache.directory.ldapstudio.schemas.view.preferences.SchemaElementsViewPreferencePage;
 import org.apache.directory.ldapstudio.schemas.view.preferences.SchemasViewPreferencePage;
 
@@ -161,11 +162,46 @@
     public static final String PREFS_HIERARCHY_VIEW_MODE = Activator.PLUGIN_ID
         + ".preferences.HierarchyView.mode";
     
-    /** The preference value for Schemas View Mode 'Supertype' */
+    /** The preference value for Hierarchy View Mode 'Supertype' */
     public static final int PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE = 0;
     
-    /** The preference value for Schemas View Mode 'Subtype' */
+    /** The preference value for Hierarchy View Mode 'Subtype' */
     public static final int PREFS_HIERARCHY_VIEW_MODE_SUBTYPE = 1;
+    
+    /** The preference ID for Hierarchy View Label */
+    public static final String PREFS_HIERARCHY_VIEW_LABEL = HierarchyViewPreferencePage.ID + ".label.labelValue"; //$NON-NLS-1$
+
+    /** The preference value for Hierarchy View First Name label */
+    public static final int PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME = 0;
+
+    /** The preference value for Hierarchy View All Aliases label */
+    public static final int PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES = 1;
+
+    /** The preference value for Hierarchy View OID label */
+    public static final int PREFS_HIERARCHY_VIEW_LABEL_OID = 2;
+
+    /** The preference ID for Hierarchy View Abbreviate */
+    public static final String PREFS_HIERARCHY_VIEW_ABBREVIATE = HierarchyViewPreferencePage.ID + ".label.abbreviate"; //$NON-NLS-1$
+
+    /** The preference ID for Hierarchy View Abbreviate Max Length*/
+    public static final String PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH = HierarchyViewPreferencePage.ID
+        + ".label.abbreviate.maxLength"; //$NON-NLS-1$
+
+    /** The preference ID for Hierarchy View Display Secondary Label */
+    public static final String PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY = HierarchyViewPreferencePage.ID
+        + ".secondaryLabel.display"; //$NON-NLS-1$
+
+    /** The preference ID for Hierarchy View Secondary Label */
+    public static final String PREFS_HIERARCHY_VIEW_SECONDARY_LABEL = HierarchyViewPreferencePage.ID
+        + ".secondaryLabel.labelValue"; //$NON-NLS-1$
+
+    /** The preference ID for Hierarchy View Abbreviate Secondary Label */
+    public static final String PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE = HierarchyViewPreferencePage.ID
+        + ".secondaryLabel.abbreviate"; //$NON-NLS-1$
+
+    /** The preference ID for Hierarchy View Abbreviate Secondary Label Max Length*/
+    public static final String PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH = HierarchyViewPreferencePage.ID
+        + ".secondaryLabel.abbreviate.maxLength"; //$NON-NLS-1$
 
     // Images - Actions
     public static final String IMG_ABOUT = "ressources/icons/flag_blue.png"; //$NON-NLS-1$
@@ -233,4 +269,6 @@
     public static final String CMD_SAVE_ALL = Activator.PLUGIN_ID + ".cmd.SaveAll"; //$NON-NLS-1$
     public static final String CMD_SHOW_SUBTYPE_HIERARCHY = Activator.PLUGIN_ID + ".cmd.ShowSubtypeHierarchy"; //$NON-NLS-1$
     public static final String CMD_SHOW_SUPERTYPE_HIERARCHY = Activator.PLUGIN_ID + ".cmd.ShowSupertypeHierarchy"; //$NON-NLS-1$
+    public static final String CMD_OPEN_TYPE_HIERARCHY = Activator.PLUGIN_ID + ".cmd.OpenTypeHierarchy"; //$NON-NLS-1$
+    public static final String CMD_HIERARCHY_VIEW_PREFERENCES = Activator.PLUGIN_ID + ".cmd.OpenHierarchyViewPreferences"; //$NON-NLS-1$
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/HierarchyViewController.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/HierarchyViewController.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/HierarchyViewController.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/HierarchyViewController.java Mon Mar 19 09:17:49 2007
@@ -21,11 +21,13 @@
 package org.apache.directory.ldapstudio.schemas.controller;
 
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.ldapstudio.schemas.Activator;
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.controller.actions.LinkWithEditorHierarchyView;
+import org.apache.directory.ldapstudio.schemas.controller.actions.OpenHierarchyViewPreferencesAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.ShowSubtypeHierarchyAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.ShowSupertypeHierarchyAction;
 import org.apache.directory.ldapstudio.schemas.view.editors.AttributeTypeFormEditor;
@@ -39,6 +41,8 @@
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -66,6 +70,7 @@
     private Action showSupertypeHierarchy;
     private Action showSubtypeHierarchy;
     private Action linkWithEditor;
+    private Action openPreferencePage;
 
 
     /**
@@ -92,13 +97,14 @@
      */
     private void initAuthorizedPrefs()
     {
-        //        authorizedPrefs = new ArrayList<String>();
-        //        authorizedPrefs.add( PluginConstants.PREFS_SCHEMAS_VIEW_LABEL );
-        //        authorizedPrefs.add( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE );
-        //        authorizedPrefs.add( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE_MAX_LENGTH );
-        //        authorizedPrefs.add( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING );
-        //        authorizedPrefs.add( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY );
-        //        authorizedPrefs.add( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER );
+        authorizedPrefs = new ArrayList<String>();
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL );
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE );
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH );
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY );
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL );
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE );
+        authorizedPrefs.add( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );
     }
 
 
@@ -116,6 +122,7 @@
         showSupertypeHierarchy = new ShowSupertypeHierarchyAction( view );
         showSubtypeHierarchy = new ShowSubtypeHierarchyAction( view );
         linkWithEditor = new LinkWithEditorHierarchyView( view );
+        openPreferencePage = new OpenHierarchyViewPreferencesAction();
     }
 
 
@@ -140,6 +147,8 @@
         menu.add( showSubtypeHierarchy );
         menu.add( new Separator() );
         menu.add( linkWithEditor );
+        menu.add( new Separator() );
+        menu.add( openPreferencePage );
     }
 
 
@@ -150,9 +159,6 @@
     {
         view.getViewer().addDoubleClickListener( new IDoubleClickListener()
         {
-            /**
-             * {@inheritDoc}
-             */
             public void doubleClick( DoubleClickEvent event )
             {
                 // What we get from the treeViewer is a StructuredSelection
@@ -200,25 +206,18 @@
      */
     private void initPreferencesListener()
     {
-        //        Activator.getDefault().getPreferenceStore().addPropertyChangeListener( new IPropertyChangeListener()
-        //        {
-        //            /* (non-Javadoc)
-        //             * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
-        //             */
-        //            public void propertyChange( PropertyChangeEvent event )
-        //            {
-        //                if ( authorizedPrefs.contains( event.getProperty() ) )
-        //                {
-        //                    if ( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING == event.getProperty() )
-        //                    {
-        //                        view.completeRefresh();
-        //                    }
-        //                    else
-        //                    {
-        //                        view.refresh();
-        //                    }
-        //                }
-        //            }
-        //        } );
+        Activator.getDefault().getPreferenceStore().addPropertyChangeListener( new IPropertyChangeListener()
+        {
+            /* (non-Javadoc)
+             * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+             */
+            public void propertyChange( PropertyChangeEvent event )
+            {
+                if ( authorizedPrefs.contains( event.getProperty() ) )
+                {
+                    view.refresh();
+                }
+            }
+        } );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/PreferenceInitializer.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/PreferenceInitializer.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/PreferenceInitializer.java Mon Mar 19 09:17:49 2007
@@ -85,5 +85,16 @@
             PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME );
         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER,
             PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING );
+        
+        // Hierarchy View Preference Page
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL,
+            PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE, true );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH, "50" );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY, true );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL,
+            PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE, false );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH, "50" );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemaElementsController.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemaElementsController.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemaElementsController.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemaElementsController.java Mon Mar 19 09:17:49 2007
@@ -30,7 +30,8 @@
 import org.apache.directory.ldapstudio.schemas.controller.actions.HideObjectClassesAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.LinkWithEditorSchemaElementsView;
 import org.apache.directory.ldapstudio.schemas.controller.actions.OpenSchemaElementsViewSortDialogAction;
-import org.apache.directory.ldapstudio.schemas.controller.actions.OpencSchemaElementsViewPreferencesAction;
+import org.apache.directory.ldapstudio.schemas.controller.actions.OpenTypeHierarchyAction;
+import org.apache.directory.ldapstudio.schemas.controller.actions.OpenSchemaElementsViewPreferencesAction;
 import org.apache.directory.ldapstudio.schemas.view.editors.AttributeTypeFormEditor;
 import org.apache.directory.ldapstudio.schemas.view.editors.AttributeTypeFormEditorInput;
 import org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassFormEditor;
@@ -40,16 +41,21 @@
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.IntermediateNode;
 import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.ObjectClassWrapper;
 import org.apache.log4j.Logger;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
@@ -65,19 +71,23 @@
 {
     /** The logger */
     private static Logger logger = Logger.getLogger( SchemaElementsController.class );
-    
+
     /** The authorized Preferences keys*/
     List<String> authorizedPrefs;
 
     /** The associated view */
     private SchemaElementsView view;
 
+    /** The Context Menu */
+    private MenuManager contextMenu;
+
     // The Actions
-    private HideObjectClassesAction hideObjectClasses;
-    private HideAttributeTypesAction hideAttributeTypes;
-    private LinkWithEditorSchemaElementsView linkWithEditor;
-    private OpenSchemaElementsViewSortDialogAction openSortDialog;
-    private OpencSchemaElementsViewPreferencesAction openPreferencePage;
+    private Action hideObjectClasses;
+    private Action hideAttributeTypes;
+    private Action linkWithEditor;
+    private Action openSortDialog;
+    private Action openPreferencePage;
+    private Action openTypeHierarchy;
 
 
     /**
@@ -86,11 +96,12 @@
     public SchemaElementsController( SchemaElementsView view )
     {
         this.view = view;
-        
+
         initAuthorizedPrefs();
         initActions();
         initToolbar();
         initMenu();
+        initContextMenu();
         initDoubleClickListener();
         initPreferencesListener();
     }
@@ -121,7 +132,8 @@
         hideAttributeTypes = new HideAttributeTypesAction( view.getViewer() );
         linkWithEditor = new LinkWithEditorSchemaElementsView( view );
         openSortDialog = new OpenSchemaElementsViewSortDialogAction();
-        openPreferencePage = new OpencSchemaElementsViewPreferencesAction();
+        openPreferencePage = new OpenSchemaElementsViewPreferencesAction();
+        openTypeHierarchy = new OpenTypeHierarchyAction();
     }
 
 
@@ -222,7 +234,7 @@
              * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
              */
             public void propertyChange( PropertyChangeEvent event )
-            { 
+            {
                 if ( authorizedPrefs.contains( event.getProperty() ) )
                 {
                     if ( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_GROUPING == event.getProperty() )
@@ -236,5 +248,40 @@
                 }
             }
         } );
+    }
+
+
+    /**
+     * Initializes the ContextMenu.
+     */
+    private void initContextMenu()
+    {
+        TreeViewer viewer = view.getViewer();
+        contextMenu = new MenuManager( "" ); //$NON-NLS-1$
+        contextMenu.setRemoveAllWhenShown( true );
+        contextMenu.addMenuListener( new IMenuListener()
+        {
+            public void menuAboutToShow( IMenuManager manager )
+            {
+                Object selection = ( ( TreeSelection ) view.getViewer().getSelection() ).getFirstElement();
+
+                if ( ( selection instanceof AttributeTypeWrapper ) )
+                {
+                    manager.add( openTypeHierarchy );
+                }
+                else if ( ( selection instanceof ObjectClassWrapper ) )
+                {
+                    manager.add( openTypeHierarchy );
+                }
+
+                manager.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
+            }
+        } );
+
+        // set the context menu to the table viewer
+        viewer.getControl().setMenu( contextMenu.createContextMenu( viewer.getControl() ) );
+        
+        // register the context menu to enable extension actions
+        view.getSite().registerContextMenu( contextMenu, viewer );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemasViewController.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemasViewController.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemasViewController.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/SchemasViewController.java Mon Mar 19 09:17:49 2007
@@ -36,6 +36,7 @@
 import org.apache.directory.ldapstudio.schemas.controller.actions.OpenSchemaSourceCode;
 import org.apache.directory.ldapstudio.schemas.controller.actions.OpenSchemasViewPreferencesAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.OpenSchemasViewSortDialogAction;
+import org.apache.directory.ldapstudio.schemas.controller.actions.OpenTypeHierarchyAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.RemoveSchemaAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.SaveAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.SaveAsAction;
@@ -77,6 +78,7 @@
 import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchActionConstants;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PartInitException;
@@ -120,6 +122,7 @@
     private Action saveAs;
     private Action openSortDialog;
     private Action openPreferencePage;
+    private Action openTypeHierarchy;
 
 
     /**
@@ -177,6 +180,7 @@
         saveAs = new SaveAsAction();
         openSortDialog = new OpenSchemasViewSortDialogAction();
         openPreferencePage = new OpenSchemasViewPreferencesAction();
+        openTypeHierarchy = new OpenTypeHierarchyAction();
     }
 
 
@@ -265,12 +269,14 @@
                 }
                 else if ( ( selection instanceof AttributeTypeWrapper ) )
                 {
+                    manager.add( openTypeHierarchy );
                     manager.add( deleteAction );
                     manager.add( new Separator() );
                     manager.add( createANewAttributeType );
                 }
                 else if ( ( selection instanceof ObjectClassWrapper ) )
                 {
+                    manager.add( openTypeHierarchy );
                     manager.add( deleteAction );
                     manager.add( new Separator() );
                     manager.add( createANewObjectClass );
@@ -283,11 +289,14 @@
                         manager.add( createANewSchema );
                     }
                 }
+
+                manager.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
             }
         } );
 
         // set the context menu to the table viewer
         viewer.getControl().setMenu( contextMenu.createContextMenu( viewer.getControl() ) );
+        
         // register the context menu to enable extension actions
         view.getSite().registerContextMenu( contextMenu, viewer );
     }

Added: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenHierarchyViewPreferencesAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenHierarchyViewPreferencesAction.java?view=auto&rev=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenHierarchyViewPreferencesAction.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenHierarchyViewPreferencesAction.java Mon Mar 19 09:17:49 2007
@@ -0,0 +1,61 @@
+/*
+ *  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.ldapstudio.schemas.controller.actions;
+
+
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
+import org.apache.directory.ldapstudio.schemas.view.preferences.HierarchyViewPreferencePage;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+
+/**
+ * This action opens the Preference Page for the Hierarchy View.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenHierarchyViewPreferencesAction extends Action
+{
+    /**
+     * Creates a new instance of OpenHierarchyViewPreferencesAction.
+     */
+    public OpenHierarchyViewPreferencesAction()
+    {
+        super( "Preferences..." );
+        setToolTipText( getText() );
+        setId( PluginConstants.CMD_HIERARCHY_VIEW_PREFERENCES );
+        setEnabled( true );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.action.Action#run()
+     */
+    public void run()
+    {
+        Shell shell = Display.getCurrent().getActiveShell();
+        PreferencesUtil.createPreferenceDialogOn( shell, HierarchyViewPreferencePage.ID, new String[]
+            { HierarchyViewPreferencePage.ID }, null ).open();
+    }
+}

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenLocalFileAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenLocalFileAction.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenLocalFileAction.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenLocalFileAction.java Mon Mar 19 09:17:49 2007
@@ -52,6 +52,7 @@
         super( Messages.getString( "OpenLocalFileAction.Open_a_schema_file" ) ); //$NON-NLS-1$
         setToolTipText( getText() );
         setId( PluginConstants.CMD_OPEN_LOCAL );
+        setActionDefinitionId( PluginConstants.CMD_OPEN_LOCAL );
         setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, PluginConstants.IMG_OPEN ) );
         setEnabled( true );
     }
@@ -86,6 +87,5 @@
                 logger.debug( "Error when opening a schema file" ); //$NON-NLS-1$
             }
         }
-
     }
 }

Copied: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewPreferencesAction.java (from r519885, directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpencSchemaElementsViewPreferencesAction.java)
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewPreferencesAction.java?view=diff&rev=519991&p1=directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpencSchemaElementsViewPreferencesAction.java&r1=519885&p2=directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewPreferencesAction.java&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpencSchemaElementsViewPreferencesAction.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewPreferencesAction.java Mon Mar 19 09:17:49 2007
@@ -30,17 +30,17 @@
 
 
 /**
- * This action opens the Sort Dialog of the Hierchy View.
+ * This action opens the Preference Page for the Schema Elements View.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class OpencSchemaElementsViewPreferencesAction extends Action
+public class OpenSchemaElementsViewPreferencesAction extends Action
 {
     /**
-     * Creates a new instance of OpencSchemaElementsViewPreferencesAction.
+     * Creates a new instance of OpenSchemaElementsViewPreferencesAction.
      */
-    public OpencSchemaElementsViewPreferencesAction()
+    public OpenSchemaElementsViewPreferencesAction()
     {
         super( "Preferences..." );
         setToolTipText( getText() );

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewSortDialogAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewSortDialogAction.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewSortDialogAction.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemaElementsViewSortDialogAction.java Mon Mar 19 09:17:49 2007
@@ -23,7 +23,7 @@
 
 import org.apache.directory.ldapstudio.schemas.Activator;
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
-import org.apache.directory.ldapstudio.schemas.view.viewers.SchemaElementsSortDialog;
+import org.apache.directory.ldapstudio.schemas.view.viewers.SchemaElementsViewSortDialog;
 import org.eclipse.jface.action.Action;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -59,7 +59,7 @@
      */
     public void run()
     {
-        SchemaElementsSortDialog hvsd = new SchemaElementsSortDialog( PlatformUI.getWorkbench().getDisplay()
+        SchemaElementsViewSortDialog hvsd = new SchemaElementsViewSortDialog( PlatformUI.getWorkbench().getDisplay()
             .getActiveShell() );
         hvsd.open();
     }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemasViewPreferencesAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemasViewPreferencesAction.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemasViewPreferencesAction.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenSchemasViewPreferencesAction.java Mon Mar 19 09:17:49 2007
@@ -30,7 +30,7 @@
 
 
 /**
- * This action opens the Sort Dialog of the Schemas View.
+ * This action opens the Preference Page for the Schemas View.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$

Added: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenTypeHierarchyAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenTypeHierarchyAction.java?view=auto&rev=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenTypeHierarchyAction.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/controller/actions/OpenTypeHierarchyAction.java Mon Mar 19 09:17:49 2007
@@ -0,0 +1,161 @@
+/*
+ *  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.ldapstudio.schemas.controller.actions;
+
+
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
+import org.apache.directory.ldapstudio.schemas.model.SchemaElement;
+import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
+import org.apache.directory.ldapstudio.schemas.view.editors.AttributeTypeFormEditor;
+import org.apache.directory.ldapstudio.schemas.view.editors.ObjectClassFormEditor;
+import org.apache.directory.ldapstudio.schemas.view.viewers.HierarchyView;
+import org.apache.directory.ldapstudio.schemas.view.viewers.SchemaElementsView;
+import org.apache.directory.ldapstudio.schemas.view.viewers.SchemasView;
+import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.AttributeTypeWrapper;
+import org.apache.directory.ldapstudio.schemas.view.viewers.wrappers.ObjectClassWrapper;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This action opens the Type Hierarchy View on the selected item.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenTypeHierarchyAction extends Action implements IWorkbenchWindowActionDelegate
+{
+    /**
+     * Creates a new instance of OpenSchemasViewPreferencesAction.
+     */
+    public OpenTypeHierarchyAction()
+    {
+        super( "Open Type Hierarchy" );
+        setToolTipText( getText() );
+        setId( PluginConstants.CMD_OPEN_TYPE_HIERARCHY );
+        setActionDefinitionId( PluginConstants.CMD_OPEN_TYPE_HIERARCHY );
+        setEnabled( true );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.action.Action#run()
+     */
+    public void run()
+    {
+        IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
+
+        if ( part instanceof SchemasView )
+        {
+            openTypeHierarchyFromTreeViewer( ( ( SchemasView ) part ).getViewer() );
+        }
+        else if ( part instanceof SchemaElementsView )
+        {
+            openTypeHierarchyFromTreeViewer( ( ( SchemaElementsView ) part ).getViewer() );
+        }
+        else if ( part instanceof HierarchyView )
+        {
+            openTypeHierarchyFromTreeViewer( ( ( HierarchyView ) part ).getViewer() );
+        }
+        else if ( part instanceof AttributeTypeFormEditor )
+        {
+            openTypeHierarchy( SchemaPool.getInstance().getAttributeType( part.getTitle() ) );
+        }
+        else if ( part instanceof ObjectClassFormEditor )
+        {
+            openTypeHierarchy( SchemaPool.getInstance().getObjectClass( part.getTitle() ) );
+        }
+    }
+
+
+    /**
+     * Gets the selection of the TreeViewer and opens the selection in the Hierarchy View.
+     *
+     * @param treeViewer
+     *      the Tree Viewer
+     */
+    private void openTypeHierarchyFromTreeViewer( TreeViewer treeViewer )
+    {
+        Object firstElement = ( ( StructuredSelection ) treeViewer.getSelection() ).getFirstElement();
+
+        if ( firstElement instanceof ObjectClassWrapper )
+        {
+            ObjectClassWrapper ocw = ( ObjectClassWrapper ) firstElement;
+            openTypeHierarchy( ocw.getMyObjectClass() );
+        }
+        else if ( firstElement instanceof AttributeTypeWrapper )
+        {
+            AttributeTypeWrapper atw = ( AttributeTypeWrapper ) firstElement;
+            openTypeHierarchy( atw.getMyAttributeType() );
+        }
+    }
+
+
+    /**
+     * Opens the Type Hierarchy with the given element.
+     *
+     * @param element
+     *      the element to open
+     */
+    private void openTypeHierarchy( SchemaElement element )
+    {
+        HierarchyView view = ( HierarchyView ) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+            .findView( HierarchyView.ID );
+
+        view.setInput( element );
+        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop( view );
+    }
+
+
+    public void dispose()
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    public void run( IAction action )
+    {
+        System.err.println( "run" );
+
+    }
+
+
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    public void init( IWorkbenchWindow window )
+    {
+        // TODO Auto-generated method stub
+
+    }
+}

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/perspectives/Perspective.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/perspectives/Perspective.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/perspectives/Perspective.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/perspectives/Perspective.java Mon Mar 19 09:17:49 2007
@@ -49,17 +49,19 @@
      */
     public void createInitialLayout( IPageLayout layout )
     {
+        String placeHolderId = "org.apache.directory.ldapstudio.schemas.placeholder";
+        
         layout.setEditorAreaVisible( true );
         String editorAreaId = layout.getEditorArea();
 
         // Creating top left folder 
-        IFolderLayout topLeftFolder = layout.createFolder( "placeholder", IPageLayout.LEFT, 0.3f, editorAreaId );
-        layout.addPlaceholder( "placeholder", IPageLayout.LEFT, 0.3f, editorAreaId );
+        IFolderLayout topLeftFolder = layout.createFolder( placeHolderId, IPageLayout.LEFT, 0.3f, editorAreaId );
+        layout.addPlaceholder( placeHolderId, IPageLayout.LEFT, 0.3f, editorAreaId );
         
         // Adding views
         topLeftFolder.addView( SchemaElementsView.ID );
         topLeftFolder.addView( HierarchyView.ID );
-        layout.addStandaloneView( SchemasView.ID, true, IPageLayout.BOTTOM, 0.5f, "placeholder" );
+        layout.addStandaloneView( SchemasView.ID, true, IPageLayout.BOTTOM, 0.5f, placeHolderId );
         layout.addStandaloneView( SearchView.ID, true, IPageLayout.BOTTOM, 0.7f, editorAreaId );
 
         // Setting up non-closeable views

Added: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/HierarchyViewPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/HierarchyViewPreferencePage.java?view=auto&rev=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/HierarchyViewPreferencePage.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/HierarchyViewPreferencePage.java Mon Mar 19 09:17:49 2007
@@ -0,0 +1,426 @@
+/*
+ *  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.ldapstudio.schemas.view.preferences;
+
+
+import org.apache.directory.ldapstudio.schemas.Activator;
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+/**
+ * This class implements the Preference page for the Hierarchy View
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class HierarchyViewPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
+{
+    /** The preference page ID */
+    public static final String ID = Activator.PLUGIN_ID + ".preferences.hierarchyView";
+
+    /** The First Name category */
+    private static final String FIRST_NAME = "First Name";
+
+    /** The All Aliases category */
+    private static final String ALL_ALIASES = "All Aliases";
+
+    /** The OID category */
+    private static final String OID = "OID";
+
+    // UI fields
+    private Combo labelCombo;
+    private Button limitButton;
+    private Text lengthText;
+    private Button secondaryLabelButtonDisplay;
+    private Combo secondaryLabelCombo;
+    private Button secondaryLabelLimitButton;
+    private Text secondaryLabelLengthText;
+
+
+    /**
+     * Creates a new instance of HierarchyViewPreferencePage.
+     */
+    public HierarchyViewPreferencePage()
+    {
+        super();
+        super.setPreferenceStore( Activator.getDefault().getPreferenceStore() );
+        super.setDescription( "General settings for the Hierarchy View of the Schemas Editor Plugin" );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+     */
+    protected Control createContents( Composite parent )
+    {
+        Composite composite = new Composite( parent, SWT.NONE );
+        GridLayout gl = new GridLayout( 1, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        composite.setLayout( gl );
+        GridData gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = 1;
+        composite.setLayoutData( gd );
+
+        // Label Group
+        Group labelGroup = new Group( composite, SWT.NONE );
+        labelGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        labelGroup.setText( "Label" );
+        labelGroup.setLayout( new GridLayout() );
+        Composite labelGroupComposite = new Composite( labelGroup, SWT.NONE );
+        gl = new GridLayout( 1, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        labelGroupComposite.setLayout( gl );
+        labelGroupComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+        // Label row composite
+        Composite labelComposite = new Composite( labelGroupComposite, SWT.NONE );
+        gl = new GridLayout( 3, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        labelComposite.setLayout( gl );
+        gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = 1;
+        labelComposite.setLayoutData( gd );
+
+        // Use Label
+        Label useLabel = new Label( labelComposite, SWT.NONE );
+        useLabel.setText( "Use" );
+
+        // Label Combo
+        labelCombo = new Combo( labelComposite, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER );
+        labelCombo.setLayoutData( new GridData() );
+        labelCombo.setItems( new String[]
+            { FIRST_NAME, ALL_ALIASES, OID } );
+        labelCombo.setEnabled( true );
+
+        // As label Label
+        Label asLabel = new Label( labelComposite, SWT.NONE );
+        asLabel.setText( "as label." );
+
+        // Abbreviate row composite
+        Composite abbreviateComposite = new Composite( labelGroupComposite, SWT.NONE );
+        gl = new GridLayout( 3, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        abbreviateComposite.setLayout( gl );
+        gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = 1;
+        abbreviateComposite.setLayoutData( gd );
+
+        // Limit label lenght to Label
+        limitButton = new Button( abbreviateComposite, SWT.CHECK );
+        limitButton.setText( "Limit label length to" );
+        gd = new GridData();
+        gd.horizontalSpan = 1;
+        limitButton.setLayoutData( gd );
+
+        // Lenght Text
+        lengthText = new Text( abbreviateComposite, SWT.NONE | SWT.BORDER );
+        GridData gridData = new GridData();
+        gridData.horizontalSpan = 1;
+        gridData.widthHint = 9 * 3;
+        lengthText.setLayoutData( gridData );
+        lengthText.setTextLimit( 3 );
+        lengthText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) )
+                {
+                    e.doit = false;
+                }
+                if ( "".equals( lengthText.getText() ) && e.text.matches( "[0]" ) )
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+
+        // Characters Label
+        Label charactersLabel = new Label( abbreviateComposite, SWT.NONE );
+        charactersLabel.setText( "characters." );
+
+        // Secondary Label Group
+        Group secondaryLabelGroup = new Group( composite, SWT.NONE );
+        secondaryLabelGroup.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        secondaryLabelGroup.setText( "Secondary label" );
+        secondaryLabelGroup.setLayout( new GridLayout() );
+        Composite secondaryLabelGroupComposite = new Composite( secondaryLabelGroup, SWT.NONE );
+        gl = new GridLayout( 1, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        secondaryLabelGroupComposite.setLayout( gl );
+        secondaryLabelGroupComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+        secondaryLabelButtonDisplay = new Button( secondaryLabelGroupComposite, SWT.CHECK );
+        secondaryLabelButtonDisplay.setText( "Display secondary label." );
+
+        // Label row composite
+        Composite secondaryLabelComposite = new Composite( secondaryLabelGroupComposite, SWT.NONE );
+        gl = new GridLayout( 3, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        secondaryLabelComposite.setLayout( gl );
+        gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = 1;
+        secondaryLabelComposite.setLayoutData( gd );
+
+        // Use Label
+        Label useLabel2 = new Label( secondaryLabelComposite, SWT.NONE );
+        useLabel2.setText( "Use" );
+
+        // Label Combo
+        secondaryLabelCombo = new Combo( secondaryLabelComposite, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER );
+        secondaryLabelCombo.setLayoutData( new GridData() );
+        secondaryLabelCombo.setItems( new String[]
+            { FIRST_NAME, ALL_ALIASES, OID } );
+        secondaryLabelCombo.setEnabled( true );
+
+        // As label Label
+        Label asLabel2 = new Label( secondaryLabelComposite, SWT.NONE );
+        asLabel2.setText( "as secondary label." );
+
+        // Abbreviate row composite
+        Composite abbreviateComposite2 = new Composite( secondaryLabelGroup, SWT.NONE );
+        gl = new GridLayout( 3, false );
+        gl.marginHeight = gl.marginWidth = 0;
+        abbreviateComposite2.setLayout( gl );
+        gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = 1;
+        abbreviateComposite2.setLayoutData( gd );
+
+        // Limit label lenght to Label
+        secondaryLabelLimitButton = new Button( abbreviateComposite2, SWT.CHECK );
+        secondaryLabelLimitButton.setText( "Limit secondary label length to" );
+        gd = new GridData();
+        gd.horizontalSpan = 1;
+        secondaryLabelLimitButton.setLayoutData( gd );
+
+        // Lenght Text
+        secondaryLabelLengthText = new Text( abbreviateComposite2, SWT.NONE | SWT.BORDER );
+        gridData = new GridData();
+        gridData.horizontalSpan = 1;
+        gridData.widthHint = 9 * 3;
+        secondaryLabelLengthText.setLayoutData( gridData );
+        secondaryLabelLengthText.setTextLimit( 3 );
+        secondaryLabelLengthText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) )
+                {
+                    e.doit = false;
+                }
+                if ( "".equals( secondaryLabelLengthText.getText() ) && e.text.matches( "[0]" ) )
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+
+        // Characters Label
+        Label secondaryLabelcharactersLabel = new Label( abbreviateComposite2, SWT.NONE );
+        secondaryLabelcharactersLabel.setText( "characters." );
+
+        initFieldsFromPreferences();
+
+        initListeners();
+
+        applyDialogFont( parent );
+
+        return parent;
+    }
+
+
+    /**
+     * Initializes the fields from the preferences store.
+     */
+    private void initFieldsFromPreferences()
+    {
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+        labelCombo.select( store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL ) );
+        limitButton.setSelection( store.getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE ) );
+        lengthText.setEnabled( limitButton.getSelection() );
+        lengthText.setText( store.getString( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH ) );
+
+        secondaryLabelButtonDisplay.setSelection( store.getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY ) );
+        secondaryLabelCombo.select( store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL ) );
+        secondaryLabelLimitButton.setSelection( store.getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE ) );
+        secondaryLabelLengthText
+            .setText( store.getString( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH ) );
+        if ( store.getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY ) )
+        {
+            secondaryLabelCombo.setEnabled( true );
+            secondaryLabelLimitButton.setEnabled( true );
+            secondaryLabelLengthText.setEnabled( secondaryLabelLimitButton.getSelection() );
+        }
+        else
+        {
+            secondaryLabelCombo.setEnabled( false );
+            secondaryLabelLimitButton.setEnabled( false );
+            secondaryLabelLengthText.setEnabled( false );
+        }
+    }
+
+
+    /**
+     * Initializes the listeners.
+     */
+    private void initListeners()
+    {
+        limitButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                lengthText.setEnabled( limitButton.getSelection() );
+            }
+        } );
+
+        secondaryLabelButtonDisplay.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                if ( secondaryLabelButtonDisplay.getSelection() )
+                {
+                    secondaryLabelCombo.setEnabled( true );
+                    secondaryLabelLimitButton.setEnabled( true );
+                    secondaryLabelLengthText.setEnabled( secondaryLabelLimitButton.getSelection() );
+                }
+                else
+                {
+                    secondaryLabelCombo.setEnabled( false );
+                    secondaryLabelLimitButton.setEnabled( false );
+                    secondaryLabelLengthText.setEnabled( false );
+                }
+            }
+        } );
+
+        secondaryLabelLimitButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                secondaryLabelLengthText.setEnabled( secondaryLabelLimitButton.getSelection() );
+            }
+        } );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+     */
+    protected void performDefaults()
+    {
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+        labelCombo.select( store.getDefaultInt( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL ) );
+        limitButton.setSelection( store.getDefaultBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE ) );
+        lengthText.setEnabled( limitButton.getSelection() );
+        lengthText.setText( store.getDefaultString( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH ) );
+
+        secondaryLabelButtonDisplay.setSelection( store
+            .getDefaultBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY ) );
+        secondaryLabelCombo.select( store.getDefaultInt( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL ) );
+        secondaryLabelLimitButton.setSelection( store
+            .getDefaultBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE ) );
+        secondaryLabelLengthText.setText( store
+            .getDefaultString( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH ) );
+
+        if ( secondaryLabelButtonDisplay.getSelection() )
+        {
+            secondaryLabelCombo.setEnabled( true );
+            secondaryLabelLimitButton.setEnabled( true );
+            secondaryLabelLengthText.setEnabled( secondaryLabelLimitButton.getSelection() );
+        }
+        else
+        {
+            secondaryLabelCombo.setEnabled( false );
+            secondaryLabelLimitButton.setEnabled( false );
+            secondaryLabelLengthText.setEnabled( false );
+        }
+
+        super.performDefaults();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.PreferencePage#performOk()
+     */
+    public boolean performOk()
+    {
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+        if ( labelCombo.getItem( labelCombo.getSelectionIndex() ).equals( FIRST_NAME ) )
+        {
+            store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL, PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME );
+        }
+        else if ( labelCombo.getItem( labelCombo.getSelectionIndex() ).equals( ALL_ALIASES ) )
+        {
+            store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL, PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES );
+        }
+        else if ( labelCombo.getItem( labelCombo.getSelectionIndex() ).equals( OID ) )
+        {
+            store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL, PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID );
+        }
+        store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE, limitButton.getSelection() );
+        store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH, lengthText.getText() );
+
+        store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY, secondaryLabelButtonDisplay.getSelection() );
+        if ( secondaryLabelCombo.getItem( secondaryLabelCombo.getSelectionIndex() ).equals( FIRST_NAME ) )
+        {
+            store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL, PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME );
+        }
+        else if ( secondaryLabelCombo.getItem( secondaryLabelCombo.getSelectionIndex() ).equals( ALL_ALIASES ) )
+        {
+            store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL, PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES );
+        }
+        else if ( secondaryLabelCombo.getItem( secondaryLabelCombo.getSelectionIndex() ).equals( OID ) )
+        {
+            store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL, PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID );
+        }
+        store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE, secondaryLabelLimitButton.getSelection() );
+        store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH, secondaryLabelLengthText.getText() );
+
+        return true;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+     */
+    public void init( IWorkbench workbench )
+    {
+    }
+}

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewLabelProvider.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewLabelProvider.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewLabelProvider.java Mon Mar 19 09:17:49 2007
@@ -62,21 +62,27 @@
     {
         String label = "";
 
-        int labelValue = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_LABEL );
-        boolean abbreviate = store.getBoolean( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE );
-        int abbreviateMaxLength = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE_MAX_LENGTH );
+        int labelValue = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_LABEL );
+        boolean abbreviate = store.getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE );
+        int abbreviateMaxLength = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_ABBREVIATE_MAX_LENGTH );
+        boolean secondaryLabelDisplay = store.getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_DISPLAY );
+        int secondaryLabelValue = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL );
+        boolean secondaryLabelAbbreviate = store
+            .getBoolean( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE );
+        int secondaryLabelAbbreviateMaxLength = store
+            .getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH );
 
         if ( obj instanceof AttributeTypeWrapper )
         {
-            if ( labelValue == PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_FIRST_NAME )
+            if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
             {
                 label = ( ( AttributeTypeWrapper ) obj ).getMyAttributeType().getNames()[0];
             }
-            else if ( labelValue == PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_ALL_ALIASES )
+            else if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
             {
                 label = concateNames( ( ( AttributeTypeWrapper ) obj ).getMyAttributeType().getNames() );
             }
-            else if ( labelValue == PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_OID )
+            else if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
             {
                 label = ( ( AttributeTypeWrapper ) obj ).getMyAttributeType().getOid();
             }
@@ -88,15 +94,15 @@
         }
         else if ( obj instanceof ObjectClassWrapper )
         {
-            if ( labelValue == PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_FIRST_NAME )
+            if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
             {
                 label = ( ( ObjectClassWrapper ) obj ).getMyObjectClass().getNames()[0];
             }
-            else if ( labelValue == PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_ALL_ALIASES )
+            else if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
             {
                 label = concateNames( ( ( ObjectClassWrapper ) obj ).getMyObjectClass().getNames() );
             }
-            else if ( labelValue == PluginConstants.PREFS_SCHEMAS_VIEW_LABEL_OID )
+            else if ( labelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
             {
                 label = ( ( ObjectClassWrapper ) obj ).getMyObjectClass().getOid();
             }
@@ -120,6 +126,48 @@
             && ( ( obj instanceof ObjectClassWrapper ) || ( obj instanceof AttributeTypeWrapper ) ) )
         {
             label = label.substring( 0, abbreviateMaxLength ) + "...";
+        }
+
+        if ( secondaryLabelDisplay )
+        {
+            String secondaryLabel = "";
+            if ( obj instanceof AttributeTypeWrapper )
+            {
+                if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
+                {
+                    secondaryLabel = ( ( AttributeTypeWrapper ) obj ).getMyAttributeType().getNames()[0];
+                }
+                else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
+                {
+                    secondaryLabel = concateNames( ( ( AttributeTypeWrapper ) obj ).getMyAttributeType().getNames() );
+                }
+                else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
+                {
+                    secondaryLabel = ( ( AttributeTypeWrapper ) obj ).getMyAttributeType().getOid();
+                }
+            }
+            else if ( obj instanceof ObjectClassWrapper )
+            {
+                if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_FIRST_NAME )
+                {
+                    secondaryLabel = ( ( ObjectClassWrapper ) obj ).getMyObjectClass().getNames()[0];
+                }
+                else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_ALL_ALIASES )
+                {
+                    secondaryLabel = concateNames( ( ( ObjectClassWrapper ) obj ).getMyObjectClass().getNames() );
+                }
+                else if ( secondaryLabelValue == PluginConstants.PREFS_HIERARCHY_VIEW_LABEL_OID )
+                {
+                    secondaryLabel = ( ( ObjectClassWrapper ) obj ).getMyObjectClass().getOid();
+                }
+            }
+
+            if ( secondaryLabelAbbreviate && ( secondaryLabelAbbreviateMaxLength < secondaryLabel.length() ) )
+            {
+                secondaryLabel = secondaryLabel.substring( 0, secondaryLabelAbbreviateMaxLength ) + "...";
+            }
+
+            label += "   [" + secondaryLabel + "]";
         }
 
         return label;

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsView.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsView.java?view=diff&rev=519991&r1=519990&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsView.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsView.java Mon Mar 19 09:17:49 2007
@@ -47,7 +47,7 @@
     private TreeViewer viewer;
 
     /** The content provider */
-    private SchemaElementsContentProvider contentProvider;
+    private SchemaElementsViewContentProvider contentProvider;
 
 
     /* (non-Javadoc)
@@ -74,7 +74,7 @@
     private void initViewer( Composite parent )
     {
         viewer = new TreeViewer( parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
-        contentProvider = new SchemaElementsContentProvider();
+        contentProvider = new SchemaElementsViewContentProvider();
         viewer.setContentProvider( contentProvider );
         viewer.setLabelProvider( new DecoratingLabelProvider( new SchemaElementsViewLabelProvider(), Activator
             .getDefault().getWorkbench().getDecoratorManager().getLabelDecorator() ) );

Copied: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewContentProvider.java (from r519885, directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsContentProvider.java)
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewContentProvider.java?view=diff&rev=519991&p1=directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsContentProvider.java&r1=519885&p2=directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewContentProvider.java&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsContentProvider.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewContentProvider.java Mon Mar 19 09:17:49 2007
@@ -52,7 +52,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SchemaElementsContentProvider implements IStructuredContentProvider, ITreeContentProvider, PoolListener
+public class SchemaElementsViewContentProvider implements IStructuredContentProvider, ITreeContentProvider, PoolListener
 {
     /** The Schema Pool holding all schemas */
     private SchemaPool schemaPool;
@@ -73,7 +73,7 @@
      * @param schemaPool
      *      the associated Schema Pool
      */
-    public SchemaElementsContentProvider()
+    public SchemaElementsViewContentProvider()
     {
         schemaPool = SchemaPool.getInstance();
         schemaPool.addListener( this );

Copied: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewSortDialog.java (from r519885, directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsSortDialog.java)
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewSortDialog.java?view=diff&rev=519991&p1=directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsSortDialog.java&r1=519885&p2=directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewSortDialog.java&r2=519991
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsSortDialog.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemaElementsViewSortDialog.java Mon Mar 19 09:17:49 2007
@@ -44,7 +44,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SchemaElementsSortDialog extends Dialog
+public class SchemaElementsViewSortDialog extends Dialog
 {
     /** The title of the dialog */
     private static final String DIALOG_TITLE = "Schema Elements View Sorting";
@@ -70,7 +70,7 @@
      * @param parentShell
      *      the parent shell
      */
-    public SchemaElementsSortDialog( Shell parentShell )
+    public SchemaElementsViewSortDialog( Shell parentShell )
     {
         super( parentShell );
     }



Mime
View raw message