directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r522812 - 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 Tue, 27 Mar 2007 08:47:46 GMT
Author: pamarcelot
Date: Tue Mar 27 01:47:45 2007
New Revision: 522812

URL: http://svn.apache.org/viewvc?view=rev&rev=522812
Log:
Merged the OID Preference Page into the General Preference Page. Refactored the access to
preference to unify the preference store.

Removed:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/OidPreferencePage.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.properties
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/Activator.java
    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/controller/actions/OpenLocalFileAction.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/Schema.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/SchemaPool.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/SchemasEditorPreferencePage.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/resources/org/apache/directory/ldapstudio/schemas/messages.properties

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.properties
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.properties?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.properties (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.properties Tue Mar 27 01:47:45
2007
@@ -61,7 +61,6 @@
 ldapstudio-schemas-plugin.wizards.createanewattributetype.name=Create a new attribute type
 
 ldapstudio-schemas-plugin.preferencepages.general.name=Schemas Editor
-ldapstudio-schemas-plugin.preferencepages.oid.name=OID
 
 ldapstudio-schemas-plugin.actionsets.actionset.label=Schema Plugin ActionSet
 ldapstudio-schemas-plugin.actionsets.menu.schemas.label=Schemas

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=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml (original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/plugin.xml Tue Mar 27 01:47:45 2007
@@ -183,11 +183,6 @@
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
-            category="org.apache.directory.ldapstudio.schemas.preferences.general"
-            class="org.apache.directory.ldapstudio.schemas.view.preferences.OidPreferencePage"
-            id="org.apache.directory.ldapstudio.schemas.preferences.oid"
-            name="%ldapstudio-schemas-plugin.preferencepages.oid.name"/>
-      <page
             class="org.apache.directory.ldapstudio.schemas.view.preferences.SchemasEditorPreferencePage"
             id="org.apache.directory.ldapstudio.schemas.preferences.general"
             name="%ldapstudio-schemas-plugin.preferencepages.general.name"/>

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/Activator.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/Activator.java?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/Activator.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/Activator.java
Tue Mar 27 01:47:45 2007
@@ -22,11 +22,8 @@
 
 
 import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
-import org.apache.directory.ldapstudio.schemas.view.preferences.SchemasEditorPreferencePage;
 import org.apache.directory.ldapstudio.schemas.view.views.SchemaCodeScanner;
 import org.apache.directory.ldapstudio.schemas.view.views.SchemaTextAttributeProvider;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.jface.text.rules.ITokenScanner;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
@@ -74,11 +71,9 @@
      */
     public void stop( BundleContext context ) throws Exception
     {
-        // save workspace configuration
-        IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-        boolean save_workspace = prefs.getBoolean( SchemasEditorPreferencePage.SAVE_WORKSPACE,
true );
-        if ( save_workspace )
-            SchemaPool.getInstance().savePool();
+        // Saving workspace configuration
+        SchemaPool.getInstance().savePool();
+
         plugin = null;
         super.stop( context );
     }
@@ -107,7 +102,7 @@
         {
             schemaCodeScanner = new SchemaCodeScanner( getSchemaTextAttributeProvider() );
         }
-        
+
         return schemaCodeScanner;
     }
 
@@ -124,7 +119,7 @@
         {
             schemaTextAttributeProvider = new SchemaTextAttributeProvider();
         }
-        
+
         return schemaTextAttributeProvider;
     }
 }

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=522812&r1=522811&r2=522812
==============================================================================
--- 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 Mar 27 01:47:45 2007
@@ -36,7 +36,8 @@
 {
     // Preferences - Schema Elements View
     /** The preference ID for Schema Elements View Label */
-    public static final String PREFS_SCHEMA_ELEMENTS_VIEW_LABEL = SchemaElementsViewPreferencePage.ID
+ ".label.labelValue"; //$NON-NLS-1$
+    public static final String PREFS_SCHEMA_ELEMENTS_VIEW_LABEL = SchemaElementsViewPreferencePage.ID
+        + ".label.labelValue"; //$NON-NLS-1$
 
     /** The preference value for Schema Elements View First Name label */
     public static final int PREFS_SCHEMA_ELEMENTS_VIEW_LABEL_FIRST_NAME = 0;
@@ -48,7 +49,8 @@
     public static final int PREFS_SCHEMA_ELEMENTS_VIEW_LABEL_OID = 2;
 
     /** The preference ID for Schema Elements View Abbreviate */
-    public static final String PREFS_SCHEMA_ELEMENTS_VIEW_ABBREVIATE = SchemaElementsViewPreferencePage.ID
+ ".label.abbreviate"; //$NON-NLS-1$
+    public static final String PREFS_SCHEMA_ELEMENTS_VIEW_ABBREVIATE = SchemaElementsViewPreferencePage.ID
+        + ".label.abbreviate"; //$NON-NLS-1$
 
     /** The preference ID for Schema Elements View Abbreviate Max Length*/
     public static final String PREFS_SCHEMA_ELEMENTS_VIEW_ABBREVIATE_MAX_LENGTH = SchemaElementsViewPreferencePage.ID
@@ -156,18 +158,17 @@
     /** The preference ID for Search History of the Search View */
     public static final String PREFS_SEARCH_VIEW_SEARCH_HISTORY = Activator.PLUGIN_ID
         + ".preferences.SearchView.searchHistory";
-    
+
     // Preferences - Hierarchy View
     /** The preference ID for Mode of the Hierarchy View */
-    public static final String PREFS_HIERARCHY_VIEW_MODE = Activator.PLUGIN_ID
-        + ".preferences.HierarchyView.mode";
-    
+    public static final String PREFS_HIERARCHY_VIEW_MODE = Activator.PLUGIN_ID + ".preferences.HierarchyView.mode";
+
     /** The preference value for Hierarchy View Mode 'Supertype' */
     public static final int PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE = 0;
-    
+
     /** 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$
 
@@ -203,6 +204,23 @@
     public static final String PREFS_HIERARCHY_VIEW_SECONDARY_LABEL_ABBREVIATE_MAX_LENGTH
= HierarchyViewPreferencePage.ID
         + ".secondaryLabel.abbreviate.maxLength"; //$NON-NLS-1$
 
+    // Preferences - Schemas Editor
+    /** The preference ID for Specific Core of the Schemas Editor */
+    public static final String PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE = Activator.PLUGIN_ID
+        + ".preferences.SchemasEditor.specificCore";
+
+    /** The preference ID for Specific Core Directory of the Schemas Editor */
+    public static final String PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY = Activator.PLUGIN_ID
+        + ".preferences.SchemasEditor.specificCoreDirectory";
+
+    /** The preference ID for Auto OID of the Schemas Editor */
+    public static final String PREFS_SCHEMAS_EDITOR_AUTO_OID = Activator.PLUGIN_ID
+        + ".preferences.SchemasEditor.autoOID";
+
+    /** The preference ID for Company OID of the Schemas Editor */
+    public static final String PREFS_SCHEMAS_EDITOR_COMPANY_OID = Activator.PLUGIN_ID
+        + ".preferences.SchemasEditor.companyOID";
+
     // Images - Actions
     public static final String IMG_ABOUT = "ressources/icons/flag_blue.png"; //$NON-NLS-1$
     public static final String IMG_CREATE_A_NEW_ATTRIBUTETYPE = "ressources/icons/attribute_type_new.gif";
//$NON-NLS-1$
@@ -240,12 +258,11 @@
     public static final String IMG_SCHEMA_CORE = "ressources/icons/schema_core.gif"; //$NON-NLS-1$
     public static final String IMG_WARNING_OVERLAY = "ressources/icons/warning_overlay.gif";
//$NON-NLS-1$
 
-
     // Images - Wizards
     public static final String IMG_ATTRIBUTE_TYPE_NEW_WIZARD = "ressources/icons/attribute_type_new_wizard.png";
//$NON-NLS-1$
     public static final String IMG_OBJECT_CLASS_NEW_WIZARD = "ressources/icons/object_class_new_wizard.png";
//$NON-NLS-1$
     public static final String IMG_SCHEMA_NEW_WIZARD = "ressources/icons/schema_new_wizard.png";
//$NON-NLS-1$
-    
+
     // Action IDs
     public static final String CMD_COLLAPSE_ALL = Activator.PLUGIN_ID + ".cmd.CollapseAll";
//$NON-NLS-1$
     public static final String CMD_CREATE_A_NEW_ATTRIBUTETYPE = Activator.PLUGIN_ID + ".cmd.CreateANewAttributeAype";
//$NON-NLS-1$
@@ -255,11 +272,15 @@
     public static final String CMD_ERASE_SEARCH = Activator.PLUGIN_ID + ".cmd.EraseSearch";
//$NON-NLS-1$
     public static final String CMD_HIDE_ATTRIBUTE_TYPES = Activator.PLUGIN_ID + ".cmd.HideAttributesTypes";
//$NON-NLS-1$
     public static final String CMD_HIDE_OBJECT_CLASSES = Activator.PLUGIN_ID + ".cmd.HideObjectClasses";
//$NON-NLS-1$
-    public static final String CMD_LINK_WITH_EDITOR_SCHEMA_ELEMENTS_VIEW = Activator.PLUGIN_ID
+ ".cmd.LinkWithEditorSchemaElementsView"; //$NON-NLS-1$
-    public static final String CMD_LINK_WITH_EDITOR_SCHEMA_VIEW = Activator.PLUGIN_ID + ".cmd.LinkWithEditorSchemasView";
//$NON-NLS-1$
+    public static final String CMD_LINK_WITH_EDITOR_SCHEMA_ELEMENTS_VIEW = Activator.PLUGIN_ID
+        + ".cmd.LinkWithEditorSchemaElementsView"; //$NON-NLS-1$
+    public static final String CMD_LINK_WITH_EDITOR_SCHEMA_VIEW = Activator.PLUGIN_ID
+        + ".cmd.LinkWithEditorSchemasView"; //$NON-NLS-1$
     public static final String CMD_OPEN_LOCAL = Activator.PLUGIN_ID + ".cmd.OpenLocal"; //$NON-NLS-1$
-    public static final String CMD_SCHEMA_ELEMENTS_VIEW_PREFERENCES = Activator.PLUGIN_ID
+ ".cmd.OpenSchemaElementsViewPreferences"; //$NON-NLS-1$
-    public static final String CMD_SCHEMA_ELEMENTS_VIEW_SORT_DIALOG = Activator.PLUGIN_ID
+ ".cmd.OpenSchemaElementsViewSortDialog"; //$NON-NLS-1$
+    public static final String CMD_SCHEMA_ELEMENTS_VIEW_PREFERENCES = Activator.PLUGIN_ID
+        + ".cmd.OpenSchemaElementsViewPreferences"; //$NON-NLS-1$
+    public static final String CMD_SCHEMA_ELEMENTS_VIEW_SORT_DIALOG = Activator.PLUGIN_ID
+        + ".cmd.OpenSchemaElementsViewSortDialog"; //$NON-NLS-1$
     public static final String CMD_OPEN_SCHEMA_SOURCE_CODE = Activator.PLUGIN_ID + ".cmd.OpenSchemaSourceSode";
//$NON-NLS-1$
     public static final String CMD_SCHEMAS_VIEW_PREFERENCES = Activator.PLUGIN_ID + ".cmd.OpenSchemasViewPreferences";
//$NON-NLS-1$
     public static final String CMD_SCHEMAS_VIEW_SORT_DIALOG = Activator.PLUGIN_ID + ".cmd.OpenSchemasViewSortDialog";
//$NON-NLS-1$
@@ -270,5 +291,6 @@
     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$
+    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/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=522812&r1=522811&r2=522812
==============================================================================
--- 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 Mar 27 01:47:45 2007
@@ -23,11 +23,7 @@
 
 import org.apache.directory.ldapstudio.schemas.Activator;
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
-import org.apache.directory.ldapstudio.schemas.view.preferences.OidPreferencePage;
-import org.apache.directory.ldapstudio.schemas.view.preferences.SchemasEditorPreferencePage;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.jface.preference.IPreferenceStore;
 
 
@@ -43,16 +39,14 @@
     @Override
     public void initializeDefaultPreferences()
     {
-        IEclipsePreferences defaults = new DefaultScope().getNode( Activator.PLUGIN_ID );
-        defaults.put( OidPreferencePage.COMPANY_OID, "1.2.3.4.5.6" ); //$NON-NLS-1$
-        defaults.putBoolean( OidPreferencePage.AUTO_OID, true );
-        defaults.put( SchemasEditorPreferencePage.DEFAULT_DIRECTORY, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
-        defaults.putBoolean( SchemasEditorPreferencePage.SAVE_WORKSPACE, true );
-        defaults.putBoolean( SchemasEditorPreferencePage.SPECIFIC_CORE, false );
-        defaults.put( SchemasEditorPreferencePage.SPECIFIC_CORE_DIRECTORY, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
-
         IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
+        // Schemas Editor Preference Page
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE, false );
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY, System.getProperty(
"user.home" ) ); //$NON-NLS-1$
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID, true );
+        store.setDefault( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID, "1.2.3.4.5.6"
); //$NON-NLS-1$
+
         // Schema Elements View Preference Page
         store.setDefault( PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_LABEL,
             PluginConstants.PREFS_SCHEMA_ELEMENTS_VIEW_LABEL_ALL_ALIASES );
@@ -85,7 +79,7 @@
             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 );

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=522812&r1=522811&r2=522812
==============================================================================
--- 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
Tue Mar 27 01:47:45 2007
@@ -26,10 +26,7 @@
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
 import org.apache.directory.ldapstudio.schemas.model.Schema.SchemaType;
