directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r609326 - in /directory/studio/trunk: studio-connection-core/ studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/ studio...
Date Sun, 06 Jan 2008 15:01:34 GMT
Author: seelmann
Date: Sun Jan  6 07:01:30 2008
New Revision: 609326

URL: http://svn.apache.org/viewvc?rev=609326&view=rev
Log:
Fix for DIRSTUDIO-119 (Allow user to disable the Modification logs windows)

Added:
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java
  (with props)
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java
  (with props)
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java
  (with props)
Modified:
    directory/studio/trunk/studio-connection-core/plugin.xml
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/ModificationLogsPreferencePage.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java

Modified: directory/studio/trunk/studio-connection-core/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/plugin.xml?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/plugin.xml (original)
+++ directory/studio/trunk/studio-connection-core/plugin.xml Sun Jan  6 07:01:30 2008
@@ -11,5 +11,11 @@
             name="LDIF Modification Logger">
       </jndiLogger>
    </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.apache.directory.studio.connection.core.ConnectionCorePreferencesInitializer">
+      </initializer>
+   </extension>
 
 </plugin>

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
(original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
Sun Jan  6 07:01:30 2008
@@ -35,4 +35,7 @@
     /** The date format of the modification logger */
     public static final String DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; //$NON-NLS-1$
 
+    /** The constant used to identify the "enable modification logs" preference  */
+    public static final String PREFERENCE_MODIFICATIONLOGS_ENABLE = "modificationLogsEnable";
+
 }

Added: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java?rev=609326&view=auto
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java
(added)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java
Sun Jan  6 07:01:30 2008
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.connection.core;
+
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+
+
+/**
+ * This class is used to set default preference values.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ConnectionCorePreferencesInitializer extends AbstractPreferenceInitializer
+{
+    /**
+     * {@inheritDoc}
+     */
+    public void initializeDefaultPreferences()
+    {
+        Preferences preferences = ConnectionCorePlugin.getDefault().getPluginPreferences();
+
+        // Modification Logs
+        preferences.setDefault( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE,
true );
+    }
+
+}

