directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r512306 - in /directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas: ./ controller/ view/viewers/
Date Tue, 27 Feb 2007 16:26:19 GMT
Author: pamarcelot
Date: Tue Feb 27 08:26:18 2007
New Revision: 512306

URL: http://svn.apache.org/viewvc?view=rev&rev=512306
Log:
Refactored constants into the PluginConstants interface.

Modified:
    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/PreferenceInitializer.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewSortDialog.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewSortDialog.java

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=512306&r1=512305&r2=512306
==============================================================================
--- 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
Tue Feb 27 08:26:18 2007
@@ -35,7 +35,7 @@
 {
     // Preferences - Hierarchy View
     /** The preference ID for Hierarchy View Label */
-    public static final String PREFS_HIERARCHY_VIEW_LABEL = HierarchyViewPreferencePage.ID
+ ".label.labelValue";
+    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;
@@ -47,27 +47,60 @@
     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";
+    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";
+        + ".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";
+        + ".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";
+        + ".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";
+        + ".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";
+        + ".secondaryLabel.abbreviate.maxLength"; //$NON-NLS-1$
+
+    /** The preference ID for Hierarchy View Grouping */
+    public static final String PREFS_HIERARCHY_VIEW_GROUPING = Activator.PLUGIN_ID
+        + ".preferences.HierarchyView.grouping";
+
+    /** The preference value for Hierarchy View Grouping 'attribute types first' */
+    public static final int PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST = 0;
+
+    /** The preference value for Hierarchy View Grouping 'object classes first' */
+    public static final int PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST = 1;
+
+    /** The preference value for Hierarchy View Grouping 'mixed' */
+    public static final int PREFS_HIERARCHY_VIEW_GROUPING_MIXED = 2;
+
+    /** The preference ID for Hierarchy View Sorting By */
+    public static final String PREFS_HIERARCHY_VIEW_SORTING_BY = Activator.PLUGIN_ID
+        + ".preferences.HierarchyView.sortingBy";
+
+    /** The preference value for Hierarchy View Sorting 'First Name' */
+    public static final int PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME = 0;
+
+    /** The prefence value for Hierarchy View Sorting 'OID' */
+    public static final int PREFS_HIERARCHY_VIEW_SORTING_BY_OID = 1;
+
+    /** The preference ID for Hierarchy View Sorting Order */
+    public static final String PREFS_HIERARCHY_VIEW_SORTING_ORDER = Activator.PLUGIN_ID
+        + ".preferences.HierarchyView.sortingOrder";
+
+    /** The preference value for Hierarchy View Sorting 'ascending' */
+    public static final int PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING = 0;
+
+    /** The prefence value for Hierarchy View Sorting 'descending' */
+    public static final int PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING = 1;
 
     // Preferences - Schemas View
     /** The preference ID for Schemas View Label */
@@ -83,11 +116,40 @@
     public static final int PREFS_SCHEMAS_VIEW_LABEL_OID = 2;
 
     /** The preference ID for Schemas View Abbreviate */
-    public static final String PREFS_SCHEMAS_VIEW_ABBREVIATE = SchemasViewPreferencePage.ID
+ ".label.abbreviate";
+    public static final String PREFS_SCHEMAS_VIEW_ABBREVIATE = SchemasViewPreferencePage.ID
+ ".label.abbreviate"; //$NON-NLS-1$
 
     /** The preference ID for Schemas View Abbreviate Max Length*/
     public static final String PREFS_SCHEMAS_VIEW_ABBREVIATE_MAX_LENGTH = SchemasViewPreferencePage.ID
-        + ".label.abbreviate.maxLength";
+        + ".label.abbreviate.maxLength"; //$NON-NLS-1$
+
+    /** The preference ID for Schemas View Grouping */
+    public static final String PREFS_SCHEMAS_VIEW_GROUPING = Activator.PLUGIN_ID + ".preferences.SchemasView.grouping";
//$NON-NLS-1$
+
+    /** The preference value for Schemas View Grouping 'group ATs and OCs in folders' */
+    public static final int PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS = 0;
+
+    /** The preference value for Schemas View Grouping 'mixed' */
+    public static final int PREFS_SCHEMAS_VIEW_GROUPING_MIXED = 1;
+
+    /** The preference ID for Schemas View Sorting By */
+    public static final String PREFS_SCHEMAS_VIEW_SORTING_BY = Activator.PLUGIN_ID
+        + ".preferences.SchemasView.sortingBy"; //$NON-NLS-1$
+
+    /** The preference value for Schemas View Sorting 'First Name' */
+    public static final int PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME = 0;
+
+    /** The prefence value for Schemas View Sorting 'OID' */
+    public static final int PREFS_SCHEMAS_VIEW_SORTING_BY_OID = 1;
+
+    /** The preference ID for Sorting Order */
+    public static final String PREFS_SCHEMAS_VIEW_SORTING_ORDER = Activator.PLUGIN_ID
+        + ".preferences.SchemasView.sortingOrder"; //$NON-NLS-1$
+
+    /** The preference value for Schemas View Sorting 'ascending' */
+    public static final int PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING = 0;
+
+    /** The prefence value for Schemas View Sorting 'descending' */
+    public static final int PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING = 1;
 
     // Images - Actions
     public static final String IMG_ABOUT = "ressources/icons/flag_blue.png"; //$NON-NLS-1$

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=512306&r1=512305&r2=512306
==============================================================================
--- 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
Tue Feb 27 08:26:18 2007
@@ -25,8 +25,6 @@
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.view.preferences.GeneralPreferencePage;
 import org.apache.directory.ldapstudio.schemas.view.preferences.SchemaPreferencePage;
-import org.apache.directory.ldapstudio.schemas.view.viewers.HierarchyViewSortDialog;
-import org.apache.directory.ldapstudio.schemas.view.viewers.SchemasViewSortDialog;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
@@ -67,12 +65,12 @@
         store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH,
"50" );
 
         // Hierarchy View Sorting