-import org.apache.directory.ldapstudio.schemas.view.preferences.SchemasEditorPreferencePage;
 import org.apache.log4j.Logger;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.jface.action.Action;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
@@ -66,11 +63,7 @@
     {
         FileDialog fd = new FileDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.OPEN );
         fd.setText( Messages.getString( "OpenLocalFileAction.Open_a_schema_file" ) ); //$NON-NLS-1$
-
-        IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-        String defaultPath = prefs
-            .get( SchemasEditorPreferencePage.DEFAULT_DIRECTORY, System.getProperty( "user.home"
) ); //$NON-NLS-1$
-        fd.setFilterPath( defaultPath );
+        fd.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
         String[] filterExt =
             { "*.schema", "*.*" }; //$NON-NLS-1$ //$NON-NLS-2$
         fd.setFilterExtensions( filterExt );

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/Schema.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/Schema.java?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/Schema.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/Schema.java
Tue Mar 27 01:47:45 2007
@@ -32,16 +32,12 @@
 import java.util.Hashtable;
 import java.util.Set;
 
-import org.apache.directory.ldapstudio.schemas.Activator;
 import org.apache.directory.ldapstudio.schemas.Messages;
 import org.apache.directory.ldapstudio.schemas.io.SchemaParser;
 import org.apache.directory.ldapstudio.schemas.io.SchemaWriter;
