You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2008/08/21 12:05:44 UTC
svn commit: r687679 [2/2] - in /directory/studio/trunk:
connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/
connection-ui/src/main/java/org/apache/directory/studio/connection/ui/
ldapbrowser-common/resources/icons/ ldapbrows...
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java Thu Aug 21 03:05:39 2008
@@ -28,8 +28,10 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.apache.directory.shared.ldap.codec.util.LdapURL;
import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
@@ -38,12 +40,19 @@
import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
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.IValue;
import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
import org.apache.directory.studio.ldifparser.LdifFormatParameters;
import org.apache.directory.studio.ldifparser.LdifUtils;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeModifyRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifModSpec;
+import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifModSpecSepLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifSepLine;
import org.eclipse.core.runtime.Preferences;
@@ -52,7 +61,7 @@
/**
* Transforms the given DN into a normalized String, usable by the schema cache.
- * The following transformations are permformed:
+ * The following transformations are performed:
* <ul>
* <li>The attribute type is replaced by the OID
* <li>The attribute value is trimmed and lowercased
@@ -371,4 +380,144 @@
return url;
}
+
+ /**
+ * Computes the difference between the old and the new entry
+ * and returns an LDIF that could be applied to the old entry
+ * to get new entry.
+ *
+ * @param t0 the old entry
+ * @param t1 the new entry
+ * @return the change modify record or null if there is no difference
+ * between the two entries
+ */
+ public static LdifChangeModifyRecord computeDiff( IEntry t0, IEntry t1 )
+ {
+ // TODO: binary
+ LdifChangeModifyRecord record = LdifChangeModifyRecord.create( t0.getDn().getUpName() );
+
+ // check which attributes/values must be deleted
+ for ( IAttribute oldAttr : t0.getAttributes() )
+ {
+ String oldAttrDesc = oldAttr.getDescription();
+ IAttribute newAttr = t1.getAttribute( oldAttrDesc );
+ if ( newAttr == null )
+ {
+ // delete whole attribute
+ LdifModSpec modSpec = LdifModSpec.createDelete( oldAttrDesc );
+ modSpec.finish( LdifModSpecSepLine.create() );
+ record.addModSpec( modSpec );
+ }
+ else if ( oldAttr.getValueSize() == 1 && newAttr.getValueSize() == 1 )
+ {
+ // check later: replace
+ }
+ else
+ {
+ Set<String> newValues = new HashSet<String>( Arrays.asList( newAttr.getStringValues() ) );
+ for ( IValue oldValue : oldAttr.getValues() )
+ {
+ if ( !newValues.contains( oldValue.getStringValue() ) && !oldValue.isEmpty() )
+ {
+ LdifModSpec modSpec = LdifModSpec.createDelete( oldAttrDesc );
+ if ( oldAttr.isBinary() )
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( oldAttrDesc, oldValue.getBinaryValue() ) );
+ }
+ else
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( oldAttrDesc, oldValue.getStringValue() ) );
+ }
+ modSpec.finish( LdifModSpecSepLine.create() );
+ record.addModSpec( modSpec );
+ }
+ }
+ }
+ }
+
+ // check which attributes/values must be added
+ for ( IAttribute newAttr : t1.getAttributes() )
+ {
+ String newAttrDesc = newAttr.getDescription();
+ IAttribute oldAttr = t0.getAttribute( newAttrDesc );
+ if ( oldAttr == null )
+ {
+ // add whole attribute
+ LdifModSpec modSpec = LdifModSpec.createAdd( newAttrDesc );
+ for ( IValue newValue : newAttr.getValues() )
+ {
+ if ( !newValue.isEmpty() )
+ {
+ if ( newAttr.isBinary() )
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( newAttrDesc, newValue.getBinaryValue() ) );
+ }
+ else
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( newAttrDesc, newValue.getStringValue() ) );
+ }
+ }
+ }
+ modSpec.finish( LdifModSpecSepLine.create() );
+ if ( modSpec.isValid() )
+ {
+ record.addModSpec( modSpec );
+ }
+ }
+ else if ( oldAttr.getValueSize() == 1 && newAttr.getValueSize() == 1 )
+ {
+ // check later: replace
+ }
+ else
+ {
+ Set<String> oldValues = new HashSet<String>( Arrays.asList( oldAttr.getStringValues() ) );
+ for ( IValue newValue : newAttr.getValues() )
+ {
+ if ( !oldValues.contains( newValue.getStringValue() ) && !newValue.isEmpty() )
+ {
+ LdifModSpec modSpec = LdifModSpec.createAdd( newAttrDesc );
+ if ( newAttr.isBinary() )
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( newAttrDesc, newValue.getBinaryValue() ) );
+ }
+ else
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( newAttrDesc, newValue.getStringValue() ) );
+ }
+ modSpec.finish( LdifModSpecSepLine.create() );
+ record.addModSpec( modSpec );
+ }
+ }
+ }
+ }
+
+ // check which attributes/values must be replaced
+ for ( IAttribute newAttr : t1.getAttributes() )
+ {
+ String newAttrDesc = newAttr.getDescription();
+ IAttribute oldAttr = t0.getAttribute( newAttrDesc );
+ if ( oldAttr != null && oldAttr.getValueSize() == 1 && newAttr.getValueSize() == 1
+ && !oldAttr.getValues()[0].getStringValue().equals( newAttr.getValues()[0].getStringValue() ) )
+ {
+ LdifModSpec modSpec = LdifModSpec.createReplace( newAttrDesc );
+ if ( newAttr.isBinary() )
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( newAttrDesc, newAttr.getValues()[0].getBinaryValue() ) );
+ }
+ else
+ {
+ modSpec.addAttrVal( LdifAttrValLine.create( newAttrDesc, newAttr.getValues()[0].getStringValue() ) );
+ }
+ modSpec.finish( LdifModSpecSepLine.create() );
+ record.addModSpec( modSpec );
+ }
+ }
+
+ record.finish( LdifSepLine.create() );
+
+ // check for changes: if there are no changes the record does not include
+ // any modifications and so it is not valid.
+ return record.isValid() ? record : null;
+ }
+
}
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java Thu Aug 21 03:05:39 2008
@@ -129,8 +129,6 @@
public static final String IMG_ENTRY_ADD = "resources/icons/entry_add.gif";
- public static final String IMG_ENTRY_WIZARD = "resources/icons/entry_wizard.gif";
-
public static final String IMG_LOCATE_DN_IN_DIT = "resources/icons/locate_dn_in_dit.gif";
public static final String IMG_LOCATE_SEARCHRESULT_IN_DIT = "resources/icons/locate_searchresult_in_dit.gif";
@@ -215,12 +213,6 @@
public static final String IMG_OCD = "resources/icons/ocd.png";
- public static final String IMG_OCD_ABSTRACT = "resources/icons/ocd_abstract.gif";
-
- public static final String IMG_OCD_AUXILIARY = "resources/icons/ocd_auxiliary.gif";
-
- public static final String IMG_OCD_STRUCTURAL = "resources/icons/ocd_structural.gif";
-
public static final String IMG_MRD = "resources/icons/mrd.png";
public static final String IMG_MRUD = "resources/icons/mrud.png";
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java Thu Aug 21 03:05:39 2008
@@ -22,9 +22,9 @@
import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
+import org.apache.directory.studio.ldapbrowser.common.wizards.NewEntryWizard;
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;
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorActionGroup.java Thu Aug 21 03:05:39 2008
@@ -68,6 +68,9 @@
/** The show operational attributes action. */
private ShowOperationalAttributesAction showOperationalAttributesAction;
+ /** The open entry value editor action. */
+ private EntryEditorActionProxy openEntryValueEditorActionProxy;
+
/** The open entry editor preference page. */
private OpenEntryEditorPreferencePageAction openEntryEditorPreferencePage;
@@ -165,6 +168,10 @@
openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenDefaultEditorAction( viewer,
openBestValueEditorActionProxy, true ) );
+ openEntryValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenEntryEditorAction( viewer,
+ entryEditor.getConfiguration().getValueEditorManager( viewer ), entryEditor.getConfiguration()
+ .getValueEditorManager( viewer ).getEntryValueEditor(), this ) );
+
showOperationalAttributesAction = new ShowOperationalAttributesAction();
openEntryEditorPreferencePage = new OpenEntryEditorPreferencePageAction();
collapseAllAction = new CollapseAllAction( viewer );
@@ -230,6 +237,8 @@
{
deactivateGlobalActionHandlers();
+ openEntryValueEditorActionProxy.dispose();
+ openEntryValueEditorActionProxy = null;
openEntryEditorPreferencePage = null;
showOperationalAttributesAction = null;
expandAllAction.dispose();
@@ -347,6 +356,7 @@
// edit
menuManager.add( entryEditorActionMap.get( editAttributeDescriptionAction ) );
super.addEditMenu( menuManager );
+ menuManager.add( openEntryValueEditorActionProxy );
menuManager.add( new Separator() );
// refresh
@@ -380,6 +390,7 @@
ActionUtils.activateActionHandler( lid );
IAction eada = entryEditorActionMap.get( editAttributeDescriptionAction );
ActionUtils.activateActionHandler( eada );
+ ActionUtils.activateActionHandler( openEntryValueEditorActionProxy );
}
@@ -401,6 +412,7 @@
ActionUtils.deactivateActionHandler( lid );
IAction eada = entryEditorActionMap.get( editAttributeDescriptionAction );
ActionUtils.deactivateActionHandler( eada );
+ ActionUtils.deactivateActionHandler( openEntryValueEditorActionProxy );
}
Added: 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=687679&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorAction.java (added)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorAction.java Thu Aug 21 03:05:39 2008
@@ -0,0 +1,128 @@
+/*
+ * 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.editors.entry;
+
+
+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.valueeditors.IValueEditor;
+import org.apache.directory.studio.valueeditors.ValueEditorManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.TreeViewer;
+
+
+/**
+ * Action to open the entry editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenEntryEditorAction extends AbstractOpenEditorAction
+{
+
+ private IValueEditor valueEditor;
+
+
+ /**
+ * Creates a new instance of OpenEntryEditorAction.
+ *
+ * @param viewer the viewer
+ * @param valueEditorManager the value editor manager
+ * @param valueEditor the value editor
+ * @param actionGroup the action group
+ */
+ public OpenEntryEditorAction( TreeViewer viewer, ValueEditorManager valueEditorManager, IValueEditor valueEditor,
+ EntryEditorWidgetActionGroup actionGroup )
+ {
+ super( viewer, valueEditorManager, actionGroup );
+ super.cellEditor = valueEditor.getCellEditor();
+ this.valueEditor = valueEditor;
+ }
+
+
+ /**
+ * Gets the value editor.
+ *
+ * @return the value editor
+ */
+ public IValueEditor getValueEditor()
+ {
+ return valueEditor;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run()
+ {
+ valueEditorManager.setUserSelectedValueEditor( valueEditor );
+ super.run();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose()
+ {
+ valueEditor = null;
+ super.dispose();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getCommandId()
+ {
+ return BrowserCommonConstants.ACTION_ID_EDIT_RECORD;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public ImageDescriptor getImageDescriptor()
+ {
+ return null;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getText()
+ {
+ return "Edit Entry";
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled()
+ {
+ return true;
+ }
+
+}
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/OpenEntryEditorPreferencePageAction.java Thu Aug 21 03:05:39 2008
@@ -29,7 +29,7 @@
/**
- * This action opens the prefence page of the entry editor.
+ * This action opens the preference page of the entry editor.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
Added: 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=687679&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEntryEditorAction.java (added)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/OpenEntryEditorAction.java Thu Aug 21 03:05:39 2008
@@ -0,0 +1,127 @@
+/*
+ * 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.editors.searchresult;
+
+
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+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;
+
+
+/**
+ * Action to open the entry editor.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenEntryEditorAction extends AbstractOpenEditorAction
+{
+
+ private IValueEditor valueEditor;
+
+
+ /**
+ * Creates a new instance of OpenEntryEditorAction.
+ *
+ * @param viewer the viewer
+ * @param cursor the cursor
+ * @param valueEditorManager the value editor manager
+ * @param valueEditor the value editor
+ * @param actionGroup the action group
+ */
+ public OpenEntryEditorAction( TableViewer viewer, SearchResultEditorCursor cursor,
+ ValueEditorManager valueEditorManager, IValueEditor valueEditor, SearchResultEditorActionGroup actionGroup )
+ {
+ super( viewer, cursor, valueEditorManager, actionGroup );
+ super.cellEditor = valueEditor.getCellEditor();
+ this.valueEditor = valueEditor;
+ }
+
+
+ /**
+ * Gets the value editor.
+ *
+ * @return the value editor
+ */
+ public IValueEditor getValueEditor()
+ {
+ return valueEditor;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run()
+ {
+ valueEditorManager.setUserSelectedValueEditor( valueEditor );
+ super.run();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose()
+ {
+ valueEditor = null;
+ super.dispose();
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getCommandId()
+ {
+ return BrowserCommonConstants.ACTION_ID_EDIT_RECORD;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public ImageDescriptor getImageDescriptor()
+ {
+ return null;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getText()
+ {
+ return "Edit Entry";
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled()
+ {
+ return true;
+ }
+
+}
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorActionGroup.java Thu Aug 21 03:05:39 2008
@@ -87,6 +87,9 @@
/** The open editor actions. */
private SearchResultEditorActionProxy[] openValueEditorActionProxies;
+ /** The open entry value editor action. */
+ private SearchResultEditorActionProxy openEntryValueEditorActionProxy;
+
private ValueEditorPreferencesAction openValueEditorPreferencesAction;
private static final String copyTableAction = "copyTableAction";
@@ -180,6 +183,8 @@
openValueEditorActionProxies[i] = new SearchResultEditorActionProxy( cursor, new OpenEditorAction( viewer,
cursor, valueEditorManager, valueEditors[i], this ) );
}
+ openEntryValueEditorActionProxy = new SearchResultEditorActionProxy( cursor, new OpenEntryEditorAction( viewer,
+ cursor, valueEditorManager, valueEditorManager.getEntryValueEditor(), this ) );
this.openValueEditorPreferencesAction = new ValueEditorPreferencesAction();
this.searchResultEditorActionMap.put( copyTableAction, new SearchResultEditorActionProxy( cursor,
@@ -271,7 +276,9 @@
openValueEditorActionProxies[i].dispose();
openValueEditorActionProxies[i] = null;
}
- this.openValueEditorPreferencesAction = null;
+ openEntryValueEditorActionProxy.dispose();
+ openEntryValueEditorActionProxy = null;
+ openValueEditorPreferencesAction = null;
for ( Iterator it = this.searchResultEditorActionMap.keySet().iterator(); it.hasNext(); )
{
@@ -408,6 +415,7 @@
editorMenuManager.add( new Separator() );
editorMenuManager.add( this.openValueEditorPreferencesAction );
menuManager.add( editorMenuManager );
+ menuManager.add( openEntryValueEditorActionProxy );
menuManager.add( new Separator() );
// refresh
@@ -447,6 +455,7 @@
IAction osr = ( IAction ) this.searchResultEditorActionMap.get( openSearchResultAction );
ActionUtils.activateActionHandler( osr );
ActionUtils.activateActionHandler( openDefaultValueEditorActionProxy );
+ ActionUtils.activateActionHandler( openEntryValueEditorActionProxy );
}
@@ -470,6 +479,7 @@
IAction osr = ( IAction ) this.searchResultEditorActionMap.get( openSearchResultAction );
ActionUtils.deactivateActionHandler( osr );
ActionUtils.deactivateActionHandler( openDefaultValueEditorActionProxy );
+ ActionUtils.deactivateActionHandler( openEntryValueEditorActionProxy );
}
@@ -499,6 +509,10 @@
{
return true;
}
+ if ( ( ( AbstractOpenEditorAction ) openEntryValueEditorActionProxy.getAction() ).isActive() )
+ {
+ return true;
+ }
for ( int i = 0; i < openValueEditorActionProxies.length; i++ )
{
if ( ( ( AbstractOpenEditorAction ) openValueEditorActionProxies[i].getAction() ).isActive() )
Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java Thu Aug 21 03:05:39 2008
@@ -23,13 +23,13 @@
import org.apache.directory.studio.connection.ui.wizards.NewConnectionWizard;
import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
+import org.apache.directory.studio.ldapbrowser.common.wizards.NewEntryWizard;
import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
import org.apache.directory.studio.ldapbrowser.ui.views.connection.ConnectionView;
import org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs.ModificationLogsView;
import org.apache.directory.studio.ldapbrowser.ui.views.searchlogs.SearchLogsView;
import org.apache.directory.studio.ldapbrowser.ui.wizards.BatchOperationWizard;
import org.apache.directory.studio.ldapbrowser.ui.wizards.NewBookmarkWizard;
-import org.apache.directory.studio.ldapbrowser.ui.wizards.NewEntryWizard;
import org.apache.directory.studio.ldapbrowser.ui.wizards.NewSearchWizard;
import org.apache.directory.studio.ldifeditor.wizards.NewLdifFileWizard;
import org.eclipse.ui.IFolderLayout;
Modified: directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/ExecuteLdifAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/ExecuteLdifAction.java?rev=687679&r1=687678&r2=687679&view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/ExecuteLdifAction.java (original)
+++ directory/studio/trunk/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/ExecuteLdifAction.java Thu Aug 21 03:05:39 2008
@@ -21,7 +21,8 @@
package org.apache.directory.studio.ldifeditor.editor;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ExecuteLdifJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ExecuteLdifRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
import org.apache.directory.studio.ldifeditor.LdifEditorConstants;
@@ -52,19 +53,21 @@
this.editor = editor;
}
+
/**
* {@inheritDoc}
*/
public void run()
{
-
IBrowserConnection connection = editor.getConnection();
String ldif = editor.getLdifModel().toRawString();
- new ExecuteLdifJob( connection, ldif, true ).execute();
-
+ ExecuteLdifRunnable runnable = new ExecuteLdifRunnable( connection, ldif, true );
+ StudioBrowserJob job = new StudioBrowserJob( runnable );
+ job.execute();
}
+
/**
* {@inheritDoc}
*/