A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / folding / JavaFoldingStructureProviderRegistry.java
index 3c2a176..99f7f2f 100644 (file)
@@ -27,21 +27,22 @@ import org.eclipse.core.runtime.Platform;
  * @since 3.0
  */
 public class JavaFoldingStructureProviderRegistry {
-       
-       private static final String EXTENSION_POINT= "foldingStructureProviders"; //$NON-NLS-1$
-       
+
+       private static final String EXTENSION_POINT = "foldingStructureProviders"; //$NON-NLS-1$
+
        /** The map of descriptors, indexed by their identifiers. */
        private Map fDescriptors;
 
        /**
-        * Creates a new instance. 
+        * Creates a new instance.
         */
        public JavaFoldingStructureProviderRegistry() {
        }
-       
+
        /**
-        * Returns an array of <code>IJavaFoldingProviderDescriptor</code> describing
-        * all extension to the <code>foldingProviders</code> extension point.
+        * Returns an array of <code>IJavaFoldingProviderDescriptor</code>
+        * describing all extension to the <code>foldingProviders</code> extension
+        * point.
         * 
         * @return the list of extensions to the
         *         <code>quickDiffReferenceProvider</code> extension point.
@@ -49,25 +50,32 @@ public class JavaFoldingStructureProviderRegistry {
        public JavaFoldingStructureProviderDescriptor[] getFoldingProviderDescriptors() {
                synchronized (this) {
                        ensureRegistered();
-                       return (JavaFoldingStructureProviderDescriptor[]) fDescriptors.values().toArray(new JavaFoldingStructureProviderDescriptor[fDescriptors.size()]);
+                       return (JavaFoldingStructureProviderDescriptor[]) fDescriptors
+                                       .values()
+                                       .toArray(
+                                                       new JavaFoldingStructureProviderDescriptor[fDescriptors
+                                                                       .size()]);
                }
        }
-       
+
        /**
         * Returns the folding provider with identifier <code>id</code> or
         * <code>null</code> if no such provider is registered.
         * 
-        * @param id the identifier for which a provider is wanted
+        * @param id
+        *            the identifier for which a provider is wanted
         * @return the corresponding provider, or <code>null</code> if none can be
         *         found
         */
-       public JavaFoldingStructureProviderDescriptor getFoldingProviderDescriptor(String id) {
+       public JavaFoldingStructureProviderDescriptor getFoldingProviderDescriptor(
+                       String id) {
                synchronized (this) {
                        ensureRegistered();
-                       return (JavaFoldingStructureProviderDescriptor) fDescriptors.get(id);
+                       return (JavaFoldingStructureProviderDescriptor) fDescriptors
+                                       .get(id);
                }
        }
-       
+
        /**
         * Instantiates and returns the provider that is currently configured in the
         * preferences.
@@ -75,18 +83,19 @@ public class JavaFoldingStructureProviderRegistry {
         * @return the current provider according to the preferences
         */
        public IJavaFoldingStructureProvider getCurrentFoldingProvider() {
-               String id= PHPeclipsePlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER);
-               JavaFoldingStructureProviderDescriptor desc= getFoldingProviderDescriptor(id);
+               String id = PHPeclipsePlugin.getDefault().getPreferenceStore()
+                               .getString(PreferenceConstants.EDITOR_FOLDING_PROVIDER);
+               JavaFoldingStructureProviderDescriptor desc = getFoldingProviderDescriptor(id);
                if (desc != null) {
                        try {
                                return desc.createProvider();
                        } catch (CoreException e) {
-                         PHPeclipsePlugin.log(e);
+                               PHPeclipsePlugin.log(e);
                        }
                }
                return null;
        }
-       
+
        /**
         * Ensures that the extensions are read and stored in
         * <code>fDescriptors</code>.
@@ -99,22 +108,25 @@ public class JavaFoldingStructureProviderRegistry {
        /**
         * Reads all extensions.
         * <p>
-        * This method can be called more than once in
-        * order to reload from a changed extension registry.
+        * This method can be called more than once in order to reload from a
+        * changed extension registry.
         * </p>
         */
        public void reloadExtensions() {
-               IExtensionRegistry registry= Platform.getExtensionRegistry();
-               Map map= new HashMap();
+               IExtensionRegistry registry = Platform.getExtensionRegistry();
+               Map map = new HashMap();
 
-               IConfigurationElement[] elements= registry.getConfigurationElementsFor(PHPeclipsePlugin.getPluginId(), EXTENSION_POINT);
-               for (int i= 0; i < elements.length; i++) {
-                       JavaFoldingStructureProviderDescriptor desc= new JavaFoldingStructureProviderDescriptor(elements[i]);
+               IConfigurationElement[] elements = registry
+                               .getConfigurationElementsFor(PHPeclipsePlugin.getPluginId(),
+                                               EXTENSION_POINT);
+               for (int i = 0; i < elements.length; i++) {
+                       JavaFoldingStructureProviderDescriptor desc = new JavaFoldingStructureProviderDescriptor(
+                                       elements[i]);
                        map.put(desc.getId(), desc);
                }
-               
-               synchronized(this) {
-                       fDescriptors= Collections.unmodifiableMap(map);
+
+               synchronized (this) {
+                       fDescriptors = Collections.unmodifiableMap(map);
                }
        }