directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r691556 - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/ ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ ldapbrowser-common/src/main/java/...
Date Wed, 03 Sep 2008 09:46:59 GMT
Author: seelmann
Date: Wed Sep  3 02:46:58 2008
New Revision: 691556

URL: http://svn.apache.org/viewvc?rev=691556&view=rev
Log:
Fix for DIRSTUDIO-385 (Add dialog to create a new context entry)

Modified:
    directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryWizard.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/NewEntryAction.java

Modified: directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java (original)
+++ directory/studio/trunk/connection-core/src/main/java/org/apache/directory/studio/connection/core/jobs/StudioConnectionJob.java Wed Sep  3 02:46:58 2008
@@ -282,7 +282,9 @@
 
     private static String getLockIdentifier( Object object )
     {
-        return object != null ? object.toString() : "null";
+        String s = object != null ? object.toString() : "null";
+        s = "-" + s;
+        return s;
     }
 
 }

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java Wed Sep  3 02:46:58 2008
@@ -32,6 +32,7 @@
 import org.apache.directory.studio.ldapbrowser.core.jobs.SearchRunnable;
 import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.eclipse.jface.resource.ImageDescriptor;
 
@@ -135,7 +136,11 @@
         if ( entries.length > 0 )
         {
             new StudioBrowserJob( new InitializeAttributesRunnable( entries, soa ) ).execute();
-            new StudioBrowserJob( new InitializeChildrenRunnable( entries ) ).execute();
+            // avoid duplicate search on Root DSE
+            if ( entries.length > 1 || !( entries[0] instanceof IRootDSE ) )
+            {
+                new StudioBrowserJob( new InitializeChildrenRunnable( entries ) ).execute();
+            }
         }
         if ( searches.length > 0 )
         {

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryDnWizardPage.java Wed Sep  3 02:46:58 2008
@@ -24,28 +24,39 @@
 import java.util.Arrays;
 import java.util.Iterator;
 
+import javax.naming.InvalidNameException;
+
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.ui.RunnableContextRunner;
+import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.widgets.DnBuilderWidget;
+import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Subschema;
 import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.fieldassist.ComboContentAdapter;
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 
 
@@ -65,6 +76,12 @@
     /** The DN builder widget. */
     private DnBuilderWidget dnBuilderWidget;
 
+    /** The context entry DN combo. */
+    private Combo contextEntryDnCombo;
+
+    /** The content proposal adapter for the context entry DN combo. */
+    private ContentProposalAdapter contextEntryDnComboCPA;
+
 
     /**
      * Creates a new instance of NewEntryDnWizardPage.
@@ -76,7 +93,14 @@
     {
         super( pageName );
         setTitle( "Distinguished Name" );
-        setDescription( "Please select the parent of the new entry and enter the RDN." );
+        if ( wizard.isNewContextEntry() )
+        {
+            setDescription( "Please enter the DN of the context entry." );
+        }
+        else
+        {
+            setDescription( "Please select the parent of the new entry and enter the RDN." );
+        }
         setImageDescriptor( BrowserCommonActivator.getDefault().getImageDescriptor(
             BrowserCommonConstants.IMG_ENTRY_WIZARD ) );
         setPageComplete( false );
@@ -105,7 +129,14 @@
      */
     private void validate()
     {
-        if ( dnBuilderWidget.getRdn() != null && dnBuilderWidget.getParentDn() != null )
+        if ( wizard.isNewContextEntry() && !"".equals( contextEntryDnCombo.getText() )
+            && LdapDN.isValid( contextEntryDnCombo.getText() ) )
+        {
+            setPageComplete( true );
+            saveState();
+        }
+        else if ( !wizard.isNewContextEntry() && dnBuilderWidget.getRdn() != null
+            && dnBuilderWidget.getParentDn() != null )
         {
             setPageComplete( true );
             saveState();
@@ -125,22 +156,48 @@
     {
         DummyEntry newEntry = wizard.getPrototypeEntry();
 
-        Subschema subschema = newEntry.getSubschema();
-        String[] attributeNames = subschema.getAllAttributeNames();
-
-        LdapDN parentDn = null;
-        if ( DnUtils.getParent( newEntry.getDn() ) != null )
+        if ( wizard.isNewContextEntry() )
         {
-            parentDn = DnUtils.getParent( newEntry.getDn() );
+            IAttribute attribute = wizard.getSelectedConnection().getRootDSE().getAttribute(
+                IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS );
+            if ( attribute != null )
+            {
+                String[] values = attribute.getStringValues();
+
+                // content proposals
+                contextEntryDnComboCPA.setContentProposalProvider( new ListContentProposalProvider( values ) );
+
+                // fill namingContext values into combo 
+                contextEntryDnCombo.setItems( values );
+
+                // preset combo text
+                if ( Arrays.asList( values ).contains( newEntry.getDn().getUpName() ) )
+                {
+                    contextEntryDnCombo.setText( newEntry.getDn().getUpName() );
+                }
+            }
+
         }
-        else if ( wizard.getSelectedEntry() != null )
+        else
         {
-            parentDn = wizard.getSelectedEntry().getDn();
-        }
 
-        Rdn rdn = newEntry.getRdn();
+            Subschema subschema = newEntry.getSubschema();
+            String[] attributeNames = subschema.getAllAttributeNames();
 
-        dnBuilderWidget.setInput( wizard.getSelectedConnection(), attributeNames, rdn, parentDn );
+            LdapDN parentDn = null;
+            if ( DnUtils.getParent( newEntry.getDn() ) != null )
+            {
+                parentDn = DnUtils.getParent( newEntry.getDn() );
+            }
+            else if ( wizard.getSelectedEntry() != null )
+            {
+                parentDn = wizard.getSelectedEntry().getDn();
+            }
+
+            Rdn rdn = newEntry.getRdn();
+
+            dnBuilderWidget.setInput( wizard.getSelectedConnection(), attributeNames, rdn, parentDn );
+        }
     }
 
 
@@ -187,7 +244,22 @@
             }
 
             // set new DN
-            LdapDN dn = DnUtils.composeDn( dnBuilderWidget.getRdn(), dnBuilderWidget.getParentDn() );
+            LdapDN dn;
+            if ( wizard.isNewContextEntry() )
+            {
+                try
+                {
+                    dn = new LdapDN( contextEntryDnCombo.getText() );
+                }
+                catch ( InvalidNameException e )
+                {
+                    dn = LdapDN.EMPTY_LDAPDN;
+                }
+            }
+            else
+            {
+                dn = DnUtils.composeDn( dnBuilderWidget.getRdn(), dnBuilderWidget.getParentDn() );
+            }
             newEntry.setDn( dn );
 
             // add new RDN
@@ -234,6 +306,11 @@
         {
             loadState();
             validate();
+
+            if ( wizard.isNewContextEntry() )
+            {
+                contextEntryDnCombo.setFocus();
+            }
         }
     }
 