-import org.apache.directory.ldapstudio.schemas.view.preferences.SchemasEditorPreferencePage;
 import org.apache.directory.server.core.tools.schema.AttributeTypeLiteral;
 import org.apache.directory.server.core.tools.schema.ObjectClassLiteral;
 import org.apache.log4j.Logger;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.MessageBox;
@@ -579,10 +575,7 @@
         {
             FileDialog fd = new FileDialog( new Shell(), SWT.SAVE );
             fd.setText( Messages.getString( "Schema.Save_this_schema" ) + this.getName()
); //$NON-NLS-1$
-            IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-            String defaultPath = prefs.get( SchemasEditorPreferencePage.DEFAULT_DIRECTORY,
System
-                .getProperty( "user.home" ) ); //$NON-NLS-1$
-            fd.setFilterPath( defaultPath );
+            fd.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
             fd.setFileName( this.name + ".schema" ); //$NON-NLS-1$
             fd.setFilterExtensions( new String[]
                 { "*.schema", "*.*" } ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -626,10 +619,7 @@
 
         FileDialog fd = new FileDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.SAVE );
         fd.setText( Messages.getString( "Schema.Save_this_schema" ) + this.getName() ); //$NON-NLS-1$
-        IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-        String defaultPath = prefs
-            .get( SchemasEditorPreferencePage.DEFAULT_DIRECTORY, System.getProperty( "user.home"
) ); //$NON-NLS-1$
-        fd.setFilterPath( defaultPath );
+        fd.setFilterPath( System.getProperty( "user.home" ) ); //$NON-NLS-1$
         fd.setFileName( this.name + ".schema" ); //$NON-NLS-1$
         fd.setFilterExtensions( new String[]
             { "*.schema", "*.*" } ); //$NON-NLS-1$ //$NON-NLS-2$

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/SchemaPool.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/SchemaPool.java?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/SchemaPool.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/model/SchemaPool.java
Tue Mar 27 01:47:45 2007
@@ -34,11 +34,10 @@
 import java.util.Map;
 
 import org.apache.directory.ldapstudio.schemas.Activator;
-import org.apache.directory.ldapstudio.schemas.view.preferences.SchemasEditorPreferencePage;
+import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.WorkbenchException;
 import org.eclipse.ui.XMLMemento;
@@ -180,9 +179,9 @@
 
     private static void initializeWithSpecified( SchemaPool pool )
     {
-        IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-        String specificPath = prefs.get( SchemasEditorPreferencePage.SPECIFIC_CORE_DIRECTORY,
System
-            .getProperty( "user.home" ) ); //$NON-NLS-1$
+
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+        String specificPath = store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY
);
 
         File dir = new File( specificPath );
         String sCurPath = dir.getAbsolutePath() + File.separator;
@@ -236,11 +235,10 @@
                     //1) create the pool instance
                     SchemaPool pool = new SchemaPool();
 
-                    IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-
                     //2) initialize the pool
-                    boolean initialize_with_specified = prefs.getBoolean( SchemasEditorPreferencePage.SPECIFIC_CORE,
-                        false );
+                    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+                    boolean initialize_with_specified = store
+                        .getBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE );
                     if ( initialize_with_specified )
                     {
                         //2a) with user-specified core schemas
@@ -257,9 +255,7 @@
 
                     //4) load the pool with all the schemas that the user did select the
last time
                     //LDAPStudio was launched
-                    boolean save_workspace = prefs.getBoolean( SchemasEditorPreferencePage.SAVE_WORKSPACE,
true );
-                    if ( save_workspace )
-                        instance_.loadPool();
+                    instance_.loadPool();
                 }
             }
         }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/SchemasEditorPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/SchemasEditorPreferencePage.java?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/SchemasEditorPreferencePage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/preferences/SchemasEditorPreferencePage.java
