Package org.apache.directory.studio.connection.core

Examples of org.apache.directory.studio.connection.core.Connection


     * @return a test connection
     */
    private Connection getTestConnection()
    {
        ConnectionParameter cp = connectionParameterPageModifyListener.getTestConnectionParameters();
        Connection conn = new Connection( cp );
        return conn;
    }
View Full Code Here


        checkPrincipalPasswordAuthButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent e )
            {
                Connection connection = getTestConnection();
                CheckBindJob job = new CheckBindJob( connection );
                RunnableContextJobAdapter.execute( job, runnableContext );
                if ( job.getExternalResult().isOK() )
                {
                    MessageDialog.openInformation( Display.getDefault().getActiveShell(), "Check Authentication",
View Full Code Here

     * @return
     *      the corresponding IBrowserConnection
     */
    public IBrowserConnection getBrowserConnectionByName( String name )
    {
        Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionByName( name );
        return getBrowserConnection( connection );
    }
View Full Code Here

            return connection;
        }
        else if ( getSelectedConnections().length == 1 )
        {
            Connection connection = getSelectedConnections()[0];
            IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnection(
                connection );
            return browserConnection;
        }
        else if ( getSelectedEntries().length == 1 )
View Full Code Here

        if ( element instanceof IAdaptable )
        {
            browserConnection = ( IBrowserConnection ) ( ( IAdaptable ) element ).getAdapter( IBrowserConnection.class );
            if(browserConnection == null)
            {
                Connection connection = ( Connection ) ( ( IAdaptable ) element ).getAdapter( Connection.class );
                browserConnection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnection( connection );
            }
        }
        return browserConnection;
    }
View Full Code Here

     */
    public void select( Object obj )
    {
        if ( obj instanceof Connection )
        {
            Connection connection = ( Connection ) obj;

            mainWidget.getViewer().reveal( connection );
            mainWidget.getViewer().refresh( connection, true );
            mainWidget.getViewer().setSelection( new StructuredSelection( connection ), true );
        }
View Full Code Here

    }


    static Connection getConnection( Object element )
    {
        Connection connection = null;
        if ( element instanceof IAdaptable )
        {
            connection = ( Connection ) ( ( IAdaptable ) element ).getAdapter( Connection.class );
        }
        return connection;
View Full Code Here

    /**
     * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
     */
    protected Control createContents( Composite parent )
    {
        Connection connection = getConnection( getElement() );
        if ( connection != null )
        {
            super.setMessage( "Connection " + Utils.shorten( connection.getName(), 30 ) );
           
            pages = ConnectionParameterPageManager.getConnectionParameterPages();
           
            tabFolder = new TabFolder( parent, SWT.TOP );
           
            tabs = new TabItem[pages.length];
            for ( int i = 0; i < pages.length; i++ )
            {
                Composite composite = new Composite( tabFolder, SWT.NONE );
                GridLayout gl = new GridLayout( 1, false );
                composite.setLayout( gl );
               
                pages[i].init( composite, this, connection.getConnectionParameter() );
               
                tabs[i] = new TabItem( tabFolder, SWT.NONE );
                tabs[i].setText( pages[i].getPageName() );
                tabs[i].setControl( composite );
            }
View Full Code Here

     * @see org.eclipse.jface.preference.PreferencePage#performOk()
     */
    public boolean performOk()
    {
        // get current connection parameters
        Connection connection = ( Connection ) getConnection( getElement() );
       
        // save modified parameters
        boolean parametersModified = false;
        boolean reconnectionRequired = false;
        ConnectionParameter connectionParameter = new ConnectionParameter();
        connectionParameter.setId( connection.getConnectionParameter().getId() );
        for ( int i = 0; i < pages.length; i++ )
        {
            pages[i].saveParameters( connectionParameter );
            pages[i].saveDialogSettings();
            parametersModified |= pages[i].areParametersModifed();
            reconnectionRequired |= pages[i].isReconnectionRequired();
        }

        if ( parametersModified )
        {
            // update connection parameters
            connection.setConnectionParameter( connectionParameter );

            if ( reconnectionRequired )
            {
                // close connection
                new CloseConnectionsJob( connection ).execute();
View Full Code Here

            }

            List<String> connectionIds = folder.getConnectionIds();
            for ( String connectionId : connectionIds )
            {
                Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionById( connectionId );
                if(connection != null && !connectionsToDelete.contains( connection ))
                {
                    connectionsToDelete.add( connection );
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.connection.core.Connection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.