directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r592087 [3/16] - in /directory/sandbox/felixk/studio-ldapbrowser-ui: ./ META-INF/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/studio/ src/...
Date Mon, 05 Nov 2007 17:01:46 GMT
Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateEntryInDitAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateEntryInDitAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateEntryInDitAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateEntryInDitAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,116 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+
+/**
+ * This action is used within the browser view to locate and open the selected 
+ * search result or bookmark in DIT.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LocateEntryInDitAction extends LocateInDitAction
+{
+
+    /**
+     * Creates a new instance of LocateEntryInDitAction.
+     */
+    public LocateEntryInDitAction()
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        if ( getSelectedSearchResults().length == 1
+            && getSelectedBookmarks().length + getSelectedEntries().length + getSelectedBrowserViewCategories().length == 0 )
+        {
+            return "Open Search Result in DIT";
+        }
+        else if ( getSelectedBookmarks().length == 1
+            && getSelectedSearchResults().length + getSelectedEntries().length
+                + getSelectedBrowserViewCategories().length == 0 )
+        {
+            return "Open Bookmark in DIT";
+        }
+        else
+        {
+            return "Open Entry in DIT";
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        if ( getSelectedSearchResults().length == 1
+            && getSelectedBookmarks().length + getSelectedEntries().length + getSelectedBrowserViewCategories().length == 0 )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_LOCATE_SEARCHRESULT_IN_DIT );
+        }
+        else if ( getSelectedBookmarks().length == 1
+            && getSelectedSearchResults().length + getSelectedEntries().length
+                + getSelectedBrowserViewCategories().length == 0 )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_LOCATE_BOOKMARK_IN_DIT );
+        }
+        else
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_LOCATE_ENTRY_IN_DIT );
+        }
+    }
+
+
+    /**
+     * This implementation returns a connection and DN if the a search result or bookmark
+     * is selected.
+     */
+    protected ConnectionAndDn getConnectionAndDn()
+    {
+        if ( getSelectedSearchResults().length == 1
+            && getSelectedBookmarks().length + getSelectedEntries().length + getSelectedBrowserViewCategories().length == 0 )
+        {
+            return new ConnectionAndDn( getSelectedSearchResults()[0].getEntry().getBrowserConnection(),
+                getSelectedSearchResults()[0].getEntry().getDn() );
+        }
+        else if ( getSelectedBookmarks().length == 1
+            && getSelectedSearchResults().length + getSelectedEntries().length
+                + getSelectedBrowserViewCategories().length == 0 )
+        {
+            return new ConnectionAndDn( getSelectedBookmarks()[0].getBrowserConnection(), getSelectedBookmarks()[0].getDn() );
+        }
+        else
+        {
+            return null;
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateEntryInDitAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,143 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This action is used to locate and open an entry by its DN in DIT.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class LocateInDitAction extends BrowserAction
+{
+    /**
+     * {@inheritDoc}
+     */
+    public final void run()
+    {
+        ConnectionAndDn connectionAndDn = getConnectionAndDn();
+        if ( connectionAndDn != null )
+        {
+            IBrowserConnection connection = connectionAndDn.connection;
+            LdapDN dn = connectionAndDn.dn;
+
+            IEntry entry = connection.getEntryFromCache( dn );
+            if ( entry == null )
+            {
+                ReadEntryJob job = new ReadEntryJob( connection, dn );
+                RunnableContextJobAdapter.execute( job );
+                entry = job.getReadEntry();
+            }
+
+            if ( entry != null )
+            {
+                String targetId = BrowserView.getId();
+                IViewPart targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(
+                    targetId );
+                if ( targetView == null )
+                {
+                    try
+                    {
+                        targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
+                            targetId, null, IWorkbenchPage.VIEW_ACTIVATE );
+                    }
+                    catch ( PartInitException e )
+                    {
+                    }
+                }
+                if ( targetView != null && targetView instanceof BrowserView )
+                {
+                    ( ( BrowserView ) targetView ).select( entry );
+                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate( targetView );
+                }
+            }
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return "org.apache.directory.studio.ldapbrowser.action.locateInDit";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public final boolean isEnabled()
+    {
+        return getConnectionAndDn() != null;
+    }
+
+
+    /**
+     * Get the connection and DN to open.
+     * 
+     * @return a ConnectionAndDn bean, or null.
+     */
+    protected abstract ConnectionAndDn getConnectionAndDn();
+
+    
+    /**
+     * Inner class to get connection and DN of the entry to locate.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    protected class ConnectionAndDn
+    {
+        /** The connection */
+        private IBrowserConnection connection;
+
+        /** The DN */
+        private LdapDN dn;
+
+
+        /**
+         * Creates a new instance of ConnectionAndDn.
+         *
+         * @param connection the connection
+         * @param dn the DN
+         */
+        protected ConnectionAndDn( IBrowserConnection connection, LdapDN dn )
+        {
+            this.connection = connection;
+            this.dn = dn;
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,249 @@
+/*
+ *  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.actions;
+
+
+import java.util.LinkedHashSet;
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.MoveEntriesDialog;
+import org.apache.directory.studio.ldapbrowser.core.jobs.MoveEntriesJob;
+import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.RootDSE;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
+
+
+/**
+ * This Action moves Entries from on node of the Tree to another.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class MoveAction extends BrowserAction
+{
+    /**
+     * Creates a new instance of MoveAction.
+     */
+    public MoveAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+
+        IEntry[] entries = getEntries();
+        ISearch[] searches = getSearches();
+        IBookmark[] bookmarks = getBookmarks();
+
+        if ( entries.length > 0 && searches.length == 0 && bookmarks.length == 0 )
+        {
+            return entries.length == 1 ? "Move Entry..." : "Move Entries...";
+        }
+        // else if(searches.length > 0 && entries.length==0 &&
+        // bookmarks.length==0) {
+        // return entries.length == 1 ? "Move Search..." : "Move Searches...";
+        // }
+        // else if(bookmarks.length > 0 && entries.length==0 &&
+        // searches.length==0) {
+        // return entries.length == 1 ? "Move Bookmark..." : "Move
+        // Bookmarks...";
+        // }
+        else
+        {
+            return "Move...";
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return IWorkbenchActionDefinitionIds.MOVE;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+
+        IEntry[] entries = getEntries();
+        ISearch[] searches = getSearches();
+        IBookmark[] bookmarks = getBookmarks();
+
+        if ( entries.length > 0 && searches.length == 0 && bookmarks.length == 0 )
+        {
+            moveEntries( entries );
+        }
+        else if ( searches.length > 0 && entries.length == 0 && bookmarks.length == 0 )
+        {
+            // tbd
+        }
+        else if ( bookmarks.length > 0 && entries.length == 0 && searches.length == 0 )
+        {
+            // tbd
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+
+        try
+        {
+            IEntry[] entries = getEntries();
+            ISearch[] searches = getSearches();
+            IBookmark[] bookmarks = getBookmarks();
+
+            return entries.length > 0 && searches.length == 0 && bookmarks.length == 0;
+
+        }
+        catch ( Exception e )
+        {
+            return false;
+        }
+    }
+
+
+    /**
+     * Gets the Entries.
+     *
+     * @return
+     *      the Entries
+     */
+    protected IEntry[] getEntries()
+    {
+        if ( getSelectedBookmarks().length + getSelectedSearches().length
+            + getSelectedAttributes().length + getSelectedValues().length == 0
+            && getSelectedEntries().length + getSelectedSearchResults().length > 0 )
+        {
+            LinkedHashSet<IEntry> entriesSet = new LinkedHashSet<IEntry>();
+            for ( int i = 0; i < getSelectedEntries().length; i++ )
+            {
+                entriesSet.add( getSelectedEntries()[i] );
+            }
+            for ( int i = 0; i < this.getSelectedSearchResults().length; i++ )
+            {
+                entriesSet.add( this.getSelectedSearchResults()[i].getEntry() );
+            }
+            IEntry[] entries = ( IEntry[] ) entriesSet.toArray( new IEntry[entriesSet.size()] );
+            for ( int i = 0; i < entries.length; i++ )
+            {
+                if ( entries[i] == null || entries[i] instanceof RootDSE )
+                {
+                    return new IEntry[0];
+                }
+            }
+            return entries;
+        }
+        else
+        {
+            return new IEntry[0];
+        }
+    }
+
+
+    /**
+     * Opens a Move Entries Dialog and lauches the Move Entries Jobs.
+     *
+     * @param entries
+     *      the entries to move
+     */
+    protected void moveEntries( final IEntry[] entries )
+    {
+        MoveEntriesDialog moveDialog = new MoveEntriesDialog( getShell(), entries );
+        if ( moveDialog.open() == Dialog.OK )
+        {
+            LdapDN newParentDn = moveDialog.getParentDn();
+            if ( newParentDn != null /* && !newRdn.equals(entry.getRdn()) */)
+            {
+                IEntry newParentEntry = entries[0].getBrowserConnection().getEntryFromCache( newParentDn );
+                if ( newParentEntry != null )
+                {
+                    new MoveEntriesJob( entries, newParentEntry ).execute();
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Gets the searches.
+     *
+     * @return
+     *      the searches
+     */
+    protected ISearch[] getSearches()
+    {
+        if ( getSelectedSearches().length == 1 )
+        {
+            return getSelectedSearches();
+        }
+        else
+        {
+            return new ISearch[0];
+        }
+    }
+
+
+    /**
+     * Gets the Bookmarks
+     *
+     * @return
+     *      the Bookmarks
+     */
+    protected IBookmark[] getBookmarks()
+    {
+        if ( getSelectedBookmarks().length == 1 )
+        {
+            return getSelectedBookmarks();
+        }
+        else
+        {
+            return new IBookmark[0];
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBatchOperationAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBatchOperationAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBatchOperationAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBatchOperationAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,99 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.wizards.BatchOperationWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.WizardDialog;
+
+
+/**
+ * This Action opens the New Batch Operation Dialog.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class NewBatchOperationAction extends BrowserAction
+{
+
+    /**
+     * Creates a new instance of NewBatchOperationAction.
+     */
+    public NewBatchOperationAction()
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "New Batch Operation...";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_BATCH );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return getSelectedSearches().length == 1
+            && getSelectedSearches()[0].getSearchResults() != null
+            || getSelectedEntries().length + getSelectedSearchResults().length + getSelectedBookmarks().length
+                + getSelectedAttributes().length + getSelectedValues().length > 0;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        BatchOperationWizard wizard = new BatchOperationWizard();
+        WizardDialog dialog = new WizardDialog( getShell(), wizard );
+        dialog.setBlockOnOpen( true );
+        dialog.create();
+        dialog.open();
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBatchOperationAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBookmarkAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBookmarkAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBookmarkAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBookmarkAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,100 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.wizards.NewBookmarkWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This Action creates a new Bookmark.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class NewBookmarkAction extends BrowserAction
+{
+    /**
+     * Creates a new instance of NewBookmarkAction.
+     */
+    public NewBookmarkAction()
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        NewBookmarkWizard wizard = new NewBookmarkWizard();
+        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+        wizard.init( window.getWorkbench(), ( IStructuredSelection ) window.getSelectionService().getSelection() );
+        WizardDialog dialog = new WizardDialog( getShell(), wizard );
+        dialog.setBlockOnOpen( true );
+        dialog.create();
+        dialog.open();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "New Bookmark...";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_BOOKMARK_ADD );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return true;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewBookmarkAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,136 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.wizards.NewEntryWizard;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+
+
+/**
+ * This Action lauches the New Entry Wizard.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class NewEntryAction extends BrowserAction
+{
+    private IWorkbenchWindow window;
+
+
+    /**
+     * Creates a new instance of NewEntryAction.
+     */
+    public NewEntryAction()
+    {
+    }
+
+
+    /**
+     * Creates a new instance of NewEntryAction.
+     *
+     * @param window
+     *      the associated Window
+     */
+    public NewEntryAction( IWorkbenchWindow window )
+    {
+        super();
+        this.window = window;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void dispose()
+    {
+        super.dispose();
+        this.window = null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void init( IWorkbenchWindow window )
+    {
+        super.init( window );
+        this.window = window;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        NewEntryWizard wizard = new NewEntryWizard();
+
+        wizard.init( this.window.getWorkbench(), ( IStructuredSelection ) this.window.getSelectionService()
+            .getSelection() );
+        WizardDialog dialog = new WizardDialog( getShell(), wizard );
+        dialog.setBlockOnOpen( true );
+        dialog.create();
+        dialog.open();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "New Entry...";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_ENTRY_ADD );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return true;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewLdifFileAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewLdifFileAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewLdifFileAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewLdifFileAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,106 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.studio.ldifeditor.LdifEditorConstants;
+import org.apache.directory.studio.ldifeditor.editor.LdifEditor;
+import org.apache.directory.studio.ldifeditor.editor.NonExistingLdifEditorInput;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This Action launches a new empty LDIF Editor. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class NewLdifFileAction extends BrowserAction
+{
+    /**
+     * Creates a new instance of NewLdifFileAction.
+     *
+     */
+    public NewLdifFileAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        IEditorInput input = new NonExistingLdifEditorInput();
+        String editorId = LdifEditor.getId();
+        try
+        {
+            IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+            page.openEditor( input, editorId );
+        }
+        catch ( PartInitException e )
+        {
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "New LDIF File";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return LdifEditorActivator.getDefault().getImageDescriptor( LdifEditorConstants.IMG_LDIFEDITOR_NEW );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return true;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewLdifFileAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewSearchAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewSearchAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewSearchAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewSearchAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,93 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.search.SearchPage;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This Action opens a new Search Dialog.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class NewSearchAction extends BrowserAction
+{
+    /**
+     * Creates a new instance of NewSearchAction.
+     */
+    public NewSearchAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        NewSearchUI.openSearchDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow(), SearchPage.getId() );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "New Search...";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_SEARCH_NEW );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return "org.eclipse.search.ui.openSearchDialog";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return true;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewSearchAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenEncoderDecoderDialogAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenEncoderDecoderDialogAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenEncoderDecoderDialogAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenEncoderDecoderDialogAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,91 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.ui.dialogs.EncoderDecoderDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This Action opens the Encoder/Decoder Dialog.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenEncoderDecoderDialogAction extends BrowserAction
+{
+    /**
+     * Creates a new instance of OpenEncoderDecoderDialogAction.
+     */
+    public OpenEncoderDecoderDialogAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        EncoderDecoderDialog dlg = new EncoderDecoderDialog( PlatformUI.getWorkbench().getDisplay().getActiveShell() );
+        dlg.open();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "Open Encoder/Decoder";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return true;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenEncoderDecoderDialogAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSchemaBrowserAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSchemaBrowserAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSchemaBrowserAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSchemaBrowserAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,464 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.LdapSyntaxDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.MatchingRuleDescription;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.editors.schemabrowser.SchemaBrowserManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+
+/**
+ * This Action opens the Schema Browser 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenSchemaBrowserAction extends BrowserAction
+{
+    /**
+     * None Mode
+     */
+    public static final int MODE_NONE = 0;
+
+    /**
+     * Object Class Mode
+     */
+    public static final int MODE_OBJECTCLASS = 10;
+
+    /**
+     * Attribute Type Mode
+     */
+    public static final int MODE_ATTRIBUTETYPE = 20;
+
+    /**
+     * Equality Matching Rule Mode
+     */
+    public static final int MODE_EQUALITYMATCHINGRULE = 30;
+
+    /**
+     * Substring Matching Rule Mode
+     */
+    public static final int MODE_SUBSTRINGMATCHINGRULE = 31;
+
+    /**
+     * Ordering Matching Rule Mode
+     */
+    public static final int MODE_ORDERINGMATCHINGRULE = 32;
+
+    /**
+     * Syntax Mode
+     */
+    public static final int MODE_SYNTAX = 40;
+
+    protected int mode;
+
+
+    /**
+     * Creates a new instance of OpenSchemaBrowserAction.
+     */
+    public OpenSchemaBrowserAction()
+    {
+        super();
+        this.mode = MODE_NONE;
+    }
+
+
+    /**
+     * Creates a new instance of OpenSchemaBrowserAction.
+     *
+     * @param mode
+     *      the display mode
+     */
+    public OpenSchemaBrowserAction( int mode )
+    {
+        super();
+        this.mode = mode;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        if ( mode == MODE_NONE )
+        {
+            SchemaBrowserManager.setInput( getConnection(), null );
+        }
+        else if ( mode == MODE_OBJECTCLASS )
+        {
+            SchemaBrowserManager.setInput( getConnection(), getOcd() );
+        }
+        else if ( mode == MODE_ATTRIBUTETYPE )
+        {
+            SchemaBrowserManager.setInput( getConnection(), getAtd() );
+        }
+        else if ( mode == MODE_EQUALITYMATCHINGRULE )
+        {
+            SchemaBrowserManager.setInput( getConnection(), getEmrd() );
+        }
+        else if ( mode == MODE_SUBSTRINGMATCHINGRULE )
+        {
+            SchemaBrowserManager.setInput( getConnection(), getSmrd() );
+        }
+        else if ( mode == MODE_ORDERINGMATCHINGRULE )
+        {
+            SchemaBrowserManager.setInput( getConnection(), getOmrd() );
+        }
+        else if ( mode == MODE_SYNTAX )
+        {
+            SchemaBrowserManager.setInput( getConnection(), getLsd() );
+        }
+        else
+        {
+            SchemaBrowserManager.setInput( getConnection(), null );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        if ( mode == MODE_NONE )
+        {
+            return "Open Schema Browser";
+        }
+        else if ( mode == MODE_OBJECTCLASS )
+        {
+            return "Object Class Description";
+        }
+        else if ( mode == MODE_ATTRIBUTETYPE )
+        {
+            return "Attribute Type Description";
+        }
+        else if ( mode == MODE_EQUALITYMATCHINGRULE )
+        {
+            return "Equality Matching Rule Description";
+        }
+        else if ( mode == MODE_SUBSTRINGMATCHINGRULE )
+        {
+            return "Substring Matching Rule Description";
+        }
+        else if ( mode == MODE_ORDERINGMATCHINGRULE )
+        {
+            return "Ordering Matching Rule Description";
+        }
+        else if ( mode == MODE_SYNTAX )
+        {
+            return "Syntax Description";
+        }
+        else
+        {
+            return "Open Schema Browser";
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        if ( mode == MODE_NONE )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
+        }
+        else if ( mode == MODE_OBJECTCLASS )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OCD );
+        }
+        else if ( mode == MODE_ATTRIBUTETYPE )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_ATD );
+        }
+        else if ( mode == MODE_EQUALITYMATCHINGRULE )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_MRD_EQUALITY );
+        }
+        else if ( mode == MODE_SUBSTRINGMATCHINGRULE )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_MRD_SUBSTRING );
+        }
+        else if ( mode == MODE_ORDERINGMATCHINGRULE )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_MRD_ORDERING );
+        }
+        else if ( mode == MODE_SYNTAX )
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_LSD );
+        }
+        else
+        {
+            return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_BROWSER_SCHEMABROWSEREDITOR );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+
+        if ( mode == MODE_NONE )
+        {
+            return getConnection() != null;
+        }
+        else if ( mode == MODE_OBJECTCLASS )
+        {
+            return getOcd() != null;
+        }
+        else if ( mode == MODE_ATTRIBUTETYPE )
+        {
+            return getAtd() != null;
+        }
+        else if ( mode == MODE_EQUALITYMATCHINGRULE )
+        {
+            return getEmrd() != null;
+        }
+        else if ( mode == MODE_SUBSTRINGMATCHINGRULE )
+        {
+            return getSmrd() != null;
+        }
+        else if ( mode == MODE_ORDERINGMATCHINGRULE )
+        {
+            return getOmrd() != null;
+        }
+        else if ( mode == MODE_SYNTAX )
+        {
+            return getLsd() != null;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+
+    /**
+     * Gets the LDAP Syntax Description.
+     *
+     * @return
+     *      the LDAP Syntax Description
+     */
+    private LdapSyntaxDescription getLsd()
+    {
+        AttributeTypeDescription atd = getAtd();
+
+        if ( atd != null && atd.getSyntaxDescriptionNumericOIDTransitive() != null
+            && atd.getSchema().hasLdapSyntaxDescription( atd.getSyntaxDescriptionNumericOIDTransitive() ) )
+        {
+            return atd.getSchema().getLdapSyntaxDescription( atd.getSyntaxDescriptionNumericOIDTransitive() );
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Gets the Object Class Description.
+     *
+     * @return
+     *      the Object Class Drescription
+     */
+    private ObjectClassDescription getOcd()
+    {
+        if ( getSelectedAttributes().length == 0 && getSelectedValues().length == 1
+            && getSelectedValues()[0].getAttribute().isObjectClassAttribute() )
+        {
+            String ocdName = getSelectedValues()[0].getStringValue();
+            if ( ocdName != null
+                && getSelectedValues()[0].getAttribute().getEntry().getBrowserConnection().getSchema()
+                    .hasObjectClassDescription( ocdName ) )
+            {
+                return getSelectedValues()[0].getAttribute().getEntry().getBrowserConnection().getSchema()
+                    .getObjectClassDescription( ocdName );
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Gets the Attribute Type Description.
+     *
+     * @return
+     *      the Attribute Type Description
+     */
+    private AttributeTypeDescription getAtd()
+    {
+        if ( ( getSelectedValues().length + getSelectedAttributes().length ) + getSelectedAttributeHierarchies().length == 1 )
+        {
+            AttributeTypeDescription atd = null;
+            if ( getSelectedValues().length == 1 )
+            {
+                atd = getSelectedValues()[0].getAttribute().getAttributeTypeDescription();
+            }
+            else if ( getSelectedAttributes().length == 1 )
+            {
+                atd = getSelectedAttributes()[0].getAttributeTypeDescription();
+            }
+            else if ( getSelectedAttributeHierarchies().length == 1 && getSelectedAttributeHierarchies()[0].size() == 1 )
+            {
+                atd = getSelectedAttributeHierarchies()[0].getAttribute().getAttributeTypeDescription();
+            }
+
+            return atd;
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Gets the connection.
+     *
+     * @return the connection
+     */
+    private IBrowserConnection getConnection()
+    {
+        if ( ( getSelectedValues().length + getSelectedAttributes().length ) + getSelectedAttributeHierarchies().length == 1 )
+        {
+            IBrowserConnection connection = null;
+            if ( getSelectedValues().length == 1 )
+            {
+                connection = getSelectedValues()[0].getAttribute().getEntry().getBrowserConnection();
+            }
+            else if ( getSelectedAttributes().length == 1 )
+            {
+                connection = getSelectedAttributes()[0].getEntry().getBrowserConnection();
+            }
+            else if ( getSelectedAttributeHierarchies().length == 1 && getSelectedAttributeHierarchies()[0].size() == 1 )
+            {
+                connection = getSelectedAttributeHierarchies()[0].getAttribute().getEntry().getBrowserConnection();
+            }
+
+            return connection;
+        }
+        else if ( getSelectedConnections().length == 1 )
+        {
+            Connection connection = getSelectedConnections()[0];
+            IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnection(
+                connection );
+            return browserConnection;
+        }
+        else if ( getSelectedEntries().length == 1 )
+        {
+            return getSelectedEntries()[0].getBrowserConnection();
+        }
+        else if ( getSelectedSearchResults().length == 1 )
+        {
+            return getSelectedSearchResults()[0].getEntry().getBrowserConnection();
+        }
+        else if ( getSelectedBookmarks().length == 1 )
+        {
+            return getSelectedBookmarks()[0].getBrowserConnection();
+        }
+        else if ( getSelectedSearches().length == 1 )
+        {
+            return getSelectedSearches()[0].getBrowserConnection();
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Gets the Equality Matching Rule Description.
+     *
+     * @return
+     *      the Equality Matching Rule Description
+     */
+    private MatchingRuleDescription getEmrd()
+    {
+        AttributeTypeDescription atd = getAtd();
+
+        if ( atd != null && atd.getEqualityMatchingRuleDescriptionOIDTransitive() != null
+            && atd.getSchema().hasMatchingRuleDescription( atd.getEqualityMatchingRuleDescriptionOIDTransitive() ) )
+        {
+            return atd.getSchema().getMatchingRuleDescription( atd.getEqualityMatchingRuleDescriptionOIDTransitive() );
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Gets the Substring Matching Rule Description.
+     *
+     * @return
+     *      the Substring Matching Rule Description
+     */
+    private MatchingRuleDescription getSmrd()
+    {
+        AttributeTypeDescription atd = getAtd();
+
+        if ( atd != null && atd.getSubstringMatchingRuleDescriptionOIDTransitive() != null
+            && atd.getSchema().hasMatchingRuleDescription( atd.getSubstringMatchingRuleDescriptionOIDTransitive() ) )
+        {
+            return atd.getSchema().getMatchingRuleDescription( atd.getSubstringMatchingRuleDescriptionOIDTransitive() );
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Gets the Ordering Matching Rule Description.
+     *
+     * @return
+     *      the Ordering Matching Rule Description
+     */
+    private MatchingRuleDescription getOmrd()
+    {
+        AttributeTypeDescription atd = getAtd();
+
+        if ( atd != null && atd.getOrderingMatchingRuleDescriptionOIDTransitive() != null
+            && atd.getSchema().hasMatchingRuleDescription( atd.getOrderingMatchingRuleDescriptionOIDTransitive() ) )
+        {
+            return atd.getSchema().getMatchingRuleDescription( atd.getOrderingMatchingRuleDescriptionOIDTransitive() );
+        }
+
+        return null;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSchemaBrowserAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,97 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.search.SearchPage;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This Action opens the Search Dialog.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenSearchAction extends Action implements IWorkbenchWindowActionDelegate
+{
+    /**
+     * Creates a new instance of OpenSearchAction.
+     */
+    public OpenSearchAction()
+    {
+        super( "Search...", Action.AS_PUSH_BUTTON );
+        super.setText( "Search..." );
+        super.setToolTipText( "Search..." );
+        super.setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_SEARCH ) );
+        super.setEnabled( true );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        NewSearchUI.openSearchDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow(), SearchPage.getId() );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void init( IWorkbenchWindow window )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run( IAction action )
+    {
+        this.run();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void dispose()
+    {
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchResultAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchResultAction.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchResultAction.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchResultAction.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,116 @@
+/*
+ *  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.actions;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
+import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This Action opens the Search Result View.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenSearchResultAction extends BrowserAction
+{
+    /**
+     * Creates a new instance of OpenSearchResultAction.
+     */
+    public OpenSearchResultAction()
+    {
+        super();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void run()
+    {
+        if ( getSelectedSearchResults().length == 1 )
+        {
+            String targetId = BrowserView.getId();
+            IViewPart targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(
+                targetId );
+            if ( targetView == null )
+            {
+                try
+                {
+                    targetView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(
+                        targetId, null, IWorkbenchPage.VIEW_ACTIVATE );
+                }
+                catch ( PartInitException e )
+                {
+                }
+            }
+            if ( targetView != null && targetView instanceof BrowserView )
+            {
+                ( ( BrowserView ) targetView ).select( getSelectedSearchResults()[0] );
+                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate( targetView );
+            }
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getText()
+    {
+        return "Open Search Result";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OPEN_SEARCHRESULT );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCommandId()
+    {
+        return "org.apache.directory.studio.ldapbrowser.action.openSearchResult";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return getSelectedSearchResults().length == 1;
+    }
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/OpenSearchResultAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,53 @@
+/*
+ *  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.actions.proxy;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
+import org.eclipse.jface.viewers.Viewer;
+
+
+/**
+ * The ModificationLogsViewActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ModificationLogsViewActionProxy extends BrowserActionProxy
+{
+
+    /**
+     * Creates a new instance of ModificationLogsViewActionProxy.
+     * 
+     * @param viewer the viewer
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public ModificationLogsViewActionProxy( Viewer viewer, ActionHandlerManager actionHandlerManager,
+        BrowserAction action )
+    {
+        super( viewer, actionHandlerManager, action );
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/ModificationLogsViewActionProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,53 @@
+/*
+ *  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.actions.proxy;
+
+
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.ActionHandlerManager;
+import org.apache.directory.studio.ldapbrowser.common.actions.proxy.BrowserActionProxy;
+import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditorCursor;
+
+
+/**
+ * The SearchResultEditorActionProxy is a proxy for a real action.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchResultEditorActionProxy extends BrowserActionProxy
+{
+
+    /**
+     * Creates a new instance of SearchResultEditorActionProxy.
+     * 
+     * @param cursor the cursor
+     * @param actionHandlerManager the action handler manager, 
+     *        used to deactivate and activate the action handlers and key bindings
+     * @param action the real action
+     */
+    public SearchResultEditorActionProxy( SearchResultEditorCursor cursor, ActionHandlerManager actionHandlerManager,
+        BrowserAction action )
+    {
+        super( cursor, actionHandlerManager, action );
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/proxy/SearchResultEditorActionProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/EncoderDecoderDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/EncoderDecoderDialog.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/EncoderDecoderDialog.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/EncoderDecoderDialog.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,222 @@
+/*
+ *  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.dialogs;
+
+
+import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.ldapbrowser.core.utils.LdifUtils;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+
+public class EncoderDecoderDialog extends Dialog
+{
+
+    public static final String DIALOG_TITLE = "LDAP Encoder/Decoder";
+
+    private Text iso88591Text;
+
+    private Text iso88591HexText;
+
+    private Text utf8Text;
+
+    private Text utf8HexText;
+
+    private Text base64Text;
+
+    private Text errorText;
+
+    private boolean inModify = false;
+
+
+    public EncoderDecoderDialog( Shell parentShell )
+    {
+        super( parentShell );
+        super.setShellStyle( super.getShellStyle() | SWT.RESIZE );
+    }
+
+
+    protected void configureShell( Shell shell )
+    {
+        super.configureShell( shell );
+        shell.setText( DIALOG_TITLE );
+        //shell.setImage( BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_IMAGEEDITOR ) );
+    }
+
+
+    protected Control createDialogArea( Composite parent )
+    {
+
+        Composite composite2 = ( Composite ) super.createDialogArea( parent );
+        GridData gd1 = new GridData( GridData.FILL_BOTH );
+        gd1.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
+        gd1.heightHint = convertVerticalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
+        composite2.setLayoutData( gd1 );
+
+        Composite composite = BaseWidgetUtils.createColumnContainer( composite2, 2, 1 );
+        composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
+
+        Label iso8859Label = new Label( composite, SWT.NONE );
+        iso8859Label.setText( "ISO-8859-1:" );
+        iso88591Text = new Text( composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL );
+        GridData gd = new GridData( GridData.FILL_BOTH );
+        iso88591Text.setLayoutData( gd );
+
+        Label iso8859HexLabel = new Label( composite, SWT.NONE );
+        iso8859HexLabel.setText( "ISO-8859-1 Hex:" );
+        iso88591HexText = new Text( composite, SWT.BORDER | SWT.READ_ONLY );
+        iso88591HexText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+        Label utf8Label = new Label( composite, SWT.NONE );
+        utf8Label.setText( "UTF-8:" );
+        utf8Text = new Text( composite, SWT.BORDER );
+        utf8Text.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+        Label utf8HexLabel = new Label( composite, SWT.NONE );
+        utf8HexLabel.setText( "UTF-8 Hex:" );
+        utf8HexText = new Text( composite, SWT.BORDER | SWT.READ_ONLY );
+        utf8HexText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+        Label base64Label = new Label( composite, SWT.NONE );
+        base64Label.setText( "BASE-64:" );
+        base64Text = new Text( composite, SWT.BORDER );
+        base64Text.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+        errorText = new Text( composite, SWT.BORDER | SWT.READ_ONLY );
+        gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = 2;
+        errorText.setLayoutData( gd );
+
+        iso88591Text.addModifyListener( new ModifyListener()
+        {
+            public void modifyText( ModifyEvent e )
+            {
+                if ( !inModify )
+                {
+                    inModify = true;
+                    try
+                    {
+                        String iso = iso88591Text.getText();
+                        byte[] isoHex = iso.getBytes( "ISO-8859-1" );
+                        byte[] utf8 = LdifUtils.utf8encode( iso );
+                        String utf8String = new String( utf8, "ISO-8859-1" );
+                        String base64 = LdifUtils.base64encode( utf8 );
+
+                        iso88591HexText.setText( LdifUtils.hexEncode( isoHex ) );
+                        utf8Text.setText( utf8String );
+                        utf8HexText.setText( LdifUtils.hexEncode( utf8 ) );
+                        base64Text.setText( base64 );
+                        errorText.setText( "" );
+                    }
+                    catch ( Exception ex )
+                    {
+                        errorText.setText( ex.getMessage() );
+                        ex.printStackTrace();
+                    }
+                    finally
+                    {
+                        inModify = false;
+                    }
+                }
+            }
+        } );
+
+        utf8Text.addModifyListener( new ModifyListener()
+        {
+            public void modifyText( ModifyEvent e )
+            {
+                if ( !inModify )
+                {
+                    inModify = true;
+                    try
+                    {
+                        String utf8String = utf8Text.getText();
+                        byte[] utf8 = utf8String.getBytes( "ISO-8859-1" );
+                        String iso = LdifUtils.utf8decode( utf8 );
+                        byte[] isoHex = iso.getBytes( "ISO-8859-1" );
+                        String base64 = LdifUtils.base64encode( utf8 );
+
+                        iso88591Text.setText( iso );
+                        iso88591HexText.setText( LdifUtils.hexEncode( isoHex ) );
+                        utf8HexText.setText( LdifUtils.hexEncode( utf8 ) );
+                        base64Text.setText( base64 );
+                        errorText.setText( "" );
+                    }
+                    catch ( Exception ex )
+                    {
+                        errorText.setText( ex.getMessage() );
+                        ex.printStackTrace();
+                    }
+                    finally
+                    {
+                        inModify = false;
+                    }
+                }
+            }
+        } );
+
+        base64Text.addModifyListener( new ModifyListener()
+        {
+            public void modifyText( ModifyEvent e )
+            {
+                if ( !inModify )
+                {
+                    inModify = true;
+                    try
+                    {
+                        String base64 = base64Text.getText();
+                        byte[] utf8 = LdifUtils.base64decodeToByteArray( base64 );
+                        String utf8String = new String( utf8, "ISO-8859-1" );
+                        String iso = LdifUtils.utf8decode( utf8 );
+                        byte[] isoHex = iso.getBytes( "ISO-8859-1" );
+
+                        iso88591Text.setText( iso );
+                        iso88591HexText.setText( LdifUtils.hexEncode( isoHex ) );
+                        utf8Text.setText( utf8String );
+                        utf8HexText.setText( LdifUtils.hexEncode( utf8 ) );
+                        errorText.setText( "" );
+                    }
+                    catch ( Exception ex )
+                    {
+                        errorText.setText( ex.getMessage() );
+                        ex.printStackTrace();
+                    }
+                    finally
+                    {
+                        inModify = false;
+                    }
+                }
+            }
+        } );
+
+        return composite;
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/EncoderDecoderDialog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java?rev=592087&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java (added)
+++ directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java Mon Nov  5 09:01:21 2007
@@ -0,0 +1,129 @@
+/*
+ *  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.dialogs.preferences;
+
+
+import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
+import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
+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;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class SearchResultEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage,
+    WidgetModifyListener
+{
+
+    private Button showDnButton;
+
+    private Button showLinksButton;
+
+
+    public SearchResultEditorPreferencePage()
+    {
+        super();
+        super.setPreferenceStore( BrowserUIPlugin.getDefault().getPreferenceStore() );
+        super.setDescription( "General settings for the LDAP search result editor:" );
+    }
+
+
+    public void init( IWorkbench workbench )
+    {
+    }
+
+
+    protected Control createContents( Composite parent )
+    {
+
+        Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
+
+        BaseWidgetUtils.createSpacer( composite, 1 );
+        BaseWidgetUtils.createSpacer( composite, 1 );
+        showDnButton = BaseWidgetUtils.createCheckbox( composite, "Show DN as first column", 1 );
+        showDnButton.setSelection( getPreferenceStore().getBoolean(
+            BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) );
+        showLinksButton = BaseWidgetUtils.createCheckbox( composite, "Show DN a link", 1 );
+        showLinksButton.setSelection( getPreferenceStore().getBoolean(
+            BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS ) );
+
+        updateEnabled();
+        validate();
+
+        applyDialogFont( composite );
+        return composite;
+    }
+
+
+    private void updateEnabled()
+    {
+
+    }
+
+
+    public boolean performOk()
+    {
+
+        getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN,
+            this.showDnButton.getSelection() );
+        getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS,
+            this.showLinksButton.getSelection() );
+
+        updateEnabled();
+        validate();
+
+        return true;
+    }
+
+
+    protected void performDefaults()
+    {
+
+        this.showDnButton.setSelection( getPreferenceStore().getDefaultBoolean(
+            BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) );
+        this.showLinksButton.setSelection( getPreferenceStore().getDefaultBoolean(
+            BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS ) );
+
+        updateEnabled();
+        validate();
+
+        super.performDefaults();
+    }
+
+
+    public void widgetModified( WidgetModifyEvent event )
+    {
+        updateEnabled();
+        validate();
+    }
+
+
+    protected void validate()
+    {
+
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message