directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r689656 - in /directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors: entry/OpenEntryEditorAction.java searchresult/OpenEntryEditorAction.java
Date Wed, 27 Aug 2008 23:20:08 GMT
Author: seelmann
Date: Wed Aug 27 16:20:07 2008
New Revision: 689656

URL: http://svn.apache.org/viewvc?rev=689656&view=rev
Log:
Fixed execution of action

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

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorAction.java?rev=689656&r1=689655&r2=689656&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorAction.java
Wed Aug 27 16:20:07 2008
@@ -24,10 +24,13 @@
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.AbstractOpenEditorAction;
 import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetActionGroup;
+import org.apache.directory.studio.ldapbrowser.common.wizards.EditEntryWizard;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.valueeditors.IValueEditor;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.wizard.WizardDialog;
 
 
 /**
@@ -75,8 +78,23 @@
      */
     public void run()
     {
-        valueEditorManager.setUserSelectedValueEditor( valueEditor );
-        super.run();
+        IEntry entry = getSelectedValues().length > 0 ? getSelectedValues()[0].getAttribute().getEntry()
+            : getSelectedAttributes().length > 0 ? getSelectedAttributes()[0].getEntry()
+                : ( getInput() instanceof IEntry ) ? ( IEntry ) getInput() : null;
+        if ( entry != null )
+        {
+            // disable action handlers
+            actionGroup.deactivateGlobalActionHandlers();
+
+            EditEntryWizard wizard = new EditEntryWizard( entry );
+            WizardDialog dialog = new WizardDialog( getShell(), wizard );
+            dialog.setBlockOnOpen( true );
+            dialog.create();
+            dialog.open();
+
+            // enable action handlers
+            actionGroup.activateGlobalActionHandlers();
+        }
     }
 
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEntryEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEntryEditorAction.java?rev=689656&r1=689655&r2=689656&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEntryEditorAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEntryEditorAction.java
Wed Aug 27 16:20:07 2008
@@ -22,10 +22,13 @@
 
 
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.common.wizards.EditEntryWizard;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.valueeditors.IValueEditor;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardDialog;
 
 
 /**
@@ -74,8 +77,21 @@
      */
     public void run()
     {
-        valueEditorManager.setUserSelectedValueEditor( valueEditor );
-        super.run();
+        IEntry entry = getSelectedSearchResults().length > 0 ? getSelectedSearchResults()[0].getEntry()
: null;
+        if ( entry != null )
+        {
+            // disable action handlers
+            actionGroup.deactivateGlobalActionHandlers();
+
+            EditEntryWizard wizard = new EditEntryWizard( entry );
+            WizardDialog dialog = new WizardDialog( getShell(), wizard );
+            dialog.setBlockOnOpen( true );
+            dialog.create();
+            dialog.open();
+
+            // enable action handlers
+            actionGroup.activateGlobalActionHandlers();
+        }
     }
 
 



Mime
View raw message