Examples of IBrowserConnection


Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    /**
     * {@inheritDoc}
     */
    public void run()
    {
        final IBrowserConnection browserConnection = schemaPage.getConnection();
        if ( browserConnection != null )
        {
            new StudioBrowserJob( new ReloadSchemaRunnable( browserConnection ) ).execute();
            schemaPage.getSchemaBrowser().refresh();
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    /**
     * {@inheritDoc}
     */
    public void saveState( IMemento memento )
    {
        IBrowserConnection connection = getConnection();
        AbstractSchemaDescription schemaElement = getSchemElement();
        memento.putString( "CONNECTION", connection.getConnection().getId() ); //$NON-NLS-1$
        memento.putString( "SCHEMAELEMENTYPE", schemaElement.getClass().getName() ); //$NON-NLS-1$
        memento.putString( "SCHEMAELEMENTOID", schemaElement.getNumericOid() ); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    /**
     * {@inheritDoc}
     */
    public void restoreState( IMemento memento )
    {
        IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnectionById(
            memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
        String schemaElementType = memento.getString( "SCHEMAELEMENTYPE" ); //$NON-NLS-1$
        String schemaElementOid = memento.getString( "SCHEMAELEMENTOID" ); //$NON-NLS-1$
        AbstractSchemaDescription schemaElement = null;
        if ( ObjectClassDescription.class.getName().equals( schemaElementType ) )
        {
            schemaElement = connection.getSchema().getObjectClassDescription( schemaElementOid );
        }
        else if ( AttributeTypeDescription.class.getName().equals( schemaElementType ) )
        {
            schemaElement = connection.getSchema().getAttributeTypeDescription( schemaElementOid );
        }
        else if ( LdapSyntaxDescription.class.getName().equals( schemaElementType ) )
        {
            schemaElement = connection.getSchema().getLdapSyntaxDescription( schemaElementOid );
        }
        else if ( MatchingRuleDescription.class.getName().equals( schemaElementType ) )
        {
            schemaElement = connection.getSchema().getMatchingRuleDescription( schemaElementOid );
        }
        else if ( MatchingRuleUseDescription.class.getName().equals( schemaElementType ) )
        {
            schemaElement = connection.getSchema().getMatchingRuleUseDescription( schemaElementOid );
        }

        super.setInput( new SchemaBrowserInput( connection, schemaElement ) );
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

     */
    private IBrowserConnection getConnection()
    {
        if ( ( getSelectedValues().length + getSelectedAttributes().length ) + getSelectedAttributeHierarchies().length == 1 )
        {
            IBrowserConnection connection = null;
            if ( getSelectedValues().length == 1 )
            {
                connection = getSelectedValues()[0].getAttribute().getEntry().getBrowserConnection();
            }
            else if ( getSelectedAttributes().length == 1 )
            {
                connection = getSelectedAttributes()[0].getEntry().getBrowserConnection();
            }
            else if ( getSelectedAttributeHierarchies().length == 1 && getSelectedAttributeHierarchies()[0].size() == 1 )
            {
                connection = getSelectedAttributeHierarchies()[0].getAttribute().getEntry().getBrowserConnection();
            }

            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

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

        if ( input instanceof SchemaBrowserInput && tabFolder != null )
        {
            SchemaBrowserInput sbi = ( SchemaBrowserInput ) input;

            // set connection;
            IBrowserConnection connection = sbi.getConnection();
            setConnection( connection );

            // set schema element and activate tab
            AbstractSchemaDescription schemaElement = sbi.getSchemaElement();
            if ( schemaElement instanceof ObjectClassDescription )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

        // update shared working copy
        try
        {
            LdifContentRecord modifiedRecord = ( LdifContentRecord ) records[0];
            IBrowserConnection browserConnection = input.getSharedWorkingCopy( editor ).getBrowserConnection();
            DummyEntry modifiedEntry = ModelConverter.ldifContentRecordToEntry( modifiedRecord, browserConnection );
            ( ( DummyEntry ) input.getSharedWorkingCopy( editor ) ).setDn( modifiedEntry.getDn() );
            new CompoundModification().replaceAttributes( modifiedEntry, input.getSharedWorkingCopy( editor ), this );
        }
        catch ( InvalidNameException e )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

        cacheDateText = BaseWidgetUtils.createWrappedLabeledText( cacheComposite, "-", 1, 200 ); //$NON-NLS-1$

        BaseWidgetUtils.createLabel( cacheComposite, Messages.getString( "SchemaPropertyPage.CacheSize" ), 1 ); //$NON-NLS-1$
        cacheSizeText = BaseWidgetUtils.createWrappedLabeledText( cacheComposite, "-", 1, 200 ); //$NON-NLS-1$

        IBrowserConnection connection = RootDSEPropertyPage.getConnection( getElement() );
        update( connection );

        return composite;
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

    /**
     * Reloads schema.
     */
    private void reloadSchema()
    {
        final IBrowserConnection browserConnection = RootDSEPropertyPage.getConnection( getElement() );
        ReloadSchemaRunnable runnable = new ReloadSchemaRunnable( browserConnection );
        RunnableContextRunner.execute( runnable, null, true );
        update( browserConnection );
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

     */
    protected ConnectionAndDn getConnectionAndDn()
    {
        if ( getInput() instanceof IBrowserConnection )
        {
            IBrowserConnection conn = ( IBrowserConnection ) getInput();

            LdapDN dn = Utils.getLdapDn( getStringFromClipboard() );

            DnDialog dialog = new DnDialog(
                getShell(),
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection

            String extensionId = memento.getString( "EXTENSION" ); //$NON-NLS-1$
            EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
            EntryEditorExtension entryEditorExtension = entryEditorManager.getEntryEditorExtension( extensionId );
            if ( "IEntry".equals( type ) ) //$NON-NLS-1$
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
                LdapDN dn = new LdapDN( memento.getString( "DN" ) ); //$NON-NLS-1$
                IEntry entry = connection.getEntryFromCache( dn );
                super.setInput( new EntryEditorInput( entry, entryEditorExtension ) );
            }
            else if ( "ISearchResult".equals( type ) ) //$NON-NLS-1$
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
                ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) ); //$NON-NLS-1$
                ISearchResult[] searchResults = search.getSearchResults();
                LdapDN dn = new LdapDN( memento.getString( "DN" ) ); //$NON-NLS-1$
                for ( int i = 0; i < searchResults.length; i++ )
                {
                    if ( dn.equals( searchResults[i].getDn() ) )
                    {
                        super.setInput( new EntryEditorInput( searchResults[i], entryEditorExtension ) );
                        break;
                    }
                }
            }
            else if ( "IBookmark".equals( type ) ) //$NON-NLS-1$
            {
                IBrowserConnection connection = BrowserCorePlugin.getDefault().getConnectionManager()
                    .getBrowserConnectionById( memento.getString( "CONNECTION" ) ); //$NON-NLS-1$
                IBookmark bookmark = connection.getBookmarkManager().getBookmark( memento.getString( "BOOKMARK" ) ); //$NON-NLS-1$
                super.setInput( new EntryEditorInput( bookmark, entryEditorExtension ) );
            }
        }
        catch ( InvalidNameException e )
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.