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

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


        }

        for ( Iterator<?> i = rootElement.elementIterator( PROJECT_TAG ); i.hasNext(); )
        {
            Element projectElement = ( Element ) i.next();
            Project project = new Project();
            readProject( projectElement, project, path );
            projects.add( project );
        }

        return projects.toArray( new Project[0] );
View Full Code Here


    public void run()
    {
        StructuredSelection selection = ( StructuredSelection ) viewer.getSelection();
        if ( ( !selection.isEmpty() ) && ( selection.size() == 1 ) )
        {
            Project project = ( ( ProjectWrapper ) selection.getFirstElement() ).getProject();
            RenameProjectDialog dialog = new RenameProjectDialog( project.getName() );
            if ( dialog.open() == Dialog.OK )
            {
                projectsHandler.renameProject( project, dialog.getNewName() );
            }
        }
View Full Code Here

            if ( MessageDialog.openConfirm( viewer.getControl().getShell(), title.toString(), message.toString() ) )
            {
                for ( Iterator<?> iterator = selection.iterator(); iterator.hasNext(); )
                {
                    ProjectWrapper wrapper = ( ProjectWrapper ) iterator.next();
                    Project project = wrapper.getProject();

                    if ( project.getState() == ProjectState.OPEN )
                    {
                        // Closing the project before removing it.
                        projectsHandler.closeProject( project );
                    }
View Full Code Here

                    for ( File projectFile : selectedProjectFiles )
                    {
                        monitor.subTask( projectFile.getName() );
                        try
                        {
                            Project project = ProjectsImporter.getProject( new FileInputStream( projectFile ),
                                projectFile.getAbsolutePath() );

                            if ( projectsHandler.isProjectNameAlreadyTaken( project.getName() ) )
                            {
                                PluginUtils
                                    .logError(
                                        NLS
                                            .bind(
                                                Messages.getString( "ImportProjectsWizard.ErrorImportingProject" ), //$NON-NLS-1$
                                                new String[]
                                                    { project.getName() } ), null );
                                ViewUtils
                                    .displayErrorMessageDialog(
                                        Messages.getString( "ImportProjectsWizard.ImportError" ), //$NON-NLS-1$
                                        NLS
                                            .bind(
                                                Messages.getString( "ImportProjectsWizard.ErrorImportingProject" ) //$NON-NLS-1$
                                                    + "\n" //$NON-NLS-1$
                                                    + Messages
                                                        .getString( "ImportProjectsWizard.ErrorProjectNameExists" ), //$NON-NLS-1$
                                                new String[]
                                                    { project.getName() } ) );
                            }
                            else
                            {
                                projectsHandler.addProject( project );
                            }
View Full Code Here

                {
                    return ( ( List<?> ) parentElement ).toArray();
                }
                if ( parentElement instanceof Project )
                {
                    Project project = ( Project ) parentElement;
                    List<Schema> schemas = project.getSchemaHandler().getSchemas();
                    return schemas.toArray();
                }
                if ( parentElement instanceof Schema )
                {
                    Schema schema = ( Schema ) parentElement;
View Full Code Here

    {
        coreSchemaSelectionWidget = new CoreSchemasSelectionWidget();
        Composite composite = coreSchemaSelectionWidget.createWidget( parent );
        coreSchemaSelectionWidget.init( ServerTypeEnum.APACHE_DS );

        Project project = Activator.getDefault().getProjectsHandler().getOpenProject();
        if ( project != null )
        {
            List<Schema> schemas = project.getSchemaHandler().getSchemas();
            List<String> schemaNames = new ArrayList<String>();
            for ( Schema schema : schemas )
            {
                schemaNames.add( schema.getSchemaName() );
            }
View Full Code Here

    /**
     * Initializes the UI Fields.
     */
    private void initFields()
    {
        Project project = Activator.getDefault().getProjectsHandler().getOpenProject();

        differencesWidget.setInput( DifferenceEngine.getDifferences( project.getInitialSchema(), project
            .getSchemaHandler().getSchemas() ) );
    }
View Full Code Here

    /**
     * Initializes the state of the View.
     */
    private void initState()
    {
        Project project = Activator.getDefault().getProjectsHandler().getOpenProject();
        if ( project != null )
        {
            viewer.getTree().setEnabled( true );
            newSchema.setEnabled( true );
            newAttributeType.setEnabled( true );
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 )
                    {
                        case OPEN:
                            return Activator.getDefault().getImage( PluginConstants.IMG_PROJECT_OFFLINE );
                        case CLOSED:
                            return Activator.getDefault().getImage( PluginConstants.IMG_PROJECT_OFFLINE_CLOSED );
                    }
                case ONLINE:
                    ProjectState state2 = project.getState();
                    switch ( state2 )
                    {
                        case OPEN:
                            return Activator.getDefault().getImage( PluginConstants.IMG_PROJECT_ONLINE );
                        case CLOSED:
View Full Code Here

    /**
     * Initializes the state of the View.
     */
    private void initState()
    {
        Project project = Activator.getDefault().getProjectsHandler().getOpenProject();
        if ( project != null )
        {
            viewer.getTree().setEnabled( true );
            newSchema.setEnabled( true );
            newAttributeType.setEnabled( true );
View Full Code Here

TOP

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

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.