@@ -259,41 +336,46 @@
      */
     public IWizardPage getNextPage()
     {
-        dnBuilderWidget.validate();
-
-        Rdn rdn = dnBuilderWidget.getRdn();
-        LdapDN parentDn = dnBuilderWidget.getParentDn();
-        final LdapDN dn = DnUtils.composeDn( rdn, parentDn );
-
-        // check if parent exists or new entry already exists
-        ReadEntryRunnable readEntryRunnable1 = new ReadEntryRunnable( wizard.getSelectedConnection(), parentDn );
-        RunnableContextRunner.execute( readEntryRunnable1, getContainer(), false );
-        IEntry parentEntry = readEntryRunnable1.getReadEntry();
-        if ( parentEntry == null )
+        if ( !wizard.isNewContextEntry )
         {
-            getShell().getDisplay().syncExec( new Runnable()
+            dnBuilderWidget.validate();
+
+            Rdn rdn = dnBuilderWidget.getRdn();
+            LdapDN parentDn = dnBuilderWidget.getParentDn();
+            final LdapDN dn = DnUtils.composeDn( rdn, parentDn );
+
+            // check if parent exists
+            ReadEntryRunnable readEntryRunnable1 = new ReadEntryRunnable( wizard.getSelectedConnection(), parentDn );
+            RunnableContextRunner.execute( readEntryRunnable1, getContainer(), false );
+            IEntry parentEntry = readEntryRunnable1.getReadEntry();
+            if ( parentEntry == null )
             {
-                public void run()
+                getShell().getDisplay().syncExec( new Runnable()
                 {
-                    MessageDialog.openError( getShell(), "Error", "Parent " + dnBuilderWidget.getParentDn().toString()
-                        + " doesn't exists" );
-                }
-            } );
-            return null;
-        }
-        ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
-        RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
-        IEntry entry = readEntryRunnable2.getReadEntry();
-        if ( entry != null )
-        {
-            getShell().getDisplay().syncExec( new Runnable()
+                    public void run()
+                    {
+                        MessageDialog.openError( getShell(), "Error", "Parent "
+                            + dnBuilderWidget.getParentDn().toString() + " doesn't exists" );
+                    }
+                } );
+                return null;
+            }
+
+            // check that new entry does not exists yet 
+            ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
+            RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
+            IEntry entry = readEntryRunnable2.getReadEntry();
+            if ( entry != null )
             {
-                public void run()
+                getShell().getDisplay().syncExec( new Runnable()
                 {
-                    MessageDialog.openError( getShell(), "Error", "Entry " + dn.toString() + " already exists" );
-                }
-            } );
-            return null;
+                    public void run()
+                    {
+                        MessageDialog.openError( getShell(), "Error", "Entry " + dn.toString() + " already exists" );
+                    }
+                } );
+                return null;
+            }
         }
 
         return super.getNextPage();