Tue Mar 27 01:47:45 2007
@@ -21,17 +21,28 @@
 package org.apache.directory.ldapstudio.schemas.view.preferences;
 
 
-import java.io.IOException;
-
 import org.apache.directory.ldapstudio.schemas.Activator;
 import org.apache.directory.ldapstudio.schemas.Messages;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.DirectoryFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
+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.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+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;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.eclipse.ui.PlatformUI;
 
 
 /**
@@ -39,72 +50,207 @@
  * From there you can access schema related preferences.
  *
  */
-public class SchemasEditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage
+public class SchemasEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
 {
+    // UI fields
+    private Button specificCoreSchemasCheckbox;
+    private Label specificCoreSchemasLabel;
+    private Text specificCoreSchemasText;
+    private Button specificCoreSchemasButton;
+    private Button defaultOidCheckbox;
+    private Label defaultOidLabel;
+    private Text defaultOidText;
 
-    public static final String DEFAULT_DIRECTORY = "prefs_default_directory"; //$NON-NLS-1$
-    public static final String SAVE_WORKSPACE = "prefs_save_workspace"; //$NON-NLS-1$
-    public static final String SPECIFIC_CORE = "prefs_specific_core"; //$NON-NLS-1$
-    public static final String SPECIFIC_CORE_DIRECTORY = "prefs_specific_core_directory";
//$NON-NLS-1$
 
-    private ScopedPreferenceStore preferences;
+    /**
+     * Creates a new instance of SchemasEditorPreferencePage.
+     */
+    public SchemasEditorPreferencePage()
+    {
+        super();
+        setPreferenceStore( Activator.getDefault().getPreferenceStore() );
+        setDescription( "General settings for the Schemas Editor Plugin" );
+    }
 
 
-    public SchemasEditorPreferencePage()
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+     */
+    protected Control createContents( Composite parent )
     {
-        super( GRID );
-        super.setDescription( "General settings for the Schemas Editor" );
-        preferences = new ScopedPreferenceStore( new ConfigurationScope(), Activator.PLUGIN_ID
);
-        setPreferenceStore( preferences );
+
+        // SPECIFIC CORE SCHEMAS Group
+        Group specificCoreSchemasGroup = new Group( parent, SWT.NONE );
+        specificCoreSchemasGroup.setText( "Core Schemas" );
+        specificCoreSchemasGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
+        specificCoreSchemasGroup.setLayout( new GridLayout( 3, false ) );
+
+        // SPECIFIC CORE SCHEMAS Checkbox
+        specificCoreSchemasCheckbox = new Button( specificCoreSchemasGroup, SWT.CHECK );
+        specificCoreSchemasCheckbox.setText( Messages.getString( "SchemaPreferencePage.Use_specific_core_schemas"
) ); //$NON-NLS-1$
+        specificCoreSchemasCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false,
false, 3, 1 ) );
+
+        // SPECIFIC CORE SCHEMAS Label 
+        specificCoreSchemasLabel = new Label( specificCoreSchemasGroup, SWT.NONE );
+        specificCoreSchemasLabel.setText( Messages.getString( "SchemaPreferencePage.Core_schemas_directory"
) ); //$NON-NLS-1$
+
+        // SPECIFIC CORE SCHEMAS Text
+        specificCoreSchemasText = new Text( specificCoreSchemasGroup, SWT.BORDER );
+        specificCoreSchemasText.setEditable( false );
+        specificCoreSchemasText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
+
+        // SPECIFIC CORE SCHEMAS Button
+        specificCoreSchemasButton = new Button( specificCoreSchemasGroup, SWT.PUSH );
+        specificCoreSchemasButton.setText( "Browse..." );
+
+        // DEFAULT OID Group
+        Group defaultOidGroup = new Group( parent, SWT.NONE );
+        defaultOidGroup.setText( "Default OID" );
+        defaultOidGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        defaultOidGroup.setLayout( new GridLayout( 2, false ) );
+
+        // DEFAULT OID Checkbox
+        defaultOidCheckbox = new Button( defaultOidGroup, SWT.CHECK );
+        defaultOidCheckbox.setText( Messages
+            .getString( "GeneralPreferencePage.Automatically_prefix_new_elements_with_this_OID"
) );
+        defaultOidCheckbox.setLayoutData( new GridData( SWT.FILL, SWT.NONE, false, false,
2, 1 ) );
+
+        // DEFAULT OID  Label
+        defaultOidLabel = new Label( defaultOidGroup, SWT.NONE );
+        defaultOidLabel.setText( Messages.getString( "GeneralPreferencePage.Your_organizations_default_OID"
) );
+
+        // DEFAULT OID Text
+        defaultOidText = new Text( defaultOidGroup, SWT.BORDER );
+        defaultOidText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+
+        initFieldsFromPreferences();
+
+        initListeners();
+
+        applyDialogFont( parent );
+
+        return parent;
     }
 
 
