directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r823182 - /directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java
Date Thu, 08 Oct 2009 14:02:51 GMT
Author: pamarcelot
Date: Thu Oct  8 14:02:51 2009
New Revision: 823182

URL: http://svn.apache.org/viewvc?rev=823182&view=rev
Log:
o Organized imports
o Removed now useless INullSelectionListener

Modified:
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java?rev=823182&r1=823181&r2=823182&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorUniversalListener.java
Thu Oct  8 14:02:51 2009
@@ -22,17 +22,9 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
-import org.apache.directory.studio.ldapbrowser.common.actions.BrowserSelectionUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetUniversalListener;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
-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.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.INullSelectionListener;
 import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.IWorkbenchPartReference;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.contexts.IContextActivation;
@@ -48,56 +40,12 @@
  */
 public class EntryEditorUniversalListener extends EntryEditorWidgetUniversalListener
 {
-
     /** The entry editor */
     private EntryEditor entryEditor;
 
     /** Token used to activate and deactivate shortcuts in the editor */
     private IContextActivation contextActivation;
 
-    /** Listener that listens for selections of IEntry, ISeachResult and IBookmark objects.
*/
-    private INullSelectionListener entrySelectionListener = new INullSelectionListener()
-    {
-        /**
-         * {@inheritDoc}
-         * 
-         * This implementation sets the editor's input when a entry, search result or bookmark
is selected.
-         */
-        public void selectionChanged( IWorkbenchPart part, ISelection selection )
-        {
-            if ( entryEditor != null && part != null )
-            {
-                // TODO: should be removed, opening the editor and changing input will be
completely managed by the browser view 
-//                if ( entryEditor.getSite().getWorkbenchWindow() == part.getSite().getWorkbenchWindow()
)
-//                {
-//                    IEntry[] entries = BrowserSelectionUtils.getEntries( selection );
-//                    ISearchResult[] searchResults = BrowserSelectionUtils.getSearchResults(
selection );
-//                    IBookmark[] bookmarks = BrowserSelectionUtils.getBookmarks( selection
);
-//                    Object[] objects = BrowserSelectionUtils.getObjects( selection );
-//                    if ( entries.length + searchResults.length + bookmarks.length == 1
&& objects.length == 1 )
-//                    {
-//                        if ( entries.length == 1 )
-//                        {
-//                            entryEditor.setInput( new EntryEditorInput( entries[0] ) );
-//                        }
-//                        else if ( searchResults.length == 1 )
-//                        {
-//                            entryEditor.setInput( new EntryEditorInput( searchResults[0]
) );
-//                        }
-//                        else if ( bookmarks.length == 1 )
-//                        {
-//                            entryEditor.setInput( new EntryEditorInput( bookmarks[0] )
);
-//                        }
-//                    }
-//                    else
-//                    {
-//                        entryEditor.setInput( new EntryEditorInput( ( IEntry ) null ) );
-//                    }
-//                }
-            }
-        }
-    };
-
     /** The part listener used to activate and deactivate the shortcuts */
     private IPartListener2 partListener = new IPartListener2()
     {
@@ -205,8 +153,6 @@
 
         // register listeners
         entryEditor.getSite().getPage().addPartListener( partListener );
-        entryEditor.getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(
BrowserView.getId(),
-            entrySelectionListener );
     }
 
 
@@ -219,8 +165,6 @@
         {
             // deregister listeners
             entryEditor.getSite().getPage().removePartListener( partListener );
-            entryEditor.getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(
-                BrowserView.getId(), entrySelectionListener );
             entryEditor = null;
         }
 



Mime
View raw message