Propchange: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
(original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
Sun Jan  6 07:01:30 2008
@@ -49,6 +49,7 @@
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionManager;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.IJndiLogger;
@@ -221,6 +222,11 @@
     public void logChangetypeAdd( Connection connection, final String dn, final Attributes
attributes,
         final Control[] controls, NamingException ex )
     {
+        if (!isModificationLogEnabled())
+        {
+            return;
+        }
+
         try
         {
             LdifChangeAddRecord record = new LdifChangeAddRecord( LdifDnLine.create( dn )
);
@@ -262,6 +268,11 @@
     public void logChangetypeDelete( Connection connection, final String dn, final Control[]
controls,
         NamingException ex )
     {
+        if (!isModificationLogEnabled())
+        {
+            return;
+        }
+
         LdifChangeDeleteRecord record = new LdifChangeDeleteRecord( LdifDnLine.create( dn
) );
         addControlLines( record, controls );
         record.setChangeType( LdifChangeTypeLine.createDelete() );
@@ -278,6 +289,11 @@
     public void logChangetypeModify( Connection connection, final String dn,
         final ModificationItem[] modificationItems, final Control[] controls, NamingException
ex )
     {
+        if (!isModificationLogEnabled())
+        {
+            return;
+        }
+
         try
         {
             LdifChangeModifyRecord record = new LdifChangeModifyRecord( LdifDnLine.create(
dn ) );
@@ -336,6 +352,11 @@
     public void logChangetypeModDn( Connection connection, final String oldDn, final String
newDn,
         final boolean deleteOldRdn, final Control[] controls, NamingException ex )
     {
+        if (!isModificationLogEnabled())
+        {
+            return;
+        }
+
         try
         {
             LdapDN dn = new LdapDN( newDn );
@@ -451,6 +472,16 @@
         return null;
     }
 
+    /**
+     * Checks if modification log is enabled.
+     * 
+     * @return true, if modification log is enabled
+     */
+    private boolean isModificationLogEnabled()
+    {
+        return ConnectionCorePlugin.getDefault().getPluginPreferences()
+            .getBoolean( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE );
+    }
 
     public String getId()
     {

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
Sun Jan  6 07:01:30 2008
@@ -38,8 +38,6 @@
 
     public static final String PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS = "searchResultEditorShowLinks";
 
-    public static final String PREFERENCE_MODIFICATIONLOGS_ENABLE = "modificationLogsEnable";
-    
     public static final String PREFERENCEPAGEID_MAIN = "org.apache.directory.studio.ldapbrowser.preferences.MainPreferencePage";
 
     public static final String PREFERENCEPAGEID_ATTRIBUTES = "org.apache.directory.studio.ldapbrowser.preferences.AttributesPreferencePage";
@@ -51,6 +49,8 @@
     public static final String PREFERENCEPAGEID_ENTRYEDITOR = "org.apache.directory.studio.ldapbrowser.preferences.EntryEditorPreferencePage";
 
     public static final String PREFERENCEPAGEID_SEARCHRESULTEDITOR = "org.apache.directory.studio.ldapbrowser.preferences.SearchResultEditorPreferencePage";
+    
+    public static final String PREFERENCEPAGEID_MODIFICATIONLOGS = "org.apache.directory.studio.ldapbrowser.preferences.ModificationLogsPreferencePage";
 
     
     public static final String IMG_EXPANDALL = "resources/icons/expandall.gif";

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
Sun Jan  6 07:01:30 2008
@@ -38,7 +38,6 @@
      */
     public void initializeDefaultPreferences()
     {
-
         IPreferenceStore store = BrowserUIPlugin.getDefault().getPreferenceStore();
 
         // Browser
@@ -47,10 +46,6 @@
         // Search Result Editor
         store.setDefault( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN, true
);
         store.setDefault( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS, true
);
-
-        // Modification Logs
-        store.setDefault( BrowserUIConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE, true );
-
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/ModificationLogsPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/ModificationLogsPreferencePage.java?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/ModificationLogsPreferencePage.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/ModificationLogsPreferencePage.java
Sun Jan  6 07:01:30 2008
@@ -21,8 +21,9 @@
 package org.apache.directory.studio.ldapbrowser.ui.dialogs.preferences;
 
 
+import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
-import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.widgets.Button;
@@ -74,8 +75,8 @@
         BaseWidgetUtils.createSpacer( composite, 1 );
         BaseWidgetUtils.createSpacer( composite, 1 );
         enableModificationLogging = BaseWidgetUtils.createCheckbox( composite, "Enable modification
logs", 1 );
-        enableModificationLogging.setSelection( getPreferenceStore().getBoolean(
-            BrowserUIConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE ) );
+        enableModificationLogging.setSelection( ConnectionCorePlugin.getDefault().getPluginPreferences().getBoolean(
+            ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE ) );
 
         applyDialogFont( composite );
         return composite;
@@ -87,8 +88,8 @@
      */
     public boolean performOk()
     {
-        getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE,
-            enableModificationLogging.getSelection() );
+        ConnectionCorePlugin.getDefault().getPluginPreferences().setValue(
+            ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE, enableModificationLogging.getSelection()
);
         return true;
     }
 
@@ -98,8 +99,8 @@
      */
     protected void performDefaults()
     {
-        enableModificationLogging.setSelection( getPreferenceStore().getDefaultBoolean(
-            BrowserUIConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE ) );
+        enableModificationLogging.setSelection( ConnectionCorePlugin.getDefault().getPluginPreferences()
+            .getDefaultBoolean( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE
) );
         super.performDefaults();
     }
 

Added: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java?rev=609326&view=auto
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java
(added)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java
Sun Jan  6 07:01:30 2008
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs;
+
+
+import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
+import org.eclipse.jface.action.Action;
+
+
+/**
+ * This action is used to toggle the "enable modification logs" preference.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class EnableModificationLogsAction extends Action
+{
+
+    /**
+     * Creates a new instance of EnableModificationLogsAction.
+     */
+    public EnableModificationLogsAction()
+    {
+        super( "Enable Modification Logs", AS_CHECK_BOX );
+        setToolTipText( getText() );
+        setEnabled( true );
+        setChecked( ConnectionCorePlugin.getDefault().getPluginPreferences().getBoolean(
+            ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        ConnectionCorePlugin.getDefault().getPluginPreferences().setValue(
+            ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE, super.isChecked()
);
+    }
+
+}

Propchange: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java?rev=609326&r1=609325&r2=609326&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewActionGroup.java
Sun Jan  6 07:01:30 2008
@@ -24,6 +24,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
 import org.apache.directory.studio.ldapbrowser.ui.actions.proxy.ModificationLogsViewActionProxy;
 import org.eclipse.jface.action.IAction;
@@ -58,6 +60,12 @@
     /** The Constant refreshAction. */
     private static final String clearAction = "clearAction";
 
+    /** The enable modification logs action. */
+    private EnableModificationLogsAction enableModificationLogsAction;
+
+    /** The open modification logs preference page action. */
+    private OpenModificationLogsPreferencePageAction openModificationLogsPreferencePageAction;
+
     /** The modification logs view action map. */
     private Map<String, ModificationLogsViewActionProxy> modificationLogsViewActionMap;
 
@@ -81,6 +89,8 @@
             new RefreshAction( view ) ) );
         modificationLogsViewActionMap.put( clearAction, new ModificationLogsViewActionProxy(
viewer, this,
             new ClearAction( view ) ) );
+        enableModificationLogsAction = new EnableModificationLogsAction();
+        openModificationLogsPreferencePageAction = new OpenModificationLogsPreferencePageAction();
     }
 
 
@@ -99,6 +109,9 @@
             modificationLogsViewActionMap.clear();
             modificationLogsViewActionMap = null;
 
+            enableModificationLogsAction = null;
+            openModificationLogsPreferencePageAction = null;
+
             view = null;
         }
     }
@@ -117,6 +130,19 @@
         actionBars.getToolBarManager().add( new Separator() );
         actionBars.getToolBarManager().add( ( IAction ) modificationLogsViewActionMap.get(
olderAction ) );
         actionBars.getToolBarManager().add( ( IAction ) modificationLogsViewActionMap.get(
newerAction ) );
+
+        // Menu Bar
+        actionBars.getMenuManager().add( enableModificationLogsAction );
+        actionBars.getMenuManager().add( new Separator() );
+        actionBars.getMenuManager().add( openModificationLogsPreferencePageAction );
+        actionBars.getMenuManager().addMenuListener( new IMenuListener()
+        {
+            public void menuAboutToShow( IMenuManager manager )
+            {
+                enableModificationLogsAction.setChecked( ConnectionCorePlugin.getDefault().getPluginPreferences()
+                    .getBoolean( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE
) );
+            }
+        } );
     }
 
 

Added: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java?rev=609326&view=auto
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java
(added)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java
Sun Jan  6 07:01:30 2008
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs;
+
+
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+
+/**
+ * This action opens the prefence page of the modification logs view.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenModificationLogsPreferencePageAction extends Action
+{
+
+    /**
+     * Creates a new instance of OpenEntryEditorPreferencePageAction.
+     */
+    public OpenModificationLogsPreferencePageAction()
+    {
+        setText( "Preferences..." );
+        setToolTipText( "Preferences..." );
+        setEnabled( true );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        Shell shell = Display.getCurrent().getActiveShell();
+        String mlPageId = BrowserUIConstants.PREFERENCEPAGEID_MODIFICATIONLOGS;
+        PreferencesUtil.createPreferenceDialogOn( shell, mlPageId, new String[]
+            { mlPageId }, null ).open();
+    }
+
+}

Propchange: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message