Package org.apache.directory.studio.schemaeditor.model

Examples of org.apache.directory.studio.schemaeditor.model.Schema


     * @param at
     *      the attribute type
     */
    public void removeAttributeType( AttributeType at )
    {
        Schema schema = getSchema( at.getSchemaName() );

        schema.removeAttributeType( at );
        removeSchemaObject( at );

        // Notifying the listeners
        notifyAttributeTypeRemoved( at );
    }
View Full Code Here


     * @param oc
     *      the object class
     */
    public void addObjectClass( MutableObjectClass oc )
    {
        Schema schema = getSchema( oc.getSchemaName() );

        schema.addObjectClass( oc );
        addSchemaObject( oc );

        // Notifying the listeners
        notifyObjectClassAdded( oc );
    }
View Full Code Here

     * @param oc
     *      the object class
     */
    public void removeObjectClass( ObjectClass oc )
    {
        Schema schema = getSchema( oc.getSchemaName() );

        schema.removeObjectClass( oc );
        removeSchemaObject( oc );

        notifyObjectClassRemoved( oc );
    }
View Full Code Here

                state = ElementState.WARNING;
            }
        }
        else if ( element instanceof SchemaWrapper )
        {
            Schema schema = ( ( SchemaWrapper ) element ).getSchema();

            for ( AttributeType at : schema.getAttributeTypes() )
            {
                if ( schemaChecker.hasErrors( at ) )
                {
                    decorateState( ElementState.ERROR, decoration );
                    return;
                }

                if ( schemaChecker.hasWarnings( at ) )
                {
                    state = ElementState.WARNING;
                }
            }

            for ( ObjectClass oc : schema.getObjectClasses() )
            {
                if ( schemaChecker.hasErrors( oc ) )
                {
                    decorateState( ElementState.ERROR, decoration );
                    return;
View Full Code Here

            if ( EditorsUtils.saveAllDirtyEditors() )
            {
                // SCHEMA
                if ( selectedElement instanceof SchemaWrapper )
                {
                    Schema schema = ( ( SchemaWrapper ) selectedElement ).getSchema();

                    RenameSchemaDialog dialog = new RenameSchemaDialog( schema.getSchemaName() );
                    if ( dialog.open() == RenameSchemaDialog.OK )
                    {
                        Activator.getDefault().getSchemaHandler().renameSchema( schema, dialog.getNewName() );
                    }
                }
View Full Code Here

     * @return
     *      the corresponding schema, or null if no schema has been found
     */
    public static Schema loadCoreSchema( ServerTypeEnum serverType, String schemaName )
    {
        Schema schema = null;

        try
        {
            URL url = Activator.getDefault().getBundle().getResource(
                "resources/schemas/" + getFolderName( serverType ) + "/" + schemaName + ".xml" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
View Full Code Here

                    IDecoration.BOTTOM_LEFT );
            }
        }
        else if ( element instanceof SchemaWrapper )
        {
            Schema schema = ( ( SchemaWrapper ) element ).getSchema();

            for ( AttributeTypeImpl at : schema.getAttributeTypes() )
            {
                if ( schemaChecker.hasErrors( at ) )
                {
                    decoration.addOverlay( Activator.getDefault()
                        .getImageDescriptor( PluginConstants.IMG_OVERLAY_ERROR ), IDecoration.BOTTOM_LEFT );
                    return;
                }

                if ( schemaChecker.hasWarnings( at ) )
                {
                    decoration.addOverlay( Activator.getDefault().getImageDescriptor(
                        PluginConstants.IMG_OVERLAY_WARNING ), IDecoration.BOTTOM_LEFT );
                }
            }

            for ( ObjectClassImpl oc : schema.getObjectClasses() )
            {
                if ( schemaChecker.hasErrors( oc ) )
                {
                    decoration.addOverlay( Activator.getDefault()
                        .getImageDescriptor( PluginConstants.IMG_OVERLAY_ERROR ), IDecoration.BOTTOM_LEFT );
View Full Code Here

     * @return
     *      the corresponding schema, or null if no schema has been found
     */
    public static Schema loadCoreSchema( ServerTypeEnum serverType, String schemaName )
    {
        Schema schema = null;

        try
        {
            URL url = Activator.getDefault().getBundle().getResource(
                "resources/schemas/" + getFolderName( serverType ) + "/" + schemaName + ".xml" );
View Full Code Here

     *      the corresponding schema
     */
    public static Schema readSchema( Element element, String path ) throws XMLSchemaFileImportException
    {
        // Creating the schema with an empty name
        Schema schema = new SchemaImpl( null );

        // Name
        schema.setName( getSchemaName( element, path ) );

        // Attribute Types
        readAttributeTypes( element, schema );

        // Object Classes
View Full Code Here

            if ( ( selectedSchemas != null ) && ( serverType != null ) )
            {
                SchemaHandler schemaHandler = project.getSchemaHandler();
                for ( String selectedSchema : selectedSchemas )
                {
                    Schema schema = PluginUtils.loadCoreSchema( serverType, selectedSchema );
                    if ( schema != null )
                    {
                        schemaHandler.addSchema( schema );
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.model.Schema

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.