-        store.setDefault( HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_GROUPING,
-            HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST );
-        store.setDefault( HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY,
-            HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME );
-        store.setDefault( HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER,
-            HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING,
+            PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY,
+            PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME );
+        store.setDefault( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER,
+            PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING );
 
         // Schemas View Preference Page
         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_LABEL,
@@ -81,11 +79,11 @@
         store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_ABBREVIATE_MAX_LENGTH, "50"
);
 
         // Schemas View Sorting
-        store.setDefault( SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_GROUPING,
-            SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS );
-        store.setDefault( SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY,
-            SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME );
-        store.setDefault( SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_ORDER,
-            SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING );
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING,
+            PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS );
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY,
+            PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME );
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER,
+            PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING );
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewContentProvider.java?view=diff&rev=512306&r1=512305&r2=512306
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewContentProvider.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewContentProvider.java
Tue Feb 27 08:26:18 2007
@@ -26,6 +26,7 @@
 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.HideAttributeTypesAction;
 import org.apache.directory.ldapstudio.schemas.controller.actions.HideObjectClassesAction;
 import org.apache.directory.ldapstudio.schemas.model.AttributeType;
@@ -106,9 +107,9 @@
     {
         List<DisplayableTreeElement> children = new ArrayList<DisplayableTreeElement>();
 
-        int group = store.getInt( HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_GROUPING );
-        int sortBy = store.getInt( HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY
);
-        int sortOrder = store.getInt( HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER
);
+        int group = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING );
+        int sortBy = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY );
+        int sortOrder = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER
);
 
         if ( parentElement instanceof ObjectClassWrapper )
         {
@@ -142,17 +143,17 @@
             }
 
             // Sort by
-            if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
+            if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME )
             {
                 Collections.sort( children, firstNameSorter );
             }
-            else if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
+            else if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID )
             {
                 Collections.sort( children, oidSorter );
             }
 
             // Sort order
-            if ( sortOrder == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
+            if ( sortOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
             {
                 Collections.reverse( children );
             }
@@ -189,17 +190,17 @@
             }
 
             // Sort by
-            if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
+            if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME )
             {
                 Collections.sort( children, firstNameSorter );
             }