-    public void init( IWorkbench workbench )
+    /**
+     * Initializes the UI Fields from the preferences.
+     */
+    private void initFieldsFromPreferences()
     {
-        // TODO Auto-generated method stub
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
+        specificCoreSchemasCheckbox
+            .setSelection( store.getBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE
) );
+        specificCoreSchemasLabel.setEnabled( specificCoreSchemasCheckbox.getSelection() );
+        specificCoreSchemasText.setEnabled( specificCoreSchemasCheckbox.getSelection() );
+        specificCoreSchemasText
+            .setText( store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY
) );
+        specificCoreSchemasButton.setEnabled( specificCoreSchemasCheckbox.getSelection()
);
+
+        defaultOidCheckbox.setSelection( store.getBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID
) );
+        defaultOidLabel.setEnabled( defaultOidCheckbox.getSelection() );
+        defaultOidText.setEnabled( defaultOidCheckbox.getSelection() );
+        defaultOidText.setText( store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID
) );
     }
 
 
-    @Override
-    protected void createFieldEditors()
+    /**
+     * Initializes the listeners.
+     */
+    private void initListeners()
     {
+        specificCoreSchemasCheckbox.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                specificCoreSchemasLabel.setEnabled( specificCoreSchemasCheckbox.getSelection()
);
+                specificCoreSchemasText.setEnabled( specificCoreSchemasCheckbox.getSelection()
);
+                specificCoreSchemasButton.setEnabled( specificCoreSchemasCheckbox.getSelection()
);
+            }
+        } );
 