@@ -305,11 +387,33 @@
      */
     public void createControl( Composite parent )
     {
-        dnBuilderWidget = new DnBuilderWidget( true, true );
-        dnBuilderWidget.addWidgetModifyListener( this );
-        Composite composite = dnBuilderWidget.createContents( parent );
+        if ( wizard.isNewContextEntry() )
+        {
+            // the combo
+            contextEntryDnCombo = BaseWidgetUtils.createCombo( parent, ArrayUtils.EMPTY_STRING_ARRAY, 0, 1 );
+            contextEntryDnCombo.addModifyListener( new ModifyListener()
+            {
+                public void modifyText( ModifyEvent e )
+                {
+                    validate();
+                }
+            } );
+
+            // attach content proposal behavior
+            contextEntryDnComboCPA = new ContentProposalAdapter( contextEntryDnCombo, new ComboContentAdapter(), null,
+                null, null );
+            contextEntryDnComboCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
+            contextEntryDnComboCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE );
 
-        setControl( composite );
+            setControl( contextEntryDnCombo );
+        }
+        else
+        {
+            dnBuilderWidget = new DnBuilderWidget( true, true );
+            dnBuilderWidget.addWidgetModifyListener( this );
+            Composite composite = dnBuilderWidget.createContents( parent );
+            setControl( composite );
+        }
     }
 
 
@@ -327,7 +431,10 @@
      */
     public void saveDialogSettings()
     {
-        dnBuilderWidget.saveDialogSettings();
+        if ( !wizard.isNewContextEntry() )
+        {
+            dnBuilderWidget.saveDialogSettings();
+        }
     }
 
 }
