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

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


            public Image getImage( Object element )
            {
                if ( element instanceof Project )
                {
                    ProjectType type = ( ( Project ) element ).getType();
                    switch ( type )
                    {
                        case OFFLINE:
                            return Activator.getDefault().getImage( PluginConstants.IMG_PROJECT_OFFLINE_CLOSED );
                        case ONLINE:
View Full Code Here


     * @see org.eclipse.jface.wizard.Wizard#performFinish()
     */
    public boolean performFinish()
    {
        String projectName = informationPage.getProjectName();
        ProjectType projectType = informationPage.getProjectType();

        // Creating the project
        final Project project = new Project( projectType, projectName );

        if ( projectType.equals( ProjectType.ONLINE ) )
        // Project is an "Online Project"
        {
            // Setting the connection to use
            project.setConnection( connectionSelectionPage.getSelectedConnection() );

            RunnableContextRunner.execute( new StudioRunnableWithProgress()
            {

                public void run( StudioProgressMonitor monitor )
                {
                    // Getting the correct SchemaConnector for this connection
                    List<SchemaConnector> correctSchemaConnectors = getCorrectSchemaConnectors(
                        project.getConnection(), monitor );

                    // If no suitable SchemaConnector has been found, we display an
                    // error message and return false;
                    if ( correctSchemaConnectors.size() == 0 )
                    {
                        monitor.reportError(
                            "No suitable SchemaConnector has been found for the choosen Directory Server.", //$NON-NLS-1$
                            new NoSuitableSchemaConnectorException() );
                    }

                    // Check if generic schema connector is included, then remove it to use a specific one
                    if ( correctSchemaConnectors.size() > 1 )
                    {
                        for ( SchemaConnector schemaConnector : correctSchemaConnectors )
                        {
                            if ( schemaConnector instanceof GenericSchemaConnector )
                            {
                                correctSchemaConnectors.remove( schemaConnector );
                                break;
                            }
                        }
                    }

                    // Getting the correct SchemaConnector
                    SchemaConnector correctSchemaConnector = null;
                    if ( correctSchemaConnectors.size() == 1 )
                    {
                        correctSchemaConnector = correctSchemaConnectors.get( 0 );
                    }
                    else
                    {
                        // TODO display a dialog in which the user can select the correct schema connector
                    }

                    project.setSchemaConnector( correctSchemaConnector );

                    // Fetching the Online Schema
                    project.fetchOnlineSchema( monitor );
                }


                public String getName()
                {
                    return null;
                }


                public Object[] getLockedObjects()
                {
                    return null;
                }


                public String getErrorMessage()
                {
                    return null;
                }


                public Connection[] getConnections()
                {
                    return null;
                }

            }, getContainer(), true );
        }
        else if ( projectType.equals( ProjectType.OFFLINE ) )
        // Project is an "Offline Project"
        {
            // Getting the selected 'core' schemas
            String[] selectedSchemas = schemasSelectionPage.getSelectedSchemas();
            ServerTypeEnum serverType = schemasSelectionPage.getServerType();
View Full Code Here

            public Image getImage( Object element )
            {
                if ( element instanceof Project )
                {
                    ProjectType type = ( ( Project ) element ).getType();
                    switch ( type )
                    {
                        case OFFLINE:
                            return Activator.getDefault().getImage( PluginConstants.IMG_PROJECT_OFFLINE_CLOSED );
                        case ONLINE:
View Full Code Here

            {
                element.addAttribute( NAME_TAG, name );
            }

            // Type
            ProjectType type = project.getType();
            if ( type != null )
            {
                element.addAttribute( TYPE_TAG, type.toString() );
            }

            // If project is an Online Schema Project
            if ( type.equals( ProjectType.ONLINE ) )
            {
                // Connection Name
                element.addAttribute( CONNECTION_TAG, project.getConnection().getId() );

                // Connection Name
View Full Code Here

     * @see org.eclipse.jface.wizard.Wizard#performFinish()
     */
    public boolean performFinish()
    {
        String projectName = informationPage.getProjectName();
        ProjectType projectType = informationPage.getProjectType();

        // Creating the project
        final Project project = new Project( projectType, projectName );

//        if ( projectType.equals( ProjectType.ONLINE ) )
View Full Code Here

    public Image getImage( Object element )
    {
        if ( element instanceof ProjectWrapper )
        {
            Project project = ( ( ProjectWrapper ) element ).getProject();
            ProjectType type = project.getType();
            switch ( type )
            {
                case OFFLINE:
                    ProjectState state = project.getState();
                    switch ( state )
View Full Code Here

            public Image getImage( Object element )
            {
                if ( element instanceof Project )
                {
                    ProjectType type = ( ( Project ) element ).getType();
                    switch ( type )
                    {
                        case OFFLINE:
                            return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
                                PluginConstants.IMG_PROJECT_OFFLINE_CLOSED ).createImage();
View Full Code Here

     * @see org.eclipse.jface.wizard.Wizard#performFinish()
     */
    public boolean performFinish()
    {
        String projectName = informationPage.getProjectName();
        ProjectType projectType = informationPage.getProjectType();

        // Creating the project
        final Project project = new Project( projectType, projectName );

//        if ( projectType.equals( ProjectType.ONLINE ) )
View Full Code Here

            {
                element.addAttribute( NAME_TAG, name );
            }

            // Type
            ProjectType type = project.getType();
            if ( type != null )
            {
                element.addAttribute( TYPE_TAG, type.toString() );
            }

            // If project is an Apache Directory Server Online Schema Project
            if ( type.equals( ProjectType.APACHE_DIRECTORY_SERVER ) )
            {
                // Connection Name
                element.addAttribute( CONNECTION_TAG, project.getConnection().getName() );

                // Schema Backup
View Full Code Here

    public Image getImage( Object element )
    {
        if ( element instanceof ProjectWrapper )
        {
            Project project = ( ( ProjectWrapper ) element ).getProject();
            ProjectType type = project.getType();
            switch ( type )
            {
                case OFFLINE:
                    ProjectState state = project.getState();
                    switch ( state )
View Full Code Here

TOP

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

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.