-        DirectoryFieldEditor directoryEditor = new DirectoryFieldEditor( DEFAULT_DIRECTORY,
Messages
-            .getString( "SchemaPreferencePage.Default_save-load_dialogs_directory" ), //$NON-NLS-1$
-            getFieldEditorParent() );
+        specificCoreSchemasButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                DirectoryDialog dd = new DirectoryDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+                    .getShell() );
+                dd.setFilterPath( System.getProperty( "user.home" ) );
+                String selectedFolder = dd.open();
+                if ( selectedFolder != null )
+                {
+                    specificCoreSchemasText.setText( selectedFolder );
+                }
+            }
+        } );
 
-        addField( directoryEditor );
+        defaultOidCheckbox.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                defaultOidLabel.setEnabled( defaultOidCheckbox.getSelection() );
+                defaultOidText.setEnabled( defaultOidCheckbox.getSelection() );
+            }
+        } );
 
-        BooleanFieldEditor saveWorkspaceEditor = new BooleanFieldEditor( SAVE_WORKSPACE,
Messages
-            .getString( "SchemaPreferencePage.Save_schemas_configuration_when_exiting_LDAP_Studio"
), //$NON-NLS-1$
-            getFieldEditorParent() );
+        defaultOidText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "([0-9]*\\.?)*" ) )
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+    }
 