\ No newline at end of file

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryWizard.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryWizard.java (original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/NewEntryWizard.java Wed Sep  3 02:46:58 2008
@@ -33,6 +33,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 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.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -85,13 +86,16 @@
     /** The prototype entry. */
     protected DummyEntry prototypeEntry;
 
+    /** The is new context entry flag. */
+    protected boolean isNewContextEntry;
+
 
     /**
      * Creates a new instance of NewEntryWizard.
      */
     public NewEntryWizard()
     {
-        setWindowTitle( "New Entry" );
+        //setWindowTitle( "New Entry" );
         setNeedsProgressMonitor( true );
     }
 
@@ -114,6 +118,17 @@
     {
         // determine the currently selected entry
         Object o = selection.getFirstElement();
+        
+        isNewContextEntry = isNewContextEntry( selection );
+        if(isNewContextEntry)
+        {
+            setWindowTitle( "New Context Entry" );
+        }
+        else
+        {
+            setWindowTitle( "New Entry" );
+        }
+        
         if ( o instanceof IEntry )
         {
             selectedEntry = ( ( IEntry ) o );
@@ -376,4 +391,39 @@
         this.prototypeEntry = getPrototypeEntry;
     }
 
+
+    /**
+     * Checks if is new context entry.
+     * 
+     * @return true, if is new context entry
+     */
+    public boolean isNewContextEntry()
+    {
+        return isNewContextEntry;
+    }
+
+
+    /**
+     * Checks if the current selection starts the "New Context Entry" process.
+     * This is if the selection is the Root DSE.
+     * 
+     * @param selection the selection
+     * 
+     * @return true, if is new context entry
+     */
+    public static boolean isNewContextEntry( IStructuredSelection selection )
+    {
+        if ( selection != null )
+        {
+            Object object = selection.getFirstElement();
+
+            if ( object instanceof IRootDSE || object instanceof BrowserCategory )
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
 }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryRunnable.java Wed Sep  3 02:46:58 2008
@@ -114,7 +114,6 @@
         if ( !monitor.errorsReported() )
         {
             createdEntry = ReadEntryRunnable.getEntry( browserConnection, entryToCreate.getDn(), monitor );
-            // createdEntries[i].getParententry().addChild(entry, this);
             createdEntry.setHasChildrenHint( false );
         }
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java Wed Sep  3 02:46:58 2008
@@ -36,10 +36,10 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
-import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributesInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -73,11 +73,11 @@
 
     /** The requested attributes when reading the Root DSE. */
     public static final String[] ROOT_DSE_ATTRIBUTES =
-        { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS,
-            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDLDAPVERSION, IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY,
-            IRootDSE.ROOTDSE_ATTRIBUTE_ALTSERVER, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION,
-            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES,
-            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDSASLMECHANISM, ISearch.ALL_OPERATIONAL_ATTRIBUTES };
+        { IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS, IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDLDAPVERSION, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDSASLMECHANISM,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION, IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES, IRootDSE.ROOTDSE_ATTRIBUTE_VENDORNAME,
+            IRootDSE.ROOTDSE_ATTRIBUTE_VENDORVERSION, ISearch.ALL_OPERATIONAL_ATTRIBUTES };
 
 
     /**
@@ -180,7 +180,7 @@
      * @param initOperationalAttributes true if operational attributes should be initialized
      * @param monitor the progress monitor
      */
-    public static void initializeAttributes( IEntry entry, boolean initOperationalAttributes,
+    public static synchronized void initializeAttributes( IEntry entry, boolean initOperationalAttributes,
         StudioProgressMonitor monitor )
     {
         // get user attributes or both user and operational attributes
@@ -219,7 +219,8 @@
      * @param clearAllAttributes true to clear all old attributes before searching
      * @param monitor the progress monitor
      */
-    public static void initializeAttributes( IEntry entry, String[] attributes, boolean clearAllAttributes, StudioProgressMonitor monitor )
+    public static synchronized void initializeAttributes( IEntry entry, String[] attributes,
+        boolean clearAllAttributes, StudioProgressMonitor monitor )
     {
         monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_att,
             new String[]
@@ -262,7 +263,7 @@
                     }
                 }
             }
-            
+
             // search
             ISearch search = new Search( null, entry.getBrowserConnection(), entry.getDn(),
                 entry.isSubentry() ? ISearch.FILTER_SUBENTRY : ISearch.FILTER_TRUE, attributes, SearchScope.OBJECT, 0,
@@ -283,7 +284,7 @@
      * 
      * @throws Exception the exception
      */
-    static void loadRootDSE( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
+    static synchronized void loadRootDSE( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
     {
         // delete old children
         IEntry[] oldChildren = browserConnection.getRootDSE().getChildren();
@@ -308,13 +309,13 @@
                 browserConnection.getRootDSE().deleteAttribute( oldAttribute );
             }
         }
-        
+
         // load well-known Root DSE attributes and operational attributes
-        ISearch search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE, ROOT_DSE_ATTRIBUTES,
-            SearchScope.OBJECT, 0, 0, Connection.AliasDereferencingMethod.NEVER,
+        ISearch search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE,
+            ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0, Connection.AliasDereferencingMethod.NEVER,
             Connection.ReferralHandlingMethod.IGNORE, false, null );
         SearchRunnable.searchAndUpdateModel( browserConnection, search, monitor );
-        
+
         // load all user attributes
         search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE, new String[]
             { ISearch.ALL_USER_ATTRIBUTES }, SearchScope.OBJECT, 0, 0, Connection.AliasDereferencingMethod.NEVER,
@@ -352,7 +353,7 @@
                     namingContextSet.add( values[i] );
                 }
             }
-            
+
             if ( !namingContextSet.isEmpty() )
             {
                 for ( String namingContext : namingContextSet )
@@ -420,8 +421,7 @@
         StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
         for ( IEntry entry : rootDseEntries.values() )
         {
-            initBaseEntry( entry.getBrowserConnection(), entry.getDn(), dummyMonitor );
-            // TODO: log if a base entry doesn't exist
+            initBaseEntry( entry, dummyMonitor );
         }
 
         // set flags
@@ -433,25 +433,31 @@
     }
 
 
-    private static void initBaseEntry( IBrowserConnection browserConnection, LdapDN dn, StudioProgressMonitor monitor )
+    private static void initBaseEntry( IEntry entry, StudioProgressMonitor monitor )
     {
-        ISearch search;
-        IEntry entry;
+        IBrowserConnection browserConnection = entry.getBrowserConnection();
+        LdapDN dn = entry.getDn();
+
         // search the entry
         AliasDereferencingMethod derefAliasMethod = browserConnection.getAliasesDereferencingMethod();
         ReferralHandlingMethod handleReferralsMethod = browserConnection.getReferralsHandlingMethod();
-        search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES,
+        ISearch search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES,
             SearchScope.OBJECT, 1, 0, derefAliasMethod, handleReferralsMethod, true, null );
         SearchRunnable.searchAndUpdateModel( browserConnection, search, monitor );
 
-        // add entry to Root DSE
         ISearchResult[] results = search.getSearchResults();
         if ( results != null && results.length == 1 )
         {
+            // add entry to Root DSE
             ISearchResult result = results[0];
             entry = result.getEntry();
             browserConnection.getRootDSE().addChild( entry );
         }
+        else
+        {
+            // DN exists in the Root DSE, but doesn't exist in directory
+            browserConnection.uncacheEntryRecursive( entry );
+        }
     }
 
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java Wed Sep  3 02:46:58 2008
@@ -149,6 +149,13 @@
             IBrowserConnection browserConnection = entry.getBrowserConnection();
             if ( browserConnection != null && entry.isDirectoryEntry() )
             {
+                if ( entry instanceof IRootDSE )
+                {
+                    // special handling for Root DSE.
+                    InitializeAttributesRunnable.loadRootDSE( browserConnection, monitor );
+                    continue;
+                }
+
                 if ( pagedSearchControl == null && browserConnection.isPagedSearch() )
                 {
                     pagedSearchControl = new StudioPagedResultsControl( browserConnection.getPagedSearchSize(), null,
@@ -186,136 +193,128 @@
     private static void initializeChildren( IEntry parent, StudioProgressMonitor monitor,
         StudioControl pagedSearchControl )
     {
-        if ( parent instanceof IRootDSE )
-        {
-            // special handling for Root DSE
-            return;
-        }
-        else
-        {
-            monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_sub,
-                new String[]
-                    { parent.getDn().getUpName() } ) );
+        monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_sub,
+            new String[]
+                { parent.getDn().getUpName() } ) );
 
-            // clear old children
-            clearParent( parent );
+        // clear old children
+        clearParent( parent );
 
-            // create search
-            ISearch search = createSearch( parent, pagedSearchControl, false );
+        // create search
+        ISearch search = createSearch( parent, pagedSearchControl, false );
 
-            // search
-            ISearchResult[] srs = executeSearch( parent, search, monitor );
+        // search
+        ISearchResult[] srs = executeSearch( parent, search, monitor );
 
-            // fill children in search result
-            if ( srs != null && srs.length > 0 )
-            {
-                // clearing old children before filling new children is
-                // necessary to handle aliases and referrals.
-                clearParent( parent );
+        // fill children in search result
+        if ( srs != null && srs.length > 0 )
+        {
+            // clearing old children before filling new children is
+            // necessary to handle aliases and referrals.
+            clearParent( parent );
 
-                do
+            do
+            {
+                for ( ISearchResult searchResult : srs )
                 {
-                    for ( ISearchResult searchResult : srs )
+                    if ( parent.isAlias() && !( searchResult.getEntry() instanceof AliasBaseEntry ) )
                     {
-                        if ( parent.isAlias() && !( searchResult.getEntry() instanceof AliasBaseEntry ) )
-                        {
-                            AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( searchResult.getEntry()
-                                .getBrowserConnection(), searchResult.getEntry().getDn() );
-                            parent.addChild( aliasBaseEntry );
-                        }
-                        else
-                        {
-                            parent.addChild( searchResult.getEntry() );
-                        }
+                        AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( searchResult.getEntry()
+                            .getBrowserConnection(), searchResult.getEntry().getDn() );
+                        parent.addChild( aliasBaseEntry );
+                    }
+                    else
+                    {
+                        parent.addChild( searchResult.getEntry() );
                     }
-                    srs = null;
+                }
+                srs = null;
 
-                    StudioPagedResultsControl sprRequestControl = null;
-                    StudioPagedResultsControl sprResponseControl = null;
-                    for ( StudioControl responseControl : search.getResponseControls() )
+                StudioPagedResultsControl sprRequestControl = null;
+                StudioPagedResultsControl sprResponseControl = null;
+                for ( StudioControl responseControl : search.getResponseControls() )
+                {
+                    if ( responseControl instanceof StudioPagedResultsControl )
                     {
-                        if ( responseControl instanceof StudioPagedResultsControl )
-                        {
-                            sprResponseControl = ( StudioPagedResultsControl ) responseControl;
-                        }
+                        sprResponseControl = ( StudioPagedResultsControl ) responseControl;
                     }
-                    for ( StudioControl requestControl : search.getControls() )
+                }
+                for ( StudioControl requestControl : search.getControls() )
+                {
+                    if ( requestControl instanceof StudioPagedResultsControl )
                     {
-                        if ( requestControl instanceof StudioPagedResultsControl )
-                        {
-                            sprRequestControl = ( StudioPagedResultsControl ) requestControl;
-                        }
+                        sprRequestControl = ( StudioPagedResultsControl ) requestControl;
                     }
+                }
 
-                    if ( sprRequestControl != null && sprResponseControl != null )
+                if ( sprRequestControl != null && sprResponseControl != null )
+                {
+                    if ( sprRequestControl.isScrollMode() )
                     {
-                        if ( sprRequestControl.isScrollMode() )
+                        if ( sprRequestControl.getCookie() != null )
                         {
-                            if ( sprRequestControl.getCookie() != null )
-                            {
-                                // create top page search runnable, same as original search
-                                InitializeChildrenRunnable topPageChildrenRunnable = new InitializeChildrenRunnable(
-                                    parent, null );
-                                parent.setTopPageChildrenRunnable( topPageChildrenRunnable );
-                            }
-
-                            if ( sprResponseControl.getCookie() != null )
-                            {
-                                StudioPagedResultsControl newSprc = new StudioPagedResultsControl( sprRequestControl
-                                    .getSize(), sprResponseControl.getCookie(), sprRequestControl.isCritical(),
-                                    sprRequestControl.isScrollMode() );
-                                InitializeChildrenRunnable nextPageChildrenRunnable = new InitializeChildrenRunnable(
-                                    parent, newSprc );
-                                parent.setNextPageChildrenRunnable( nextPageChildrenRunnable );
-                            }
+                            // create top page search runnable, same as original search
+                            InitializeChildrenRunnable topPageChildrenRunnable = new InitializeChildrenRunnable(
+                                parent, null );
+                            parent.setTopPageChildrenRunnable( topPageChildrenRunnable );
+                        }
+
+                        if ( sprResponseControl.getCookie() != null )
+                        {
+                            StudioPagedResultsControl newSprc = new StudioPagedResultsControl( sprRequestControl
+                                .getSize(), sprResponseControl.getCookie(), sprRequestControl.isCritical(),
+                                sprRequestControl.isScrollMode() );
+                            InitializeChildrenRunnable nextPageChildrenRunnable = new InitializeChildrenRunnable(
+                                parent, newSprc );
+                            parent.setNextPageChildrenRunnable( nextPageChildrenRunnable );
                         }
-                        else
+                    }
+                    else
+                    {
+                        // transparently continue search, till count limit is reached
+                        if ( sprResponseControl.getCookie() != null
+                            && ( search.getCountLimit() == 0 || search.getSearchResults().length < search
+                                .getCountLimit() ) )
                         {
-                            // transparently continue search, till count limit is reached
-                            if ( sprResponseControl.getCookie() != null
-                                && ( search.getCountLimit() == 0 || search.getSearchResults().length < search
-                                    .getCountLimit() ) )
-                            {
-
-                                search.setSearchResults( new ISearchResult[0] );
-                                search.getResponseControls().clear();
-                                sprRequestControl.setCookie( sprResponseControl.getCookie() );
 
-                                srs = executeSearch( parent, search, monitor );
-                            }
+                            search.setSearchResults( new ISearchResult[0] );
+                            search.getResponseControls().clear();
+                            sprRequestControl.setCookie( sprResponseControl.getCookie() );
+
+                            srs = executeSearch( parent, search, monitor );
                         }
                     }
                 }
-                while ( srs != null && srs.length > 0 );
-            }
-            else
-            {
-                parent.setHasChildrenHint( false );
             }
+            while ( srs != null && srs.length > 0 );
+        }
+        else
+        {
+            parent.setHasChildrenHint( false );
+        }
 
-            // get sub-entries
-            ISearch subSearch = createSearch( parent, null, true );
-            if ( parent.getBrowserConnection().isFetchSubentries() )
-            {
-                ISearchResult[] subSrs = executeSearch( parent, subSearch, monitor );
+        // get sub-entries
+        ISearch subSearch = createSearch( parent, null, true );
+        if ( parent.getBrowserConnection().isFetchSubentries() )
+        {
+            ISearchResult[] subSrs = executeSearch( parent, subSearch, monitor );
 
-                // fill children in search result
-                if ( subSrs != null && subSrs.length > 0 )
+            // fill children in search result
+            if ( subSrs != null && subSrs.length > 0 )
+            {
+                for ( ISearchResult searchResult : subSrs )
                 {
-                    for ( ISearchResult searchResult : subSrs )
-                    {
-                        parent.addChild( searchResult.getEntry() );
-                    }
+                    parent.addChild( searchResult.getEntry() );
                 }
             }
+        }
 
-            // check exceeded limits / canceled
-            parent.setHasMoreChildren( search.isCountLimitExceeded() || subSearch.isCountLimitExceeded()
-                || monitor.isCanceled() );
+        // check exceeded limits / canceled
+        parent.setHasMoreChildren( search.isCountLimitExceeded() || subSearch.isCountLimitExceeded()
+            || monitor.isCanceled() );
 
-            // set initialized state
-            parent.setChildrenInitialized( true );
-        }
+        // set initialized state
+        parent.setChildrenInitialized( true );
     }
 
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java Wed Sep  3 02:46:58 2008
@@ -63,6 +63,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
+import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.BaseDNEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Entry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
@@ -335,7 +336,7 @@
                         IEntry entry = resultBrowserConnection.getEntryFromCache( dn );
                         if ( entry == null )
                         {
-                            entry = createAndCacheEntry( resultBrowserConnection, dn );
+                            entry = createAndCacheEntry( resultBrowserConnection, dn, monitor );
                         }
 
                         // initialize special flags
@@ -580,11 +581,14 @@
      * 
      * @param browserConnection the browser connection
      * @param dn the DN of the entry
+     * @param monitor 
      * 
      * @return the created entry
      */
-    private static IEntry createAndCacheEntry( IBrowserConnection browserConnection, LdapDN dn )
+    private static IEntry createAndCacheEntry( IBrowserConnection browserConnection, LdapDN dn,
+        StudioProgressMonitor monitor )
     {
+        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
         IEntry entry = null;
 
         // build tree to parent
@@ -595,32 +599,59 @@
             parentDnList.addFirst( parentDN );
             parentDN = DnUtils.getParent( parentDN );
         }
+
         for ( LdapDN aDN : parentDnList )
         {
             parentDN = DnUtils.getParent( aDN );
             if ( parentDN == null )
             {
-                entry = new BaseDNEntry( aDN, browserConnection );
-                browserConnection.cacheEntry( entry );
+                entry = browserConnection.getRootDSE();
             }
             else if ( browserConnection.getEntryFromCache( parentDN ) != null )
             {
-                IEntry parentEntry = browserConnection.getEntryFromCache( parentDN );
-                entry = new Entry( parentEntry, aDN.getRdn() );
-                entry.setDirectoryEntry( true );
-
-                parentEntry.addChild( entry );
-                // parentEntry.setAttributesInitialized(false, this);
-
-                parentEntry.setChildrenInitialized( true );
-                parentEntry.setHasMoreChildren( true );
-                parentEntry.setHasChildrenHint( true );
+                // check if the entry really exists
+                // if not a base dn entry will be created in then next iteration
+                SearchParameter searchParameter = new SearchParameter();
+                searchParameter.setSearchBase( aDN );
+                searchParameter.setFilter( null );
+                searchParameter.setReturningAttributes( ISearch.NO_ATTRIBUTES );
+                searchParameter.setScope( SearchScope.OBJECT );
+                searchParameter.setCountLimit( 1 );
+                searchParameter.setTimeLimit( 0 );
+                searchParameter.setAliasesDereferencingMethod( browserConnection.getAliasesDereferencingMethod() );
+                searchParameter.setReferralsHandlingMethod( browserConnection.getReferralsHandlingMethod() );
+                searchParameter.setInitHasChildrenFlag( true );
+                dummyMonitor.reset();
+                StudioNamingEnumeration enumeration = search( browserConnection, searchParameter, dummyMonitor );
+                try
+                {
+                    if ( enumeration != null && enumeration.hasMore() )
+                    {
+                        // entry exists, create entry and establish parent-child connection
+                        IEntry parentEntry = browserConnection.getEntryFromCache( parentDN );
+                        entry = new Entry( parentEntry, aDN.getRdn() );
+                        entry.setDirectoryEntry( true );
 
-                browserConnection.cacheEntry( entry );
+                        parentEntry.addChild( entry );
+                        // parentEntry.setAttributesInitialized(false, this);
+
+                        parentEntry.setChildrenInitialized( true );
+                        parentEntry.setHasMoreChildren( true );
+                        parentEntry.setHasChildrenHint( true );
+
+                        browserConnection.cacheEntry( entry );
+                    }
+                }
+                catch ( NamingException e )
+                {
+                }
             }
             else
             {
-                // ??
+                // create base dn entry
+                entry = new BaseDNEntry( aDN, browserConnection );
+                browserConnection.getRootDSE().addChild( entry );
+                browserConnection.cacheEntry( entry );
             }
         }
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java?rev=691556&r1=691555&r2=691556&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java Wed Sep  3 02:46:58 2008
@@ -62,7 +62,13 @@
 
     /** The supportedSASLMechanisms attribute */
     public static final String ROOTDSE_ATTRIBUTE_SUPPORTEDSASLMECHANISM = "supportedSASLMechanisms"; //$NON-NLS-1$
-
+    
+    /** The vendorName attribute */
+    public static final String ROOTDSE_ATTRIBUTE_VENDORNAME = "vendorName"; //$NON-NLS-1$
+
+    /** The vendorVersion attribute */
+    public static final String ROOTDSE_ATTRIBUTE_VENDORVERSION = "vendorVersion"; //$NON-NLS-1$
+    
     /** The OID of feature 'All Operational Attributes' */
     public static final String FEATURE_ALL_OPERATIONAL_ATTRIBUTES_OID = "1.3.6.1.4.1.4203.1.5.1"; //$NON-NLS-1$
 

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=691556&r1=691555&r2=691556&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 Wed Sep  3 02:46:58 2008
@@ -32,7 +32,7 @@
 
 
 /**
- * This Action lauches the New Entry Wizard.
+ * This action launches the New Entry Wizard.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -90,8 +90,7 @@
     {
         NewEntryWizard wizard = new NewEntryWizard();
 
-        wizard.init( this.window.getWorkbench(), ( IStructuredSelection ) this.window.getSelectionService()
-            .getSelection() );
+        wizard.init( window.getWorkbench(), ( IStructuredSelection ) window.getSelectionService().getSelection() );
         WizardDialog dialog = new WizardDialog( getShell(), wizard );
         dialog.setBlockOnOpen( true );
         dialog.create();
@@ -104,7 +103,9 @@
      */
     public String getText()
     {
-        return "New Entry...";
+        boolean isNewContextEntry = NewEntryWizard.isNewContextEntry( ( IStructuredSelection ) window
+            .getSelectionService().getSelection() );
+        return isNewContextEntry ? "New Context Entry..." : "New Entry...";
     }
 
 
@@ -133,4 +134,5 @@
     {
         return true;
     }
+
 }



Mime
View raw message