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

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


    public String getSchemaValue()
    {
        StructuredSelection selection = ( StructuredSelection ) schemaComboViewer.getSelection();
        if ( !selection.isEmpty() )
        {
            Schema schema = ( Schema ) selection.getFirstElement();

            return schema.getName();
        }
        else
        {
            return null;
        }
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 = Platform.getBundle( Activator.PLUGIN_ID ).getResource(
                "resources/schemas/" + getFolderName( serverType ) + "/" + schemaName + ".xml" );
View Full Code Here

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

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

                if ( schemaChecker.hasWarnings( at ) )
                {
                    decoration.addOverlay( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                        PluginConstants.IMG_OVERLAY_WARNING ), IDecoration.BOTTOM_LEFT );
                }
            }

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

                    for ( File schemaFile : selectedSchemasFiles )
                    {
                        monitor.subTask( schemaFile.getName() );
                        try
                        {
                            Schema schema = OpenLdapSchemaFileImporter.getSchema( new FileInputStream( schemaFile ),
                                schemaFile.getAbsolutePath() );
                            schemaHandler.addSchema( schema );
                        }
                        catch ( OpenLdapSchemaFileImportException e )
                        {
View Full Code Here

                            SchemaFileType schemaFileType = XMLSchemaFileImporter.getSchemaFileType( new FileInputStream( schemaFile ),
                                schemaFile.getAbsolutePath() );
                            switch ( schemaFileType )
                            {
                                case SINGLE:
                                    Schema importedSchema = XMLSchemaFileImporter.getSchema( new FileInputStream( schemaFile ),
                                        schemaFile.getAbsolutePath() );
                                    schemaHandler.addSchema( importedSchema );
                                    break;
                                case MULTIPLE:
                                    Schema[] schemas = XMLSchemaFileImporter.getSchemas( new FileInputStream( schemaFile ), schemaFile
View Full Code Here

     * @param at
     *      the attribute type
     */
    public void addAttributeType( AttributeTypeImpl at )
    {
        Schema schema = getSchema( at.getSchema() );

        if ( schema == null )
        {
            // TODO Throw an exception
        }

        schema.addAttributeType( at );
        addSchemaObject( at );

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

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

        if ( schema == null )
        {
            // TODO Throw an exception
        }

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

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

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

        if ( schema == null )
        {
            // TODO Throw an exception
        }

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

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

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

        if ( schema == null )
        {
            // TODO Throw an exception
        }

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

        notifyObjectClassRemoved( oc );
    }
View Full Code Here

     * @see org.eclipse.jface.action.Action#run()
     */
    public void run()
    {
        // Getting the selection
        Schema selectedSchema = null;

        int presentation = Activator.getDefault().getPreferenceStore().getInt(
            PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_PRESENTATION );
        if ( presentation == PluginConstants.PREFS_SCHEMA_VIEW_SCHEMA_PRESENTATION_FLAT )
        {
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.