-            else if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
+            else if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID )
             {
                 Collections.sort( children, oidSorter );
             }
 
             // Sort order
-            if ( sortOrder == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
+            if ( sortOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
             {
                 Collections.reverse( children );
             }
@@ -270,22 +271,22 @@
                     }
                 }
 
-                if ( group == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST
)
+                if ( group == PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST )
                 {
                     // Sort by
-                    if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
+                    if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
                     {
                         Collections.sort( atList, firstNameSorter );
                         Collections.sort( ocList, firstNameSorter );
                     }
-                    else if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
+                    else if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
                     {
                         Collections.sort( atList, oidSorter );
                         Collections.sort( ocList, oidSorter );
                     }
 
                     // Sort Order
-                    if ( sortOrder == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
+                    if ( sortOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
                     {
                         Collections.reverse( atList );
                         Collections.reverse( ocList );
@@ -295,22 +296,22 @@
                     children.addAll( atList );
                     children.addAll( ocList );
                 }
-                else if ( group == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST
)
+                else if ( group == PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST
)
                 {
                     // Sort by
-                    if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
+                    if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
                     {
                         Collections.sort( atList, firstNameSorter );
                         Collections.sort( ocList, firstNameSorter );
                     }
-                    else if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
+                    else if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
                     {
                         Collections.sort( atList, oidSorter );
                         Collections.sort( ocList, oidSorter );
                     }
 
                     // Sort Order
-                    if ( sortOrder == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
+                    if ( sortOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
                     {
                         Collections.reverse( atList );
                         Collections.reverse( ocList );
@@ -320,24 +321,24 @@
                     children.addAll( ocList );
                     children.addAll( atList );
                 }
-                else if ( group == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_GROUPING_MIXED
)
+                else if ( group == PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_MIXED )
                 {
                     // Group
                     children.addAll( atList );
                     children.addAll( ocList );
 
                     // Sort by
-                    if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
+                    if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
)
                     {
                         Collections.sort( children, firstNameSorter );
                     }
-                    else if ( sortBy == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
+                    else if ( sortBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
)
                     {
                         Collections.sort( children, oidSorter );
                     }
 
                     // Sort order
-                    if ( sortOrder == HierarchyViewSortDialog.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
+                    if ( sortOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
                     {
                         Collections.reverse( children );
                     }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewSortDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewSortDialog.java?view=diff&rev=512306&r1=512305&r2=512306
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewSortDialog.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/HierarchyViewSortDialog.java
Tue Feb 27 08:26:18 2007
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.ldapstudio.schemas.Activator;
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -54,39 +55,6 @@
     /** The Sorting OID category */
     private static final String SORTING_OID = "OID";
 
-    /** The preference ID for Grouping */
-    public static final String PREFS_HIERARCHY_VIEW_GROUPING = Activator.PLUGIN_ID
-        + ".preferences.HierarchyView.grouping";
-
-    /** The preference value for grouping 'attribute types first' */
-    public static final int PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST = 0;
-
-    /** The preference value for grouping 'object classes first' */
-    public static final int PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST = 1;
-
-    /** The preference value for grouping 'mixed' */
-    public static final int PREFS_HIERARCHY_VIEW_GROUPING_MIXED = 2;
-
-    /** The preference ID for Sorting By */
-    public static final String PREFS_HIERARCHY_VIEW_SORTING_BY = Activator.PLUGIN_ID
-        + ".preferences.HierarchyView.sortingBy";
-
-    /** The preference value for sorting 'First Name' */
-    public static final int PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME = 0;
-
-    /** The prefence value for sorting 'OID' */
-    public static final int PREFS_HIERARCHY_VIEW_SORTING_BY_OID = 1;
-
-    /** The preference ID for Sorting Order */
-    public static final String PREFS_HIERARCHY_VIEW_SORTING_ORDER = Activator.PLUGIN_ID
-        + ".preferences.HierarchyView.sortingOrder";
-
-    /** The preference value for sorting 'ascending' */
-    public static final int PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING = 0;
-
-    /** The prefence value for sorting 'descending' */
-    public static final int PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING = 1;
-
     // UI Fields
     private Button atFirstButton;
     private Button ocFirstButton;
@@ -195,36 +163,36 @@
     {
         IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
-        int grouping = store.getInt( PREFS_HIERARCHY_VIEW_GROUPING );
-        if ( grouping == PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST )
+        int grouping = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING );
+        if ( grouping == PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST )
         {
             atFirstButton.setSelection( true );
         }
-        else if ( grouping == PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST )
+        else if ( grouping == PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST )
         {
             ocFirstButton.setSelection( true );
         }
-        else if ( grouping == PREFS_HIERARCHY_VIEW_GROUPING_MIXED )
+        else if ( grouping == PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_MIXED )
         {
             mixedButton.setSelection( true );
         }
 
-        int sortingBy = store.getInt( PREFS_HIERARCHY_VIEW_SORTING_BY );
-        if ( sortingBy == PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME )
+        int sortingBy = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY );
+        if ( sortingBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME )
         {
             sortingCombo.select( 0 );
         }
-        else if ( sortingBy == PREFS_HIERARCHY_VIEW_SORTING_BY_OID )
+        else if ( sortingBy == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID )
         {
             sortingCombo.select( 1 );
         }
 
-        int sortingOrder = store.getInt( PREFS_HIERARCHY_VIEW_SORTING_ORDER );
-        if ( sortingOrder == PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING )
+        int sortingOrder = store.getInt( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER
);
+        if ( sortingOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING
)
         {
             ascendingButton.setSelection( true );
         }
-        else if ( sortingOrder == PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING )
+        else if ( sortingOrder == PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
)
         {
             descendingButton.setSelection( true );
         }
@@ -242,35 +210,35 @@
             IPreferenceStore store = Activator.getDefault().getPreferenceStore();
             if ( ( atFirstButton.getSelection() ) & ( !ocFirstButton.getSelection() )
& ( !mixedButton.getSelection() ) )
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_GROUPING, PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING, PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_ATFIRST
);
             }
             else if ( ( !atFirstButton.getSelection() ) & ( ocFirstButton.getSelection()
)
                 & ( !mixedButton.getSelection() ) )
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_GROUPING, PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING, PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_OCFIRST
);
             }
             else if ( ( !atFirstButton.getSelection() ) & ( !ocFirstButton.getSelection()
)
                 & ( mixedButton.getSelection() ) )
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_GROUPING, PREFS_HIERARCHY_VIEW_GROUPING_MIXED
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING, PluginConstants.PREFS_HIERARCHY_VIEW_GROUPING_MIXED
);
             }
 
             if ( sortingCombo.getItem( sortingCombo.getSelectionIndex() ).equals( SORTING_FISTNAME
) )
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_SORTING_BY, PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY, PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_FIRSTNAME
);
             }
             else if ( sortingCombo.getItem( sortingCombo.getSelectionIndex() ).equals( SORTING_OID
) )
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_SORTING_BY, PREFS_HIERARCHY_VIEW_SORTING_BY_OID
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY, PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_BY_OID
);
             }
 
             if ( ascendingButton.getSelection() && !descendingButton.getSelection()
)
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_SORTING_ORDER, PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER, PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_ASCENDING
);
             }
             else if ( !ascendingButton.getSelection() && descendingButton.getSelection()
)
             {
-                store.setValue( PREFS_HIERARCHY_VIEW_SORTING_ORDER, PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
);
+                store.setValue( PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER, PluginConstants.PREFS_HIERARCHY_VIEW_SORTING_ORDER_DESCENDING
);
             }
         }
 

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewContentProvider.java?view=diff&rev=512306&r1=512305&r2=512306
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewContentProvider.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewContentProvider.java
Tue Feb 27 08:26:18 2007
@@ -26,6 +26,7 @@
 import java.util.List;
 
 import org.apache.directory.ldapstudio.schemas.Activator;
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.model.AttributeType;
 import org.apache.directory.ldapstudio.schemas.model.ObjectClass;
 import org.apache.directory.ldapstudio.schemas.model.Schema;
