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 2007/08/27 00:36:14 UTC
svn commit: r569899 [3/9] - in /directory/studio/trunk:
studio-aciitemeditor/META-INF/
studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/
studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueedito...
Added: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java?rev=569899&view=auto
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java (added)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java Sun Aug 26 15:36:01 2007
@@ -0,0 +1,406 @@
+/*
+ * 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.common.widgets.connection;
+
+
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionParameter;
+import org.apache.directory.studio.connection.ui.AbstractConnectionParameterPage;
+import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.ldapbrowser.common.widgets.search.AliasesDereferencingWidget;
+import org.apache.directory.studio.ldapbrowser.common.widgets.search.LimitWidget;
+import org.apache.directory.studio.ldapbrowser.common.widgets.search.ReferralsHandlingWidget;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.jobs.FetchBaseDNsJob;
+import org.apache.directory.studio.ldapbrowser.core.model.DN;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.NameException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+
+
+/**
+ * The BrowserParameterPage is used the edit the browser specific parameters of a
+ * connection.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class BrowserParameterPage extends AbstractConnectionParameterPage
+{
+
+ /** The checkbox to fetch the base DN's from namingContexts whenever opening the connection */
+ private Button autoFetchBaseDnsButton;
+
+ /** The button to fetch the base DN's from namingContexts attribute */
+ private Button fetchBaseDnsButton;
+
+ /** The combo that displays the fetched base DN's */
+ private Combo baseDNCombo;
+
+ /** The widget with the count and time limits */
+ private LimitWidget limitWidget;
+
+ /** The widget to select the alias dereferencing method */
+ private AliasesDereferencingWidget aliasesDereferencingWidget;
+
+ /** The widget to select the referrals handling method */
+ private ReferralsHandlingWidget referralsHandlingWidget;
+
+
+ /**
+ * Creates a new instance of BrowserParameterPage.
+ */
+ public BrowserParameterPage()
+ {
+ }
+
+
+ /**
+ * Returns true if base DN's should be fetched
+ * whenever opening the connection.
+ *
+ * @return true, if base DN's should be fetched
+ */
+ private boolean isAutoFetchBaseDns()
+ {
+ return autoFetchBaseDnsButton.getSelection();
+ }
+
+
+ /**
+ * Gets the base DN.
+ *
+ * @return the base DN
+ */
+ private String getBaseDN()
+ {
+ return baseDNCombo.getText();
+ }
+
+
+ /**
+ * Gets the count limit.
+ *
+ * @return the count limit
+ */
+ private int getCountLimit()
+ {
+ return limitWidget.getCountLimit();
+ }
+
+
+ /**
+ * Gets the time limit.
+ *
+ * @return the time limit
+ */
+ private int getTimeLimit()
+ {
+ return limitWidget.getTimeLimit();
+ }
+
+
+ /**
+ * Gets the aliases dereferencing method.
+ *
+ * @return the aliases dereferencing method
+ */
+ private int getAliasesDereferencingMethod()
+ {
+ return aliasesDereferencingWidget.getAliasesDereferencingMethod();
+ }
+
+
+ /**
+ * Gets the referrals handling method.
+ *
+ * @return the referrals handling method
+ */
+ private int getReferralsHandlingMethod()
+ {
+ return referralsHandlingWidget.getReferralsHandlingMethod();
+ }
+
+
+ /**
+ * Gets a temporary connection with all conection parameter
+ * entered in this page.
+ *
+ * @return a test connection
+ */
+ private Connection getTestConnection()
+ {
+ ConnectionParameter cp = connectionParameterPageModifyListener.getTestConnectionParameters();
+ Connection conn = new Connection( cp );
+ return conn;
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#createComposite(org.eclipse.swt.widgets.Composite)
+ */
+ public void createComposite( Composite parent )
+ {
+ addBaseDNInput( parent );
+ addLimitInput( parent );
+ validate();
+ }
+
+
+ /**
+ * Adds the base DN input.
+ *
+ * @param parent the parent
+ */
+ private void addBaseDNInput( Composite parent )
+ {
+ Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
+
+ Group group = BaseWidgetUtils.createGroup( composite, "Base DN", 1 );
+ Composite groupComposite = BaseWidgetUtils.createColumnContainer( group, 3, 1 );
+ GridData gd;
+
+ autoFetchBaseDnsButton = BaseWidgetUtils.createCheckbox( groupComposite, "Get base DNs from Root DSE", 2 );
+ autoFetchBaseDnsButton.setSelection( true );
+ autoFetchBaseDnsButton.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent arg0 )
+ {
+ connectionPageModified();
+ }
+ } );
+
+ fetchBaseDnsButton = new Button( groupComposite, SWT.PUSH );
+ fetchBaseDnsButton.setText( "Fetch Base DNs" );
+ fetchBaseDnsButton.setEnabled( true );
+ gd = new GridData();
+ gd.horizontalAlignment = SWT.RIGHT;
+ fetchBaseDnsButton.setLayoutData( gd );
+ fetchBaseDnsButton.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ Connection connection = getTestConnection();
+ IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
+ .getBrowserConnection( connection );
+
+ FetchBaseDNsJob job = new FetchBaseDNsJob( browserConnection );
+ RunnableContextJobAdapter.execute( job, runnableContext );
+ if ( job.getExternalResult().isOK() )
+ {
+ if ( job.getBaseDNs().length > 0 )
+ {
+ String[] baseDNs = job.getBaseDNs();
+ baseDNCombo.setItems( baseDNs );
+ baseDNCombo.select( 0 );
+
+ String msg = "The server returned the following base DNs:";
+ for ( int i = 0; i < baseDNs.length; i++ )
+ {
+ msg += "\n - " + baseDNs[i];
+ }
+ MessageDialog.openInformation( Display.getDefault().getActiveShell(), "Fetch Base DNs", msg );
+ }
+ else
+ {
+ MessageDialog.openWarning( Display.getDefault().getActiveShell(), "Fetch Base DNs",
+ "No base DN returned from server. Please enter the base DN manually." );
+ autoFetchBaseDnsButton.setSelection( false );
+ }
+ }
+ }
+ } );
+
+ BaseWidgetUtils.createLabel( groupComposite, "Base DN:", 1 );
+ baseDNCombo = BaseWidgetUtils.createCombo( groupComposite, new String[0], 0, 2 );
+ baseDNCombo.addModifyListener( new ModifyListener()
+ {
+ public void modifyText( ModifyEvent event )
+ {
+ connectionPageModified();
+ }
+ } );
+ }
+
+
+ /**
+ * Adds the limit input.
+ *
+ * @param parent the parent
+ */
+ public void addLimitInput( Composite parent )
+ {
+ Composite composite = BaseWidgetUtils.createColumnContainer( parent, 3, 1 );
+
+ limitWidget = new LimitWidget();
+ limitWidget.createWidget( composite );
+
+ aliasesDereferencingWidget = new AliasesDereferencingWidget();
+ aliasesDereferencingWidget.createWidget( composite );
+
+ referralsHandlingWidget = new ReferralsHandlingWidget();
+ referralsHandlingWidget.createWidget( composite );
+ }
+
+
+ /**
+ * Called when an input field was modified.
+ */
+ private void connectionPageModified()
+ {
+ validate();
+ fireConnectionPageModified();
+ }
+
+
+ /**
+ * Validates the input fields after each modification.
+ */
+ private void validate()
+ {
+ // set enabled/disabled state of fields and buttons
+ baseDNCombo.setEnabled( !autoFetchBaseDnsButton.getSelection() );
+
+ // validate input fields
+ message = null;
+ errorMessage = null;
+ try
+ {
+ new DN( baseDNCombo.getText() );
+ }
+ catch ( NameException e )
+ {
+ message = "Please enter a valid base DN.";
+ }
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#loadParameters(org.apache.directory.studio.connection.core.ConnectionParameter)
+ */
+ public void loadParameters( ConnectionParameter parameter )
+ {
+ this.connectionParameter = parameter;
+
+ boolean fetchBaseDns = parameter
+ .getExtendedBoolProperty( IBrowserConnection.CONNECTION_PARAMETER_FETCH_BASE_DNS );
+ autoFetchBaseDnsButton.setSelection( fetchBaseDns );
+ String baseDn = parameter.getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_BASE_DN );
+ baseDNCombo.setText( baseDn != null ? baseDn : "" );
+
+ int countLimit = parameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT );
+ limitWidget.setCountLimit( countLimit );
+ int timeLimit = parameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT );
+ limitWidget.setTimeLimit( timeLimit );
+
+ int referralsHandlingMethod = parameter
+ .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD );
+ referralsHandlingWidget.setReferralsHandlingMethod( referralsHandlingMethod );
+ int aliasesDereferencingMethod = parameter
+ .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD );
+ aliasesDereferencingWidget.setAliasesDereferencingMethod( aliasesDereferencingMethod );
+
+ connectionPageModified();
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#saveParameters(org.apache.directory.studio.connection.core.ConnectionParameter)
+ */
+ public void saveParameters( ConnectionParameter parameter )
+ {
+ parameter
+ .setExtendedBoolProperty( IBrowserConnection.CONNECTION_PARAMETER_FETCH_BASE_DNS, isAutoFetchBaseDns() );
+ parameter.setExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_BASE_DN, getBaseDN() );
+ parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT, getCountLimit() );
+ parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT, getTimeLimit() );
+ parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,
+ getReferralsHandlingMethod() );
+ parameter.setExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD,
+ getAliasesDereferencingMethod() );
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#saveDialogSettings()
+ */
+ public void saveDialogSettings()
+ {
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#setFocus()
+ */
+ public void setFocus()
+ {
+ baseDNCombo.setFocus();
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#areParametersModifed()
+ */
+ public boolean areParametersModifed()
+ {
+ int countLimit = connectionParameter
+ .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_COUNT_LIMIT );
+ int timeLimit = connectionParameter.getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_TIME_LIMIT );
+ int referralsHandlingMethod = connectionParameter
+ .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD );
+ int aliasesDereferencingMethod = connectionParameter
+ .getExtendedIntProperty( IBrowserConnection.CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD );
+
+ return isReconnectionRequired() || countLimit != getCountLimit() || timeLimit != getTimeLimit()
+ || referralsHandlingMethod != getReferralsHandlingMethod()
+ || aliasesDereferencingMethod != getAliasesDereferencingMethod();
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.ui.ConnectionParameterPage#isReconnectionRequired()
+ */
+ public boolean isReconnectionRequired()
+ {
+ if ( connectionParameter == null )
+ {
+ return true;
+ }
+
+ boolean fetchBaseDns = connectionParameter
+ .getExtendedBoolProperty( IBrowserConnection.CONNECTION_PARAMETER_FETCH_BASE_DNS );
+ String baseDn = connectionParameter.getExtendedProperty( IBrowserConnection.CONNECTION_PARAMETER_BASE_DN );
+ return fetchBaseDns != isAutoFetchBaseDns() || !( baseDn.equals( getBaseDN() ) );
+ }
+
+}
Propchange: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/BrowserParameterPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionUniversalListener.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionUniversalListener.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/connection/ConnectionUniversalListener.java Sun Aug 26 15:36:01 2007
@@ -21,19 +21,6 @@
package org.apache.directory.studio.ldapbrowser.common.widgets.connection;
-import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
-import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateEvent;
-import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateListener;
-import org.apache.directory.studio.ldapbrowser.core.events.ConnectionUpdateEvent;
-import org.apache.directory.studio.ldapbrowser.core.events.ConnectionUpdateListener;
-import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
-import org.apache.directory.studio.ldapbrowser.core.events.EntryUpdateListener;
-import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
-import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
-import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateListener;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
/**
@@ -42,108 +29,109 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class ConnectionUniversalListener implements ConnectionUpdateListener, EntryUpdateListener,
- SearchUpdateListener, BookmarkUpdateListener
-{
-
- /** The table viewer */
- protected TableViewer viewer;
-
-
- /**
- * Creates a new instance of ConnectionUniversalListener.
- *
- * @param viewer the table viewer
- */
- public ConnectionUniversalListener( TableViewer viewer )
- {
- this.viewer = viewer;
-
- EventRegistry.addConnectionUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
- EventRegistry.addEntryUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
- EventRegistry.addSearchUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
- EventRegistry.addBookmarkUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
- }
-
-
- /**
- * Disposes this universal listener.
- */
- public void dispose()
- {
- if ( viewer != null )
- {
- EventRegistry.removeConnectionUpdateListener( this );
- EventRegistry.removeEntryUpdateListener( this );
- EventRegistry.removeSearchUpdateListener( this );
- EventRegistry.removeBookmarkUpdateListener( this );
- viewer = null;
- }
- }
-
-
- /**
- * {@inheritDoc}
- *
- * This implementation refreshes the viewer. If a new connection was added
- * this connection is selected.
- */
- public void connectionUpdated( ConnectionUpdateEvent connectionUpdateEvent )
- {
- if ( viewer != null )
- {
- viewer.refresh();
- if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_ADDED )
- {
- viewer.setSelection( new StructuredSelection( connectionUpdateEvent.getConnection() ) );
- }
- }
- }
-
-
- /**
- * {@inheritDoc}
- *
- * This implementation refreshes the viewer.
- */
- public void entryUpdated( EntryModificationEvent event )
- {
- if ( viewer != null )
- {
- viewer.refresh();
- }
- }
-
-
- /**
- * {@inheritDoc}
- *
- * This implementation refreshes the viewer.
- */
- public void searchUpdated( SearchUpdateEvent searchUpdateEvent )
- {
- if ( viewer != null )
- {
- viewer.refresh();
-
- // select the right connection
- ISearch search = searchUpdateEvent.getSearch();
- viewer.setSelection( new StructuredSelection( search.getConnection() ), true );
- }
- }
-
-
- /**
- * {@inheritDoc}
- *
- * This implementation refreshes the viewer.
- */
- public void bookmarkUpdated( BookmarkUpdateEvent bookmarkUpdateEvent )
- {
- if ( viewer != null )
- {
- viewer.refresh();
- }
- }
-
-}
+public class ConnectionUniversalListener{private ConnectionUniversalListener(){}}
+//implements ConnectionUpdateListener, EntryUpdateListener,
+// SearchUpdateListener, BookmarkUpdateListener
+//{
+//
+// /** The table viewer */
+// protected TableViewer viewer;
+//
+//
+// /**
+// * Creates a new instance of ConnectionUniversalListener.
+// *
+// * @param viewer the table viewer
+// */
+// public ConnectionUniversalListener( TableViewer viewer )
+// {
+// this.viewer = viewer;
+//
+// EventRegistry.addConnectionUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
+// EventRegistry.addEntryUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
+// EventRegistry.addSearchUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
+// EventRegistry.addBookmarkUpdateListener( this, BrowserCommonActivator.getDefault().getEventRunner() );
+// }
+//
+//
+// /**
+// * Disposes this universal listener.
+// */
+// public void dispose()
+// {
+// if ( viewer != null )
+// {
+// EventRegistry.removeConnectionUpdateListener( this );
+// EventRegistry.removeEntryUpdateListener( this );
+// EventRegistry.removeSearchUpdateListener( this );
+// EventRegistry.removeBookmarkUpdateListener( this );
+// viewer = null;
+// }
+// }
+//
+//
+// /**
+// * {@inheritDoc}
+// *
+// * This implementation refreshes the viewer. If a new connection was added
+// * this connection is selected.
+// */
+// public void connectionUpdated( ConnectionUpdateEvent connectionUpdateEvent )
+// {
+// if ( viewer != null )
+// {
+// viewer.refresh();
+// if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_ADDED )
+// {
+// viewer.setSelection( new StructuredSelection( connectionUpdateEvent.getConnection() ) );
+// }
+// }
+// }
+//
+//
+// /**
+// * {@inheritDoc}
+// *
+// * This implementation refreshes the viewer.
+// */
+// public void entryUpdated( EntryModificationEvent event )
+// {
+// if ( viewer != null )
+// {
+// viewer.refresh();
+// }
+// }
+//
+//
+// /**
+// * {@inheritDoc}
+// *
+// * This implementation refreshes the viewer.
+// */
+// public void searchUpdated( SearchUpdateEvent searchUpdateEvent )
+// {
+// if ( viewer != null )
+// {
+// viewer.refresh();
+//
+// // select the right connection
+// ISearch search = searchUpdateEvent.getSearch();
+// viewer.setSelection( new StructuredSelection( search.getConnection() ), true );
+// }
+// }
+//
+//
+// /**
+// * {@inheritDoc}
+// *
+// * This implementation refreshes the viewer.
+// */
+// public void bookmarkUpdated( BookmarkUpdateEvent bookmarkUpdateEvent )
+// {
+// if ( viewer != null )
+// {
+// viewer.refresh();
+// }
+// }
+//
+//}
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/entryeditor/EntryEditorWidgetUniversalListener.java Sun Aug 26 15:36:01 2007
@@ -22,7 +22,7 @@
import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
-import org.apache.directory.studio.ldapbrowser.common.actions.SelectionUtils;
+import org.apache.directory.studio.ldapbrowser.common.actions.BrowserSelectionUtils;
import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
import org.apache.directory.studio.ldapbrowser.core.events.EmptyValueAddedEvent;
import org.apache.directory.studio.ldapbrowser.core.events.EmptyValueDeletedEvent;
@@ -95,8 +95,8 @@
*/
public void mouseDoubleClick( MouseEvent e )
{
- IAttribute[] attributes = SelectionUtils.getAttributes( viewer.getSelection() );
- IValue[] values = SelectionUtils.getValues( viewer.getSelection() );
+ IAttribute[] attributes = BrowserSelectionUtils.getAttributes( viewer.getSelection() );
+ IValue[] values = BrowserSelectionUtils.getValues( viewer.getSelection() );
if ( attributes.length == 1 && values.length == 0 )
{
if ( viewer.getExpandedState( attributes[0] ) )
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/AliasesDereferencingWidget.java Sun Aug 26 15:36:01 2007
@@ -23,7 +23,7 @@
import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
@@ -57,9 +57,9 @@
/**
* Creates a new instance of AliasesDereferencingWidget with the given
- * derefenencing method. This must be one of {@link IConnection#DEREFERENCE_ALIASES_NEVER},
- * {@link IConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IConnection#DEREFERENCE_ALIASES_FINDING}
- * or {@link IConnection#DEREFERENCE_ALIASES_ALWAYS}.
+ * derefenencing method. This must be one of {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER},
+ * {@link IBrowserConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IBrowserConnection#DEREFERENCE_ALIASES_FINDING}
+ * or {@link IBrowserConnection#DEREFERENCE_ALIASES_ALWAYS}.
*
* @param initialAliasesDereferencingMethod the initial aliases dereferencing method
*/
@@ -71,11 +71,11 @@
/**
* Creates a new instance of AliasesDereferencingWidget. The initial
- * dereferncing method is set to {@link IConnection#DEREFERENCE_ALIASES_NEVER}.
+ * dereferncing method is set to {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER}.
*/
public AliasesDereferencingWidget()
{
- this.initialAliasesDereferencingMethod = IConnection.DEREFERENCE_ALIASES_NEVER;
+ this.initialAliasesDereferencingMethod = IBrowserConnection.DEREFERENCE_ALIASES_NEVER;
}
@@ -113,26 +113,26 @@
/**
- * Sets the aliases dereferencing method, must be one of {@link IConnection#DEREFERENCE_ALIASES_NEVER},
- * {@link IConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IConnection#DEREFERENCE_ALIASES_FINDING}
- * or {@link IConnection#DEREFERENCE_ALIASES_ALWAYS}.
+ * Sets the aliases dereferencing method, must be one of {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER},
+ * {@link IBrowserConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IBrowserConnection#DEREFERENCE_ALIASES_FINDING}
+ * or {@link IBrowserConnection#DEREFERENCE_ALIASES_ALWAYS}.
*
* @param aliasesDereferencingMethod the aliases dereferencing method
*/
public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
{
initialAliasesDereferencingMethod = aliasesDereferencingMethod;
- findingButton.setSelection( initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_FINDING
- || initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_ALWAYS );
- searchButton.setSelection( initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_SEARCH
- || initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_ALWAYS );
+ findingButton.setSelection( initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_FINDING
+ || initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS );
+ searchButton.setSelection( initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_SEARCH
+ || initialAliasesDereferencingMethod == IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS );
}
/**
- * Gets the aliases dereferencing method, one of {@link IConnection#DEREFERENCE_ALIASES_NEVER},
- * {@link IConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IConnection#DEREFERENCE_ALIASES_FINDING}
- * or {@link IConnection#DEREFERENCE_ALIASES_ALWAYS}.
+ * Gets the aliases dereferencing method, one of {@link IBrowserConnection#DEREFERENCE_ALIASES_NEVER},
+ * {@link IBrowserConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IBrowserConnection#DEREFERENCE_ALIASES_FINDING}
+ * or {@link IBrowserConnection#DEREFERENCE_ALIASES_ALWAYS}.
*
* @return the aliases dereferencing method
*/
@@ -140,19 +140,19 @@
{
if ( findingButton.getSelection() && searchButton.getSelection() )
{
- return IConnection.DEREFERENCE_ALIASES_ALWAYS;
+ return IBrowserConnection.DEREFERENCE_ALIASES_ALWAYS;
}
else if ( findingButton.getSelection() )
{
- return IConnection.DEREFERENCE_ALIASES_FINDING;
+ return IBrowserConnection.DEREFERENCE_ALIASES_FINDING;
}
else if ( searchButton.getSelection() )
{
- return IConnection.DEREFERENCE_ALIASES_SEARCH;
+ return IBrowserConnection.DEREFERENCE_ALIASES_SEARCH;
}
else
{
- return IConnection.DEREFERENCE_ALIASES_NEVER;
+ return IBrowserConnection.DEREFERENCE_ALIASES_NEVER;
}
}
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ConnectionWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ConnectionWidget.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ConnectionWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ConnectionWidget.java Sun Aug 26 15:36:01 2007
@@ -24,7 +24,7 @@
import org.apache.directory.studio.ldapbrowser.common.dialogs.SelectConnectionDialog;
import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
@@ -50,7 +50,7 @@
private Button connectionBrowseButton;
/** The selected connection */
- private IConnection selectedConnection;
+ private IBrowserConnection selectedConnection;
/**
@@ -58,7 +58,7 @@
*
* @param connection the initial connection
*/
- public ConnectionWidget( IConnection connection )
+ public ConnectionWidget( IBrowserConnection connection )
{
this.selectedConnection = connection;
}
@@ -94,7 +94,7 @@
SelectConnectionDialog dialog = new SelectConnectionDialog( parent.getShell(), "Select Connection",
selectedConnection );
dialog.open();
- IConnection connection = dialog.getSelectedConnection();
+ IBrowserConnection connection = dialog.getSelectedConnection();
if ( connection != null )
{
setConnection( connection );
@@ -115,7 +115,7 @@
*
* @return the connection
*/
- public IConnection getConnection()
+ public IBrowserConnection getConnection()
{
return selectedConnection;
}
@@ -126,7 +126,7 @@
*
* @param connection the connection
*/
- public void setConnection( IConnection connection )
+ public void setConnection( IBrowserConnection connection )
{
selectedConnection = connection;
connectionText.setText( selectedConnection != null ? selectedConnection.getName() : "" );
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java Sun Aug 26 15:36:01 2007
@@ -30,7 +30,7 @@
import org.apache.directory.studio.ldapbrowser.common.widgets.HistoryUtils;
import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+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.NameException;
import org.eclipse.swt.SWT;
@@ -70,7 +70,7 @@
private Button entryBrowseButton;
/** The connection. */
- private IConnection connection;
+ private IBrowserConnection connection;
/** The selected DN. */
private DN dn;
@@ -95,7 +95,7 @@
* @param connection the connection
* @param dn the initial DN
*/
- public EntryWidget( IConnection connection, DN dn )
+ public EntryWidget( IBrowserConnection connection, DN dn )
{
this( connection, dn, null );
}
@@ -108,7 +108,7 @@
* @param dn the initial DN
* @param suffix the suffix
*/
- public EntryWidget( IConnection connection, DN dn, DN suffix )
+ public EntryWidget( IBrowserConnection connection, DN dn, DN suffix )
{
this.connection = connection;
this.dn = dn;
@@ -319,7 +319,7 @@
*
* @return the connection
*/
- public IConnection getConnection()
+ public IBrowserConnection getConnection()
{
return connection;
}
@@ -331,7 +331,7 @@
* @param dn the DN
* @param connection the connection
*/
- public void setInput( IConnection connection, DN dn )
+ public void setInput( IBrowserConnection connection, DN dn )
{
setInput( connection, dn, null );
}
@@ -344,7 +344,7 @@
* @param dn the DN
* @param suffix the suffix
*/
- public void setInput( IConnection connection, DN dn, DN suffix )
+ public void setInput( IBrowserConnection connection, DN dn, DN suffix )
{
if ( this.connection != connection || this.dn != dn || this.suffix != suffix )
{
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java Sun Aug 26 15:36:01 2007
@@ -27,7 +27,7 @@
import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
import org.apache.directory.studio.ldapbrowser.common.widgets.HistoryUtils;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterParser;
import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
@@ -75,7 +75,7 @@
private FilterContentAssistProcessor contentAssistProcessor;
/** The connection. */
- private IConnection connection;
+ private IBrowserConnection connection;
/** The inital filter. */
private String initalFilter;
@@ -90,7 +90,7 @@
* @param connection the connection
* @param initalFilter the inital filter
*/
- public FilterWidget( IConnection connection, String initalFilter )
+ public FilterWidget( IBrowserConnection connection, String initalFilter )
{
this.connection = connection;
this.initalFilter = initalFilter;
@@ -210,7 +210,7 @@
*
* @param connection the connection
*/
- public void setConnection( IConnection connection )
+ public void setConnection( IBrowserConnection connection )
{
if ( this.connection != connection )
{
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReferralsHandlingWidget.java Sun Aug 26 15:36:01 2007
@@ -23,7 +23,7 @@
import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
@@ -58,8 +58,8 @@
/**
* Creates a new instance of ReferralsHandlingWidget with the given
* referrals handling method. This must be one of
- * {@link IConnection#HANDLE_REFERRALS_IGNORE} or
- * {@link IConnection#HANDLE_REFERRALS_FOLLOW}.
+ * {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE} or
+ * {@link IBrowserConnection#HANDLE_REFERRALS_FOLLOW}.
*
* @param initialReferralsHandlingMethod the initial referrals handling method
*/
@@ -71,11 +71,11 @@
/**
* Creates a new instance of ReferralsHandlingWidget with initial
- * referrals handling method {@link IConnection#HANDLE_REFERRALS_IGNORE}.
+ * referrals handling method {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE}.
*/
public ReferralsHandlingWidget()
{
- this.initialReferralsHandlingMethod = IConnection.HANDLE_REFERRALS_IGNORE;
+ this.initialReferralsHandlingMethod = IBrowserConnection.HANDLE_REFERRALS_IGNORE;
}
@@ -114,23 +114,23 @@
/**
* Sets the referrals handling method must be one of
- * {@link IConnection#HANDLE_REFERRALS_IGNORE} or
- * {@link IConnection#HANDLE_REFERRALS_FOLLOW}.
+ * {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE} or
+ * {@link IBrowserConnection#HANDLE_REFERRALS_FOLLOW}.
*
* @param referralsHandlingMethod the referrals handling method
*/
public void setReferralsHandlingMethod( int referralsHandlingMethod )
{
initialReferralsHandlingMethod = referralsHandlingMethod;
- ignoreButton.setSelection( initialReferralsHandlingMethod == IConnection.HANDLE_REFERRALS_IGNORE );
- followButton.setSelection( initialReferralsHandlingMethod == IConnection.HANDLE_REFERRALS_FOLLOW );
+ ignoreButton.setSelection( initialReferralsHandlingMethod == IBrowserConnection.HANDLE_REFERRALS_IGNORE );
+ followButton.setSelection( initialReferralsHandlingMethod == IBrowserConnection.HANDLE_REFERRALS_FOLLOW );
}
/**
* Gets the referrals handling method, one of
- * {@link IConnection#HANDLE_REFERRALS_IGNORE} or
- * {@link IConnection#HANDLE_REFERRALS_FOLLOW}.
+ * {@link IBrowserConnection#HANDLE_REFERRALS_IGNORE} or
+ * {@link IBrowserConnection#HANDLE_REFERRALS_FOLLOW}.
*
* @return the referrals handling method
*/
@@ -138,11 +138,11 @@
{
if ( ignoreButton.getSelection() )
{
- return IConnection.HANDLE_REFERRALS_IGNORE;
+ return IBrowserConnection.HANDLE_REFERRALS_IGNORE;
}
else
{
- return IConnection.HANDLE_REFERRALS_FOLLOW;
+ return IBrowserConnection.HANDLE_REFERRALS_FOLLOW;
}
}
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReturningAttributesWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReturningAttributesWidget.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReturningAttributesWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/ReturningAttributesWidget.java Sun Aug 26 15:36:01 2007
@@ -26,7 +26,7 @@
import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
import org.apache.directory.studio.ldapbrowser.common.widgets.DialogContentAssistant;
import org.apache.directory.studio.ldapbrowser.common.widgets.HistoryUtils;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.events.ModifyEvent;
@@ -54,7 +54,7 @@
private ReturningAttributesContentAssistProcessor contentAssistProcessor;
/** The connection. */
- private IConnection connection;
+ private IBrowserConnection connection;
/** The initial returning attributes. */
private String[] initialReturningAttributes;
@@ -66,7 +66,7 @@
* @param initialReturningAttributes the initial returning attributes
* @param connection the connection
*/
- public ReturningAttributesWidget( IConnection connection, String[] initialReturningAttributes )
+ public ReturningAttributesWidget( IBrowserConnection connection, String[] initialReturningAttributes )
{
this.connection = connection;
this.initialReturningAttributes = initialReturningAttributes;
@@ -134,7 +134,7 @@
*
* @param connection the connection
*/
- public void setConnection( IConnection connection )
+ public void setConnection( IBrowserConnection connection )
{
this.connection = connection;
contentAssistProcessor.setPossibleAttributeTypes( connection == null ? new String[0] : connection.getSchema()
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java Sun Aug 26 15:36:01 2007
@@ -32,7 +32,7 @@
import org.apache.directory.studio.ldapbrowser.core.jobs.SearchJob;
import org.apache.directory.studio.ldapbrowser.core.model.Control;
import org.apache.directory.studio.ldapbrowser.core.model.DN;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
@@ -567,9 +567,9 @@
searchNameText.setText( search.getName() );
}
- if ( search.getConnection() != null )
+ if ( search.getBrowserConnection() != null )
{
- IConnection connection = search.getConnection();
+ IBrowserConnection connection = search.getBrowserConnection();
DN searchBase = search.getSearchBase();
if ( connectionWidget != null )
@@ -647,7 +647,7 @@
searchModified = true;
}
if ( connectionWidget != null && connectionWidget.getConnection() != null
- && connectionWidget.getConnection() != search.getConnection() )
+ && connectionWidget.getConnection() != search.getBrowserConnection() )
{
search.setConnection( connectionWidget.getConnection() );
searchModified = true;
@@ -801,7 +801,7 @@
*/
public boolean performSearch( final ISearch search )
{
- if ( search.getConnection() != null )
+ if ( search.getBrowserConnection() != null )
{
new SearchJob( new ISearch[]
{ search } ).execute();
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java Sun Aug 26 15:36:01 2007
@@ -124,7 +124,7 @@
this.initialShowSubschemaAttributesOnly = initialShowSubschemaAttributesOnly;
this.initialHideExistingAttributes = initialHideExistingAttributes;
- possibleAttributeTypes = initialEntry.getConnection().getSchema().getAttributeTypeDescriptionNames();
+ possibleAttributeTypes = initialEntry.getBrowserConnection().getSchema().getAttributeTypeDescriptionNames();
Arrays.sort( possibleAttributeTypes );
possibleAttributeTypesSubschemaOnly = initialEntry.getSubschema().getAllAttributeNames();
Arrays.sort( possibleAttributeTypesSubschemaOnly );
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java Sun Aug 26 15:36:01 2007
@@ -247,7 +247,7 @@
*/
public IValueEditor getCurrentValueEditor( IEntry entry, String attributeType )
{
- return getCurrentValueEditor( entry.getConnection().getSchema(), attributeType );
+ return getCurrentValueEditor( entry.getBrowserConnection().getSchema(), attributeType );
}
@@ -334,7 +334,7 @@
*/
public IValueEditor[] getAlternativeValueEditors( IEntry entry, String attributeName )
{
- Schema schema = entry.getConnection().getSchema();
+ Schema schema = entry.getBrowserConnection().getSchema();
return getAlternativeValueEditors( schema, attributeName );
}
@@ -547,7 +547,7 @@
EventRegistry.resumeEventFireingInCurrentThread();
Object newValue;
- if ( entry.getConnection().getSchema().getAttributeTypeDescription( attributeDescription )
+ if ( entry.getBrowserConnection().getSchema().getAttributeTypeDescription( attributeDescription )
.getSyntaxDescription().isString() )
{
if ( newRawValue instanceof String )
Modified: directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF Sun Aug 26 15:36:01 2007
@@ -8,7 +8,8 @@
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.search,
- org.apache.directory.studio.jars
+ org.apache.directory.studio.jars,
+ org.apache.directory.studio.connection.core
Eclipse-LazyStart: true
Export-Package: org.apache.directory.studio.ldapbrowser.core,
org.apache.directory.studio.ldapbrowser.core.events,
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BookmarkManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BookmarkManager.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BookmarkManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BookmarkManager.java Sun Aug 26 15:36:01 2007
@@ -28,7 +28,7 @@
import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateEvent;
import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.eclipse.osgi.util.NLS;
@@ -44,7 +44,7 @@
private List<IBookmark> bookmarkList;
- private IConnection connection;
+ private IBrowserConnection connection;
/**
@@ -53,7 +53,7 @@
* @param connection
* the attached Connection
*/
- public BookmarkManager( IConnection connection )
+ public BookmarkManager( IBrowserConnection connection )
{
this.connection = connection;
bookmarkList = new ArrayList<IBookmark>();
@@ -66,7 +66,7 @@
* @return
* the Connection
*/
- public IConnection getConnection()
+ public IBrowserConnection getConnection()
{
return connection;
}
Copied: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java (from r569019, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java?p2=directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java&p1=directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java&r1=569019&r2=569899&rev=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java Sun Aug 26 15:36:01 2007
@@ -29,57 +29,55 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
+import java.util.Map;
import org.apache.commons.io.FileUtils;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
+import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
+import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateEvent;
import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateListener;
-import org.apache.directory.studio.ldapbrowser.core.events.ConnectionRenamedEvent;
-import org.apache.directory.studio.ldapbrowser.core.events.ConnectionUpdateEvent;
-import org.apache.directory.studio.ldapbrowser.core.events.ConnectionUpdateListener;
import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateListener;
import org.apache.directory.studio.ldapbrowser.core.internal.model.Bookmark;
-import org.apache.directory.studio.ldapbrowser.core.internal.model.Connection;
+import org.apache.directory.studio.ldapbrowser.core.internal.model.BrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.internal.model.Search;
import org.apache.directory.studio.ldapbrowser.core.model.BookmarkParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.ConnectionParameter;
import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
import org.apache.directory.studio.ldapbrowser.core.utils.LdifUtils;
import org.eclipse.core.runtime.IPath;
/**
- * This class is used to manage {@link IConnection}s.
+ * This class is used to manage {@link IBrowserConnection}s.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class ConnectionManager implements ConnectionUpdateListener, SearchUpdateListener, BookmarkUpdateListener
+public class BrowserConnectionManager implements ConnectionUpdateListener, SearchUpdateListener, BookmarkUpdateListener
{
/** The list of connections. */
- private List<IConnection> connectionList;
+ private Map<String, IBrowserConnection> connectionMap;
/**
* Creates a new instance of ConnectionManager.
*/
- public ConnectionManager()
+ public BrowserConnectionManager()
{
- this.connectionList = new ArrayList<IConnection>();
- loadConnections();
- EventRegistry.addConnectionUpdateListener( this, BrowserCorePlugin.getDefault().getEventRunner() );
+ this.connectionMap = new HashMap<String, IBrowserConnection>();
+ loadBrowserConnections();
+ ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionCorePlugin.getDefault().getEventRunner() );
EventRegistry.addSearchUpdateListener( this, BrowserCorePlugin.getDefault().getEventRunner() );
EventRegistry.addBookmarkUpdateListener( this, BrowserCorePlugin.getDefault().getEventRunner() );
}
@@ -126,9 +124,9 @@
* @return
* the filename of the Connection Store
*/
- public static final String getConnectionStoreFileName()
+ public static final String getBrowserConnectionStoreFileName()
{
- String filename = BrowserCorePlugin.getDefault().getStateLocation().append( "connections.xml" ).toOSString(); //$NON-NLS-1$
+ String filename = BrowserCorePlugin.getDefault().getStateLocation().append( "browserconnections.xml" ).toOSString(); //$NON-NLS-1$
File file = new File( filename );
if ( !file.exists() )
{
@@ -138,8 +136,7 @@
String[] oldFilenames = new String[2];
oldFilenames[0] = filename.replace( "org.apache.directory.studio.ldapbrowser.core",
"org.apache.directory.ldapstudio.browser.core" );
- oldFilenames[1] = oldFilenames[0].replace( ".ApacheDirectoryStudio",
- ".ldapstudio" );
+ oldFilenames[1] = oldFilenames[0].replace( ".ApacheDirectoryStudio", ".ldapstudio" );
for ( int i = 0; i < oldFilenames.length; i++ )
{
File oldFile = new File( oldFilenames[i] );
@@ -207,158 +204,134 @@
/**
- * Adds the connection to the end of the connection list. If there is
- * already a connection with this name, the new connection is renamed.
+ * Gets a connection from its name.
*
- * @param connection
+ * @param name
+ * the name of the Connection
+ * @return
+ * the corresponding IConnection
*/
- public void addConnection( IConnection connection )
+ public IBrowserConnection getConnection( String name )
{
- addConnection( connectionList.size(), connection );
+ return connectionMap.get( name );
}
/**
- * Adds the connection at the specified position of the connection list.
- * If there is already a connection with this name the new connection is
- * renamed.
+ * Gets a connection from its underlying connection.
*
- * @param index
* @param connection
+ * the underlying connection
+ * @return
+ * the corresponding IConnection
*/
- public void addConnection( int index, IConnection connection )
+ public IBrowserConnection getBrowserConnection( Connection connection )
{
- if ( getConnection( connection.getName() ) != null )
- {
- String newConnectionName = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s,
- "", connection.getName() ); //$NON-NLS-1$
- for ( int i = 2; getConnection( newConnectionName ) != null; i++ )
- {
- newConnectionName = BrowserCoreMessages.bind( BrowserCoreMessages.copy_n_of_s,
- i + " ", connection.getName() ); //$NON-NLS-1$
- }
- connection.getConnectionParameter().setName( newConnectionName );
- }
-
- connectionList.add( index, connection );
- EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( connection,
- ConnectionUpdateEvent.EventDetail.CONNECTION_ADDED ), this );
+ return getConnection( connection.getName() );
}
/**
- * Gets a connection from its name.
+ * Gets an array containing all the Connections.
*
- * @param name
- * the name of the Connection
* @return
- * the corresponding Connection
+ * an array containing all the Connections
*/
- public IConnection getConnection( String name )
+ public IBrowserConnection[] getBrowserConnections()
{
- for ( Iterator it = connectionList.iterator(); it.hasNext(); )
+ return ( IBrowserConnection[] ) connectionMap.values().toArray( new IBrowserConnection[0] );
+ }
+
+
+ /**
+ * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRenamed(org.apache.directory.studio.connection.core.Connection, java.lang.String)
+ */
+ public void connectionRenamed( Connection connection, String oldName )
+ {
+ String newName = connection.getName();
+
+ // update connection list
+ IBrowserConnection browserConnection = connectionMap.remove( oldName );
+ connectionMap.put( newName, browserConnection );
+
+ // rename schema file
+ String oldSchemaFileName = getSchemaCacheFileName( oldName );
+ String newSchemaFileName = getSchemaCacheFileName( newName );
+ File oldSchemaFile = new File( oldSchemaFileName );
+ File newSchemaFile = new File( newSchemaFileName );
+ if ( oldSchemaFile.exists() )
{
- IConnection conn = ( IConnection ) it.next();
- if ( conn.getName().equals( name ) )
- {
- return conn;
- }
+ oldSchemaFile.renameTo( newSchemaFile );
}
- return null;
+
+ // TODO: schema
+ // if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.SCHEMA_LOADED
+ // || connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_OPENED )
+ // {
+ // saveSchema( connectionUpdateEvent.getConnection() );
+ // }
+
+ // make persistent
+ saveBrowserConnections();
}
/**
- * Gets the index in the Connection list of the first occurrence of the specified Connection.
- *
- * @param connection
- * the Connection to search for
- * @return
- * the index in the Connection list of the first occurrence of the specified Connection
+ * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRemoved(org.apache.directory.studio.connection.core.Connection)
*/
- public int indexOf( IConnection connection )
+ public void connectionRemoved( Connection connection )
{
- return connectionList.indexOf( connection );
+ // update connection list
+ connectionMap.remove( connection.getName() );
+
+ // remove schema file
+ File schemaFile = new File( getSchemaCacheFileName( connection.getName() ) );
+ if ( schemaFile.exists() )
+ {
+ schemaFile.delete();
+ }
+
+ // make persistent
+ saveBrowserConnections();
}
/**
- * Removes the given Connection from the Connection list.
- *
- * @param conn
- * the connection to remove
+ * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionAdded(org.apache.directory.studio.connection.core.Connection)
*/
- public void removeConnection( IConnection conn )
+ public void connectionAdded( Connection connection )
{
- connectionList.remove( conn );
- EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( conn,
- ConnectionUpdateEvent.EventDetail.CONNECTION_REMOVED ), this );
+ // update connection list
+ BrowserConnection browserConnection = new BrowserConnection( connection );
+ connectionMap.put( connection.getName(), browserConnection );
+
+ // make persistent
+ saveBrowserConnections();
}
/**
- * Gets an array containing all the Connections.
- *
- * @return
- * an array containing all the Connections
+ * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionUpdated(org.apache.directory.studio.connection.core.Connection)
*/
- public IConnection[] getConnections()
+ public void connectionUpdated( Connection connection )
{
- return ( IConnection[] ) connectionList.toArray( new IConnection[0] );
+ saveBrowserConnections();
}
/**
- * Gets the number of Connections.
- *
- * @return
- * the number of Connections
+ * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
*/
- public int getConnectionCount()
+ public void connectionOpened( Connection connection )
{
- return connectionList.size();
}
/**
- * {@inheritDoc}
+ * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionClosed(org.apache.directory.studio.connection.core.Connection)
*/
- public void connectionUpdated( ConnectionUpdateEvent connectionUpdateEvent )
+ public void connectionClosed( Connection connection )
{
- if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_ADDED
- || connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_REMOVED
- || connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_RENAMED
- || connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_PARAMETER_UPDATED )
- {
- saveConnections();
- }
-
- if ( connectionUpdateEvent instanceof ConnectionRenamedEvent )
- {
- String oldName = ( ( ConnectionRenamedEvent ) connectionUpdateEvent ).getOldName();
- String newName = connectionUpdateEvent.getConnection().getName();
- String oldSchemaFile = getSchemaCacheFileName( oldName );
- String newSchemaFile = getSchemaCacheFileName( newName );
- File oldFile = new File( oldSchemaFile );
- File newFile = new File( newSchemaFile );
- if ( oldFile.exists() )
- {
- oldFile.renameTo( newFile );
- }
- }
- if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.SCHEMA_LOADED
- || connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_OPENED )
- {
- saveSchema( connectionUpdateEvent.getConnection() );
- }
- if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.EventDetail.CONNECTION_REMOVED )
- {
- File file = new File( getSchemaCacheFileName( connectionUpdateEvent.getConnection().getName() ) );
- if ( file.exists() )
- {
- file.delete();
- }
- }
}
@@ -372,7 +345,7 @@
|| searchUpdateEvent.getDetail() == SearchUpdateEvent.EventDetail.SEARCH_RENAMED
|| searchUpdateEvent.getDetail() == SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED )
{
- saveConnections();
+ saveBrowserConnections();
}
}
@@ -386,42 +359,43 @@
|| bookmarkUpdateEvent.getDetail() == BookmarkUpdateEvent.Detail.BOOKMARK_REMOVED
|| bookmarkUpdateEvent.getDetail() == BookmarkUpdateEvent.Detail.BOOKMARK_UPDATED )
{
- saveConnections();
+ saveBrowserConnections();
}
}
/**
- * Saves the Connections
+ * Saves the browser onnections
*/
- private void saveConnections()
+ private void saveBrowserConnections()
{
- Object[][] object = new Object[connectionList.size()][3];
+ Object[][] object = new Object[connectionMap.size()][3];
- Iterator connectionIterator = connectionList.iterator();
+ Iterator<IBrowserConnection> connectionIterator = connectionMap.values().iterator();
for ( int i = 0; connectionIterator.hasNext(); i++ )
{
- IConnection conn = ( IConnection ) connectionIterator.next();
- ConnectionParameter connectionParameters = conn.getConnectionParameter();
- ISearch[] searches = conn.getSearchManager().getSearches();
+ IBrowserConnection browserConnection = connectionIterator.next();
+
+ ISearch[] searches = browserConnection.getSearchManager().getSearches();
SearchParameter[] searchParameters = new SearchParameter[searches.length];
for ( int k = 0; k < searches.length; k++ )
{
searchParameters[k] = searches[k].getSearchParameter();
}
- IBookmark[] bookmarks = conn.getBookmarkManager().getBookmarks();
+
+ IBookmark[] bookmarks = browserConnection.getBookmarkManager().getBookmarks();
BookmarkParameter[] bookmarkParameters = new BookmarkParameter[bookmarks.length];
for ( int k = 0; k < bookmarks.length; k++ )
{
bookmarkParameters[k] = bookmarks[k].getBookmarkParameter();
}
- object[i][0] = connectionParameters;
+ object[i][0] = browserConnection.getName();
object[i][1] = searchParameters;
object[i][2] = bookmarkParameters;
}
- save( object, getConnectionStoreFileName() );
+ save( object, getBrowserConnectionStoreFileName() );
}
@@ -431,7 +405,7 @@
* @param connection
* the Connection
*/
- private void saveSchema( IConnection connection )
+ private void saveSchema( IBrowserConnection connection )
{
try
{
@@ -450,11 +424,33 @@
/**
* Loads the Connections
*/
- private void loadConnections()
+ private void loadBrowserConnections()
{
+ Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager().getConnections();
+ for ( int i = 0; i < connections.length; i++ )
+ {
+ Connection connection = connections[i];
+ BrowserConnection browserConnection = new BrowserConnection( connection );
+ connectionMap.put( connection.getName(), browserConnection );
+ }
+
+ // try
+ // {
+ // String schemaFilename = getSchemaCacheFileName( conn.getName() );
+ // FileReader reader = new FileReader( schemaFilename );
+ // Schema schema = new Schema();
+ // schema.loadFromLdif( reader );
+ // conn.setSchema( schema );
+ // }
+ // catch ( Exception e )
+ // {
+ // }
+
+// connectionList.clear();
+//
try
{
- Object[][] object = ( Object[][] ) this.load( getConnectionStoreFileName() );
+ Object[][] object = ( Object[][] ) this.load( getBrowserConnectionStoreFileName() );
if ( object != null )
{
@@ -462,44 +458,44 @@
{
for ( int i = 0; i < object.length; i++ )
{
- IConnection conn = new Connection();
-
- ConnectionParameter connectionParameters = ( ConnectionParameter ) object[i][0];
- conn.setConnectionParameter( connectionParameters );
-
- if ( object[i].length > 1 )
+ String connectionName = ( String ) object[i][0];
+ IBrowserConnection browserConnection = getConnection( connectionName );
+
+ if( browserConnection != null )
{
- SearchParameter[] searchParameters = ( SearchParameter[] ) object[i][1];
- for ( int k = 0; k < searchParameters.length; k++ )
+ if ( object[i].length > 0 )
{
- ISearch search = new Search( conn, searchParameters[k] );
- conn.getSearchManager().addSearch( search );
+ SearchParameter[] searchParameters = ( SearchParameter[] ) object[i][1];
+ for ( int k = 0; k < searchParameters.length; k++ )
+ {
+ ISearch search = new Search( browserConnection, searchParameters[k] );
+ browserConnection.getSearchManager().addSearch( search );
+ }
}
- }
-
- if ( object[i].length > 2 )
- {
- BookmarkParameter[] bookmarkParameters = ( BookmarkParameter[] ) object[i][2];
- for ( int k = 0; k < bookmarkParameters.length; k++ )
+
+ if ( object[i].length > 1 )
{
- IBookmark bookmark = new Bookmark( conn, bookmarkParameters[k] );
- conn.getBookmarkManager().addBookmark( bookmark );
+ BookmarkParameter[] bookmarkParameters = ( BookmarkParameter[] ) object[i][2];
+ for ( int k = 0; k < bookmarkParameters.length; k++ )
+ {
+ IBookmark bookmark = new Bookmark( browserConnection, bookmarkParameters[k] );
+ browserConnection.getBookmarkManager().addBookmark( bookmark );
+ }
}
+
+// try
+// {
+// String schemaFilename = getSchemaCacheFileName( browserConnection.getName() );
+// FileReader reader = new FileReader( schemaFilename );
+// Schema schema = new Schema();
+// schema.loadFromLdif( reader );
+// browserConnection.setSchema( schema );
+// }
+// catch ( Exception e )
+// {
+// }
+
}
-
- try
- {
- String schemaFilename = getSchemaCacheFileName( conn.getName() );
- FileReader reader = new FileReader( schemaFilename );
- Schema schema = new Schema();
- schema.loadFromLdif( reader );
- conn.setSchema( schema );
- }
- catch ( Exception e )
- {
- }
-
- connectionList.add( conn );
}
}
@@ -516,6 +512,8 @@
catch ( Exception e )
{
}
+
+
}
@@ -590,11 +588,12 @@
} );
encoder.writeObject( object );
encoder.close();
-
+
// move temp file to good file
File file = new File( filename );
File tempFile = new File( tempFilename );
- if( file.exists() ) {
+ if ( file.exists() )
+ {
file.delete();
}
String content = FileUtils.readFileToString( tempFile, "UTF-8" );
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePlugin.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePlugin.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePlugin.java Sun Aug 26 15:36:01 2007
@@ -23,8 +23,7 @@
import org.apache.directory.studio.ldapbrowser.core.events.CoreEventRunner;
import org.apache.directory.studio.ldapbrowser.core.events.EventRunner;
-import org.apache.directory.studio.ldapbrowser.core.model.IAuthHandler;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.IReferralHandler;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
@@ -42,10 +41,7 @@
private static BrowserCorePlugin plugin;
/** The connection manager */
- private ConnectionManager connectionManager;
-
- /** The credential provider */
- private IAuthHandler authHandler;
+ private BrowserConnectionManager connectionManager;
/** The connection provider */
private IReferralHandler referralHandler;
@@ -82,7 +78,7 @@
if ( connectionManager == null )
{
- connectionManager = new ConnectionManager();
+ connectionManager = new BrowserConnectionManager();
}
}
@@ -101,11 +97,11 @@
if ( connectionManager != null )
{
- IConnection[] connections = connectionManager.getConnections();
- for ( int i = 0; i < connections.length; i++ )
- {
- connections[i].close();
- }
+// IConnection[] connections = connectionManager.getConnections();
+// for ( int i = 0; i < connections.length; i++ )
+// {
+// connections[i].close();
+// }
connectionManager = null;
}
}
@@ -128,7 +124,7 @@
* @return
* the connection manager
*/
- public ConnectionManager getConnectionManager()
+ public BrowserConnectionManager getConnectionManager()
{
return connectionManager;
}
@@ -141,30 +137,6 @@
public BrowserCorePreferences getCorePreferences()
{
return preferences;
- }
-
-
- /**
- * Gets the AuthHandler
- *
- * @return
- * the AuthHandler
- */
- public IAuthHandler getAuthHandler()
- {
- return authHandler;
- }
-
-
- /**
- * Sets the AuthHandler
- *
- * @param authHandler
- * the authHandler to set
- */
- public void setAuthHandler( IAuthHandler authHandler )
- {
- this.authHandler = authHandler;
}
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/SearchManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/SearchManager.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/SearchManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/SearchManager.java Sun Aug 26 15:36:01 2007
@@ -27,13 +27,13 @@
import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
import org.eclipse.osgi.util.NLS;
/**
- * This class is used to manages {@link ISearch}es of an {@link IConnection}
+ * This class is used to manages {@link ISearch}es of an {@link IBrowserConnection}
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
@@ -48,7 +48,7 @@
private List<ISearch> searchList;
/** The connection. */
- private IConnection connection;
+ private IBrowserConnection connection;
/**
@@ -65,7 +65,7 @@
* @param connection
* the attached Connection
*/
- public SearchManager( IConnection connection )
+ public SearchManager( IBrowserConnection connection )
{
this.connection = connection;
this.searchList = new ArrayList<ISearch>();
@@ -78,7 +78,7 @@
* @return
* the Connection
*/
- public IConnection getConnection()
+ public IBrowserConnection getConnection()
{
return this.connection;
}
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeAddedEvent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeAddedEvent.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeAddedEvent.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeAddedEvent.java Sun Aug 26 15:36:01 2007
@@ -23,7 +23,7 @@
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -47,7 +47,7 @@
* @param modifiedEntry the modified entry
* @param addedAttribute the added attribute
*/
- public AttributeAddedEvent( IConnection connection, IEntry modifiedEntry, IAttribute addedAttribute )
+ public AttributeAddedEvent( IBrowserConnection connection, IEntry modifiedEntry, IAttribute addedAttribute )
{
super( connection, modifiedEntry );
this.addedAttribute = addedAttribute;
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeDeletedEvent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeDeletedEvent.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeDeletedEvent.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributeDeletedEvent.java Sun Aug 26 15:36:01 2007
@@ -23,7 +23,7 @@
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -47,7 +47,7 @@
* @param modifiedEntry the modified entry
* @param deletedAttribute the deleted attribute
*/
- public AttributeDeletedEvent( IConnection connection, IEntry modifiedEntry, IAttribute deletedAttribute )
+ public AttributeDeletedEvent( IBrowserConnection connection, IEntry modifiedEntry, IAttribute deletedAttribute )
{
super( connection, modifiedEntry );
this.deletedAttribute = deletedAttribute;
Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributesInitializedEvent.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributesInitializedEvent.java?rev=569899&r1=569898&r2=569899&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributesInitializedEvent.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/AttributesInitializedEvent.java Sun Aug 26 15:36:01 2007
@@ -44,7 +44,7 @@
*/
public AttributesInitializedEvent( IEntry initializedEntry )
{
- super( initializedEntry.getConnection(), initializedEntry );
+ super( initializedEntry.getBrowserConnection(), initializedEntry );
}