-        addField( saveWorkspaceEditor );
 
-        BooleanFieldEditor specificCore = new BooleanFieldEditor( SPECIFIC_CORE, Messages
-            .getString( "SchemaPreferencePage.Use_specific_core_files" ), //$NON-NLS-1$
-            getFieldEditorParent() );
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.PreferencePage#performOk()
+     */
+    public boolean performOk()
+    {
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
-        addField( specificCore );
+        store.setValue( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE, specificCoreSchemasCheckbox.getSelection()
);
+        store
+            .setValue( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY, specificCoreSchemasText.getText()
);
 
-        DirectoryFieldEditor coreDirectoryEditor = new DirectoryFieldEditor( SPECIFIC_CORE_DIRECTORY,
Messages
-            .getString( "SchemaPreferencePage.Core_schemas_directory" ), //$NON-NLS-1$
-            getFieldEditorParent() );
+        store.setValue( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID, defaultOidCheckbox.getSelection()
);
+        store.setValue( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID, defaultOidText.getText()
);
 
-        addField( coreDirectoryEditor );
+        return super.performOk();
     }
 
 
-    public boolean performOk()
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+     */
+    protected void performDefaults()
+    {
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+
+        specificCoreSchemasCheckbox.setSelection( store
+            .getDefaultBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE ) );
+        specificCoreSchemasLabel.setEnabled( specificCoreSchemasCheckbox.getSelection() );
+        specificCoreSchemasText.setEnabled( specificCoreSchemasCheckbox.getSelection() );
+        specificCoreSchemasText.setText( store
+            .getDefaultString( PluginConstants.PREFS_SCHEMAS_EDITOR_SPECIFIC_CORE_DIRECTORY
) );
+        specificCoreSchemasButton.setEnabled( specificCoreSchemasCheckbox.getSelection()
);
+
+        defaultOidCheckbox.setSelection( store.getDefaultBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID
) );
+        defaultOidLabel.setEnabled( defaultOidCheckbox.getSelection() );
+        defaultOidText.setEnabled( defaultOidCheckbox.getSelection() );
+        defaultOidText.setText( store.getDefaultString( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID
) );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+     */
+    public void init( IWorkbench workbench )
     {
-        try
-        {
-            preferences.save();
-        }
-        catch ( IOException e )
-        {
-        }
-        return super.performOk();
     }
 }

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizardPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizardPage.java?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizardPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewAttributeTypeWizardPage.java
Tue Mar 27 01:47:45 2007
@@ -26,10 +26,8 @@
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
 import org.apache.directory.ldapstudio.schemas.view.ViewUtils;
-import org.apache.directory.ldapstudio.schemas.view.preferences.OidPreferencePage;
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
@@ -116,12 +114,12 @@
         {
             public void widgetSelected( SelectionEvent e )
             {
-                IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
+                IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
-                prefs.putBoolean( OidPreferencePage.AUTO_OID, autoOID.getSelection() );
+                store.setValue( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID, autoOID.getSelection()
);
                 if ( autoOID.getSelection() )
                 {
-                    String temp = prefs.get( OidPreferencePage.COMPANY_OID, "1.2.3.4.5.6"
); //$NON-NLS-1$
+                    String temp = store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID
);
                     oidField.setText( temp + "." ); //$NON-NLS-1$
                 }
                 else
@@ -131,9 +129,8 @@
             }
         } );
 