@@ -95,9 +96,9 @@
     {
         List<DisplayableTreeElement> children = new ArrayList<DisplayableTreeElement>();
 
-        int group = store.getInt( SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_GROUPING );
-        int sortBy = store.getInt( SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY );
-        int sortOrder = store.getInt( SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_ORDER
);
+        int group = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING );
+        int sortBy = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY );
+        int sortOrder = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER );
 
         if ( parentElement instanceof IntermediateNode )
         {
@@ -121,17 +122,17 @@
                 }
 
                 // Sort by
-                if ( sortBy == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME
)
+                if ( sortBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME )
                 {
                     Collections.sort( children, firstNameSorter );
                 }
-                else if ( sortBy == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_OID
)
+                else if ( sortBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_OID )
                 {
                     Collections.sort( children, oidSorter );
                 }
 
                 // Sort order
-                if ( sortOrder == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
+                if ( sortOrder == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
                 {
                     Collections.reverse( children );
                 }
@@ -147,17 +148,17 @@
                 }
 
                 // Sort by
-                if ( sortBy == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME
)
+                if ( sortBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME )
                 {
                     Collections.sort( children, firstNameSorter );
                 }
-                else if ( sortBy == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_OID
)
+                else if ( sortBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_OID )
                 {
                     Collections.sort( children, oidSorter );
                 }
 
                 // Sort order
-                if ( sortOrder == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
+                if ( sortOrder == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
                 {
                     Collections.reverse( children );
                 }
@@ -165,7 +166,7 @@
         }
         else if ( parentElement instanceof SchemaWrapper )
         {
-            if ( group == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS )
+            if ( group == PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS )
             {
                 IntermediateNode attributeTypes = new IntermediateNode(
                     "Attribute Types", ( SchemaWrapper ) parentElement, IntermediateNodeType.ATTRIBUTE_TYPE_FOLDER
); //$NON-NLS-1$
@@ -175,7 +176,7 @@
                 children.add( attributeTypes );
                 children.add( objectClasses );
             }
-            else if ( group == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_GROUPING_MIXED )
+            else if ( group == PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_MIXED )
             {
                 Schema schema = ( ( SchemaWrapper ) parentElement ).getMySchema();
 
@@ -192,17 +193,17 @@
                 }
 
                 // Sort by
-                if ( sortBy == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME
)
+                if ( sortBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME )
                 {
                     Collections.sort( children, firstNameSorter );
                 }
-                else if ( sortBy == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_BY_OID
)
+                else if ( sortBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_OID )
                 {
                     Collections.sort( children, oidSorter );
                 }
 
                 // Sort order
-                if ( sortOrder == SchemasViewSortDialog.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
+                if ( sortOrder == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
                 {
                     Collections.reverse( children );
                 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewSortDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewSortDialog.java?view=diff&rev=512306&r1=512305&r2=512306
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewSortDialog.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/viewers/SchemasViewSortDialog.java
Tue Feb 27 08:26:18 2007
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.ldapstudio.schemas.Activator;
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -54,35 +55,6 @@
     /** The Sorting OID category */
     private static final String SORTING_OID = "OID";
 
-    /** The preference ID for Grouping */
-    public static final String PREFS_SCHEMAS_VIEW_GROUPING = Activator.PLUGIN_ID + ".preferences.SchemasView.grouping";
-
-    /** The preference value for grouping 'group ATs and OCs in folders' */
-    public static final int PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS = 0;
-
-    /** The preference value for grouping 'mixed' */
-    public static final int PREFS_SCHEMAS_VIEW_GROUPING_MIXED = 1;
-
-    /** The preference ID for Sorting By */
-    public static final String PREFS_SCHEMAS_VIEW_SORTING_BY = Activator.PLUGIN_ID
-        + ".preferences.SchemasView.sortingBy";
-
-    /** The preference value for sorting 'First Name' */
-    public static final int PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME = 0;
-
-    /** The prefence value for sorting 'OID' */
-    public static final int PREFS_SCHEMAS_VIEW_SORTING_BY_OID = 1;
-
-    /** The preference ID for Sorting Order */
-    public static final String PREFS_SCHEMAS_VIEW_SORTING_ORDER = Activator.PLUGIN_ID
-        + ".preferences.SchemasView.sortingOrder";
-
-    /** The preference value for sorting 'ascending' */
-    public static final int PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING = 0;
-
-    /** The prefence value for sorting 'descending' */
-    public static final int PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING = 1;
-
     // UI Fields
     private Button inFoldersButton;
     private Button mixedButton;
@@ -185,32 +157,32 @@
     {
         IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
-        int grouping = store.getInt( PREFS_SCHEMAS_VIEW_GROUPING );
-        if ( grouping == PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS )
+        int grouping = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING );
+        if ( grouping == PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS )
         {
             inFoldersButton.setSelection( true );
         }
-        else if ( grouping == PREFS_SCHEMAS_VIEW_GROUPING_MIXED )
+        else if ( grouping == PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_MIXED )
         {
             mixedButton.setSelection( true );
         }
 
-        int sortingBy = store.getInt( PREFS_SCHEMAS_VIEW_SORTING_BY );
-        if ( sortingBy == PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME )
+        int sortingBy = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY );
+        if ( sortingBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME )
         {
             sortingCombo.select( 0 );
         }
-        else if ( sortingBy == PREFS_SCHEMAS_VIEW_SORTING_BY_OID )
+        else if ( sortingBy == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_OID )
         {
             sortingCombo.select( 1 );
         }
 
-        int sortingOrder = store.getInt( PREFS_SCHEMAS_VIEW_SORTING_ORDER );
-        if ( sortingOrder == PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING )
+        int sortingOrder = store.getInt( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER
);
+        if ( sortingOrder == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING )
         {
             ascendingButton.setSelection( true );
         }
-        else if ( sortingOrder == PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING )
+        else if ( sortingOrder == PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
)
         {
             descendingButton.setSelection( true );
         }
@@ -228,29 +200,29 @@
             IPreferenceStore store = Activator.getDefault().getPreferenceStore();
             if ( ( inFoldersButton.getSelection() ) & ( !mixedButton.getSelection() )
)
             {
-                store.setValue( PREFS_SCHEMAS_VIEW_GROUPING, PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS
);
+                store.setValue( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING, PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_FOLDERS
);
             }
             else if ( ( !inFoldersButton.getSelection() ) & ( mixedButton.getSelection()
) )
             {
-                store.setValue( PREFS_SCHEMAS_VIEW_GROUPING, PREFS_SCHEMAS_VIEW_GROUPING_MIXED
);
+                store.setValue( PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING, PluginConstants.PREFS_SCHEMAS_VIEW_GROUPING_MIXED
);
             }
 
             if ( sortingCombo.getItem( sortingCombo.getSelectionIndex() ).equals( SORTING_FISTNAME
) )
             {
-                store.setValue( PREFS_SCHEMAS_VIEW_SORTING_BY, PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME
);
+                store.setValue( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY, PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_FIRSTNAME
);
             }
             else if ( sortingCombo.getItem( sortingCombo.getSelectionIndex() ).equals( SORTING_OID
) )
             {
-                store.setValue( PREFS_SCHEMAS_VIEW_SORTING_BY, PREFS_SCHEMAS_VIEW_SORTING_BY_OID
);
+                store.setValue( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY, PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_BY_OID
);
             }
 
             if ( ascendingButton.getSelection() && !descendingButton.getSelection()
)
             {
-                store.setValue( PREFS_SCHEMAS_VIEW_SORTING_ORDER, PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING
);
+                store.setValue( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER, PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_ASCENDING
);
             }
             else if ( !ascendingButton.getSelection() && descendingButton.getSelection()
)
             {
-                store.setValue( PREFS_SCHEMAS_VIEW_SORTING_ORDER, PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
);
+                store.setValue( PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER, PluginConstants.PREFS_SCHEMAS_VIEW_SORTING_ORDER_DESCENDING
);
             }
         }
 



Mime
View raw message