directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r811101 - in /directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views: browser/LinkWithEditorAction.java connection/LinkWithEditorAction.java
Date Thu, 03 Sep 2009 20:10:05 GMT
Author: seelmann
Date: Thu Sep  3 20:10:05 2009
New Revision: 811101

URL: http://svn.apache.org/viewvc?rev=811101&view=rev
Log:
Make the link with editor action workable with each editor implementation

Modified:
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java?rev=811101&r1=811100&r2=811101&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java
Thu Sep  3 20:10:05 2009
@@ -17,14 +17,13 @@
  *  under the License. 
  *  
  */
+ 
 package org.apache.directory.studio.ldapbrowser.ui.views.browser;
 
 
 import org.apache.directory.studio.entryeditors.EntryEditorInput;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
-import org.apache.directory.studio.ldapbrowser.ui.editors.entry.EntryEditor;
-import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditor;
 import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditorInput;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -177,21 +176,16 @@
         {
             Object objectToSelect = null;
 
-            if ( part instanceof EntryEditor )
+            if ( part instanceof IEditorPart )
             {
-                EntryEditor editor = ( EntryEditor ) part;
+                IEditorPart editor = ( IEditorPart ) part;
                 IEditorInput input = editor.getEditorInput();
                 if ( input != null && input instanceof EntryEditorInput )
                 {
                     EntryEditorInput eei = ( EntryEditorInput ) input;
                     objectToSelect = eei.getInput();
                 }
-            }
-            else if ( part instanceof SearchResultEditor )
-            {
-                SearchResultEditor editor = ( SearchResultEditor ) part;
-                IEditorInput input = editor.getEditorInput();
-                if ( input != null && input instanceof SearchResultEditorInput )
+                else if ( input != null && input instanceof SearchResultEditorInput
)
                 {
                     SearchResultEditorInput srei = ( SearchResultEditorInput ) input;
                     objectToSelect = srei.getSearch();

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java?rev=811101&r1=811100&r2=811101&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java
Thu Sep  3 20:10:05 2009
@@ -26,8 +26,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
-import org.apache.directory.studio.ldapbrowser.ui.editors.entry.EntryEditor;
-import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditor;
 import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditorInput;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.util.IPropertyChangeListener;
@@ -102,6 +100,7 @@
          */
         public void partInputChanged( IWorkbenchPartReference partRef )
         {
+            linkViewWithEditor( partRef.getPart( false ) );
         }
 
 
@@ -203,9 +202,9 @@
         {
             Object objectToSelect = null;
 
-            if ( part instanceof EntryEditor )
+            if ( part instanceof IEditorPart )
             {
-                EntryEditor editor = ( EntryEditor ) part;
+                IEditorPart editor = ( IEditorPart ) part;
                 IEditorInput input = editor.getEditorInput();
                 if ( input != null && input instanceof EntryEditorInput )
                 {
@@ -216,12 +215,7 @@
                         objectToSelect = entry.getBrowserConnection().getConnection();
                     }
                 }
-            }
-            else if ( part instanceof SearchResultEditor )
-            {
-                SearchResultEditor editor = ( SearchResultEditor ) part;
-                IEditorInput input = editor.getEditorInput();
-                if ( input != null && input instanceof SearchResultEditorInput )
+                else if ( input != null && input instanceof SearchResultEditorInput
)
                 {
                     SearchResultEditorInput srei = ( SearchResultEditorInput ) input;
                     ISearch search = srei.getSearch();



Mime
View raw message