-        IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-
-        boolean auto_oid = prefs.getBoolean( OidPreferencePage.AUTO_OID, true );
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+        boolean auto_oid = store.getBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID
);
         autoOID.setSelection( auto_oid );
 
         Label label = new Label( container, SWT.NULL );
@@ -141,7 +138,7 @@
         oidField = new Text( container, SWT.BORDER | SWT.SINGLE );
         if ( auto_oid )
         {
-            String temp = prefs.get( OidPreferencePage.COMPANY_OID, "1.2.3.4.5.6" ); //$NON-NLS-1$
+            String temp = store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID
);
             oidField.setText( temp + "." ); //$NON-NLS-1$
         }
         oidField.setLayoutData( gd );

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizardPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizardPage.java?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizardPage.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/java/org/apache/directory/ldapstudio/schemas/view/wizards/CreateANewObjectClassWizardPage.java
Tue Mar 27 01:47:45 2007
@@ -26,10 +26,8 @@
 import org.apache.directory.ldapstudio.schemas.PluginConstants;
 import org.apache.directory.ldapstudio.schemas.model.SchemaPool;
 import org.apache.directory.ldapstudio.schemas.view.ViewUtils;
-import org.apache.directory.ldapstudio.schemas.view.preferences.OidPreferencePage;
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
@@ -118,12 +116,12 @@
         {
             public void widgetSelected( SelectionEvent e )
             {
-                IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
+                IPreferenceStore store = Activator.getDefault().getPreferenceStore();
 
-                prefs.putBoolean( OidPreferencePage.AUTO_OID, autoOID.getSelection() );
+                store.setValue( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID, autoOID.getSelection()
);
                 if ( autoOID.getSelection() )
                 {
-                    String temp = prefs.get( OidPreferencePage.COMPANY_OID, "1.2.3.4.5.6"
); //$NON-NLS-1$
+                    String temp = store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID
);
                     oidField.setText( temp + "." ); //$NON-NLS-1$
                 }
                 else
@@ -133,9 +131,8 @@
             }
         } );
 
-        IEclipsePreferences prefs = new ConfigurationScope().getNode( Activator.PLUGIN_ID
);
-
-        boolean auto_oid = prefs.getBoolean( OidPreferencePage.AUTO_OID, true );
+        IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+        boolean auto_oid = store.getBoolean( PluginConstants.PREFS_SCHEMAS_EDITOR_AUTO_OID
);
         autoOID.setSelection( auto_oid );
 
         Label label = new Label( container, SWT.NULL );
@@ -143,7 +140,7 @@
         oidField = new Text( container, SWT.BORDER | SWT.SINGLE );
         if ( auto_oid )
         {
-            String temp = prefs.get( OidPreferencePage.COMPANY_OID, "1.2.3.4.5.6" ); //$NON-NLS-1$
+            String temp = store.getString( PluginConstants.PREFS_SCHEMAS_EDITOR_COMPANY_OID
);
             oidField.setText( temp + "." ); //$NON-NLS-1$
         }
         oidField.setLayoutData( gd );

Modified: directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/resources/org/apache/directory/ldapstudio/schemas/messages.properties
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/resources/org/apache/directory/ldapstudio/schemas/messages.properties?view=diff&rev=522812&r1=522811&r2=522812
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/resources/org/apache/directory/ldapstudio/schemas/messages.properties
(original)
+++ directory/ldapstudio/trunk/ldapstudio-schemas-plugin/src/main/resources/org/apache/directory/ldapstudio/schemas/messages.properties
Tue Mar 27 01:47:45 2007
@@ -195,7 +195,7 @@
 # SchemaPreferencePage  -  org.apache.directory.ldapstudio.schemas.view.preferences
 SchemaPreferencePage.Default_save-load_dialogs_directory=Default save/load dialogs directory:
 SchemaPreferencePage.Save_schemas_configuration_when_exiting_LDAP_Studio=Save schemas configuration
when exiting LDAP Studio
-SchemaPreferencePage.Use_specific_core_files=Use specific core files (if not selected, core
schemas are loaded from LDAPStudio's bundle)
+SchemaPreferencePage.Use_specific_core_schemas=Use specific core schemas
 SchemaPreferencePage.Core_schemas_directory=Core schemas directory:
 
 # SearchContentProvider  -  org.apache.directory.ldapstudio.schemas.view.viewers



Mime
View raw message