directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1227235 - in /directory/studio/trunk/plugins/ldapservers: resources/ src/main/java/org/apache/directory/studio/ldapservers/ src/main/java/org/apache/directory/studio/ldapservers/model/ src/main/java/org/apache/directory/studio/ldapservers/...
Date Wed, 04 Jan 2012 17:45:46 GMT
Author: pamarcelot
Date: Wed Jan  4 17:45:45 2012
New Revision: 1227235

URL: http://svn.apache.org/viewvc?rev=1227235&view=rev
Log:
Added a new configuration element to specify the state of the 'Open Configuration' action.

Modified:
    directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java

Modified: directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd?rev=1227235&r1=1227234&r2=1227235&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd (original)
+++ directory/studio/trunk/plugins/ldapservers/resources/ldapServerAdapters.exsd Wed Jan 
4 17:45:45 2012
@@ -107,13 +107,20 @@
          <attribute name="configurationPage" type="string">
             <annotation>
                <documentation>
-                  
+                  The configuration page class
                </documentation>
                <appInfo>
                   <meta.attribute kind="java" basedOn=":org.apache.directory.studio.ldapservers.model.LdapServerAdapterConfigurationPage"/>
                </appInfo>
             </annotation>
          </attribute>
+         <attribute name="openConfigurationActionEnabled" type="boolean" use="default"
value="true">
+            <annotation>
+               <documentation>
+                  The flag to enable the open configuration action
+               </documentation>
+            </annotation>
+         </attribute>
       </complexType>
    </element>
 

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java?rev=1227235&r1=1227234&r2=1227235&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java
(original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServerAdapterExtensionsManager.java
Wed Jan  4 17:45:45 2012
@@ -52,6 +52,7 @@ public class LdapServerAdapterExtensions
     public static final String DESCRIPTION_ATTR = "description"; //$NON-NLS-1$
     public static final String ICON_ATTR = "icon"; //$NON-NLS-1$
     public static final String CONFIGURATION_PAGE_ATTR = "configurationPage"; //$NON-NLS-1$
+    public static final String OPEN_CONFIGURATION_ACTION_ENABLED_ATTR = "openConfigurationActionEnabled";
//$NON-NLS-1$
 
     /** The default instance */
     private static LdapServerAdapterExtensionsManager instance;
@@ -122,6 +123,16 @@ public class LdapServerAdapterExtensions
                 ldapServerAdapterExtension.setIcon( icon );
             }
             ldapServerAdapterExtension.setConfigurationPageClassName( member.getAttribute(
CONFIGURATION_PAGE_ATTR ) );
+            String openConfigurationActionEnabled = member.getAttribute( OPEN_CONFIGURATION_ACTION_ENABLED_ATTR
);
+            if ( openConfigurationActionEnabled != null )
+            {
+                ldapServerAdapterExtension.setOpenConfigurationActionEnabled( Boolean.parseBoolean(
openConfigurationActionEnabled ) );
+            }
+            else
+            {
+                // Enabled by default
+                ldapServerAdapterExtension.setOpenConfigurationActionEnabled( true );
+            }
 
             ldapServerAdapterExtensionsList.add( ldapServerAdapterExtension );
             ldapServerAdapterExtensionsByIdMap.put( ldapServerAdapterExtension.getId(), ldapServerAdapterExtension
);

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java?rev=1227235&r1=1227234&r2=1227235&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java
(original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapterExtension.java
Wed Jan  4 17:45:45 2012
@@ -64,6 +64,9 @@ public class LdapServerAdapterExtension
 
     /** The configuration page class name */
     private String configurationPageClassName;
+    
+    /** The flag to enable the open configuration action */
+    private boolean openConfigurationActionEnabled;
 
 
     /**
@@ -91,26 +94,6 @@ public class LdapServerAdapterExtension
 
 
     /**
-     * Gets a new configuration page instance.
-     *
-     * @return
-     *      a new configuration page instance
-     */
-    public LdapServerAdapterConfigurationPage getNewConfigurationPageInstance()
-    {
-        try
-        {
-            return ( LdapServerAdapterConfigurationPage ) extensionPointConfiguration
-                .createExecutableExtension( LdapServerAdapterExtensionsManager.CONFIGURATION_PAGE_ATTR
);
-        }
-        catch ( CoreException e )
-        {
-            return null;
-        }
-    }
-
-
-    /**
      * Gets the description.
      *
      * @return
@@ -183,6 +166,26 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Gets a new configuration page instance.
+     *
+     * @return
+     *      a new configuration page instance
+     */
+    public LdapServerAdapterConfigurationPage getNewConfigurationPageInstance()
+    {
+        try
+        {
+            return ( LdapServerAdapterConfigurationPage ) extensionPointConfiguration
+                .createExecutableExtension( LdapServerAdapterExtensionsManager.CONFIGURATION_PAGE_ATTR
);
+        }
+        catch ( CoreException e )
+        {
+            return null;
+        }
+    }
+
+
+    /**
      * Gets the vendor.
      *
      * @return
@@ -207,6 +210,17 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Returns the flag to enable the open configuration action.
+     * 
+     * @return the flag to enable the open configuration action
+     */
+    public boolean isOpenConfigurationActionEnabled()
+    {
+        return openConfigurationActionEnabled;
+    }
+
+
+    /**
      * Sets the class name.
      *
      * @param className
@@ -303,6 +317,17 @@ public class LdapServerAdapterExtension
 
 
     /**
+     * Sets the flag to enable the open configuration action.
+     * 
+     * @param openConfigurationActionEnabled the flag to enable the open configuration action
+     */
+    public void setOpenConfigurationActionEnabled( boolean openConfigurationActionEnabled
)
+    {
+        this.openConfigurationActionEnabled = openConfigurationActionEnabled;
+    }
+
+
+    /**
      * Sets the vendor.
      *
      * @param vendor

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java?rev=1227235&r1=1227234&r2=1227235&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
(original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
Wed Jan  4 17:45:45 2012
@@ -99,7 +99,6 @@ public class ServersView extends ViewPar
     private RenameAction rename;
     private StartAction start;
     private StopAction stop;
-    //    private CreateConnectionAction createConnection;
     private PropertiesAction properties;
 
     // Listeners
@@ -264,9 +263,6 @@ public class ServersView extends ViewPar
         stop = new StopAction( this );
         stop.setEnabled( false );
 
-        //        createConnection = new CreateConnectionAction( this );
-        //        createConnection.setEnabled( false );
-
         properties = new PropertiesAction( this );
         properties.setEnabled( false );
     }
@@ -307,9 +303,6 @@ public class ServersView extends ViewPar
                 manager.add( start );
                 manager.add( stop );
                 manager.add( new Separator() );
-                //                MenuManager ldapBrowserManager = new MenuManager( Messages.getString(
"ServersView.ldapBrowser" ) ); //$NON-NLS-1$
-                //                ldapBrowserManager.add( createConnection );
-                //                manager.add( ldapBrowserManager );
                 manager.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
                 manager.add( new Separator() );
                 manager.add( new Separator() );
@@ -484,20 +477,18 @@ public class ServersView extends ViewPar
                     break;
             }
 
-            //            openConfiguration.setEnabled( true );
+            openConfiguration.setEnabled( server.getLdapServerAdapterExtension().isOpenConfigurationActionEnabled()
);
             delete.setEnabled( true );
             rename.setEnabled( true );
-            //            createConnection.setEnabled( true );
             properties.setEnabled( true );
         }
         else
         {
-            //            openConfiguration.setEnabled( false );
+            openConfiguration.setEnabled( false );
             delete.setEnabled( false );
             rename.setEnabled( false );
             start.setEnabled( false );
             stop.setEnabled( false );
-            //            createConnection.setEnabled( false );
             properties.setEnabled( false );
         }
     }



Mime
View raw message