Package org.apache.directory.ldapstudio.schemas.model

Examples of org.apache.directory.ldapstudio.schemas.model.SchemaPool


    /**
     * Creates a new instance of SearchViewContentProvider.
     */
    public SearchViewContentProvider()
    {
        SchemaPool schemaPool = SchemaPool.getInstance();
        objectClassTable = schemaPool.getObjectClassesAsMap();
        attributeTypeTable = schemaPool.getAttributeTypesAsMap();
    }
View Full Code Here


            messageBox.open();
        }
        else
        {
            //Getting the SchemaPool
            SchemaPool pool = SchemaPool.getInstance();
            // Getting the right schema
            Schema schema = pool.getSchema( schemaName );

            // Check if the schema isn't a core schema (core schema can't be modified
            if ( schema.type == Schema.SchemaType.coreSchema )
            {
                MessageBox messageBox = new MessageBox(
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.jface.action.Action#run()
     */
    public void run()
    {
        SchemaPool schemaPool = SchemaPool.getInstance();
        try
        {
            schemaPool.saveAll();
        }
        catch ( Exception e )
        {
            ErrorDialog
                .openError(
View Full Code Here

        }

        if ( schemaName != null )
        {
            // Getting the SchemaPool
            SchemaPool pool = SchemaPool.getInstance();
            // Getting the right schema
            Schema schema = pool.getSchema( schemaName );

            if ( schema.type == Schema.SchemaType.coreSchema )
            {
                MessageBox messageBox = new MessageBox(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK | SWT.ICON_ERROR );
                messageBox
                    .setMessage( Messages.getString( "RemoveSchemaAction.The_schema" ) + schemaName + Messages.getString( "RemoveSchemaAction.Is_a_core_schema_It_cant_be_removed_from_the_pool" ) ); //$NON-NLS-1$ //$NON-NLS-2$
                messageBox.open();
                return;
            }
            if ( schema.hasBeenModified() || schema.hasPendingModification() )
            {
                MessageBox messageBox = new MessageBox(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OK | SWT.CANCEL
                        | SWT.ICON_QUESTION );
                messageBox.setMessage( Messages
                    .getString( "RemoveSchemaAction.This_schema_has_been_modified_or_has_pending_modifications" ) ); //$NON-NLS-1$
                if ( messageBox.open() == SWT.OK )
                {
                    pool.removeSchema( schema );
                }
            }
            else
                pool.removeSchema( schema );
        }
    }
View Full Code Here

            }

            Pattern pattern = Pattern.compile( searchRegexp, Pattern.CASE_INSENSITIVE );
            ArrayList resultsList = new ArrayList();

            SchemaPool schemaPool = SchemaPool.getInstance();

            ArrayList<AttributeType> atList = new ArrayList<AttributeType>( schemaPool
                .getAttributeTypesAsHashTableByName().values() );

            // Sorting the list
            Collections.sort( atList, new Comparator<AttributeType>()
            {
View Full Code Here

    public void drop( DropTargetEvent event )
    {
        if ( fileTransfer.isSupportedType( event.currentDataType ) )
        {
            SchemaPool pool = SchemaPool.getInstance();
            String[] files = ( String[] ) event.data;
            for ( int i = 0; i < files.length; i++ )
            {
                try
                {
                    pool.addAlreadyExistingSchema( files[i], SchemaType.userSchema );
                }
                catch ( SchemaCreationException e )
                {
                    logger.debug( "error when initializing new schema after drag&drop: " + files[i] ); //$NON-NLS-1$
                }
View Full Code Here

            messageBox.open();
        }
        else
        {
            // Getting the SchemaPool
            SchemaPool pool = SchemaPool.getInstance();
            // Getting the right schema
            Schema schema = pool.getSchema( schemaName );

            // Check if the schema isn't a core schema (core schema can't be modified
            if ( schema.type == Schema.SchemaType.coreSchema )
            {
                MessageBox messageBox = new MessageBox(
View Full Code Here

        fd.setFilterExtensions( filterExt );
        String selected = fd.open();
        // selected == null if 'cancel' has been pushed
        if ( selected != null )
        {
            SchemaPool pool = SchemaPool.getInstance();
            try
            {
                pool.addAlreadyExistingSchema( selected, SchemaType.userSchema );
            }
            catch ( Exception e )
            {
                logger.debug( "Error when opening a schema file" ); //$NON-NLS-1$
            }
View Full Code Here

            messageBox.open();
        }
        else
        {
            // Getting the SchemaPool
            SchemaPool pool = SchemaPool.getInstance();
            // Getting the right schema
            Schema schema = pool.getSchema( schemaName );

            // Check if the schema isn't a core schema (core schema can't be modified
            if ( schema.type == Schema.SchemaType.coreSchema )
            {
                MessageBox messageBox = new MessageBox(
View Full Code Here

    }


    private void initViewer()
    {
        SchemaPool pool = SchemaPool.getInstance();
        //we want to be notified if the pool has been modified
        pool.addListener( this );

        viewer = new TreeViewer( parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
        contentProvider = new PoolManagerContentProvider();
        contentProvider.bindToTreeViewer( viewer );
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.schemas.model.SchemaPool

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.