Package org.apache.directory.studio.schemaeditor.view.wrappers

Examples of org.apache.directory.studio.schemaeditor.view.wrappers.ProjectWrapper


            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                SWT.YES | SWT.NO | SWT.ICON_QUESTION );
            int count = selection.size();
            if ( count == 1 )
            {
                ProjectWrapper wrapper = ( ProjectWrapper ) selection.getFirstElement();
                messageBox
                    .setMessage( NLS
                        .bind(
                            Messages.getString( "DeleteProjectAction.SureToDeleteProject" ), new String[] { wrapper.getProject().getName() } ) ); //$NON-NLS-1$
            }
            else
            {
                messageBox.setMessage( NLS.bind(
                    Messages.getString( "DeleteProjectAction.SureToDeleteProjects" ), new Object[] { count } ) ); //$NON-NLS-1$
            }
            if ( messageBox.open() == SWT.YES )
            {
                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


     */
    public String getText( Object element )
    {
        if ( element instanceof ProjectWrapper )
        {
            ProjectWrapper projectWrapper = ( ProjectWrapper ) element;
            return projectWrapper.getProject().getName();
        }

        // Default
        return super.getText( element );
    }
View Full Code Here

            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                SWT.YES | SWT.NO | SWT.ICON_QUESTION );
            int count = selection.size();
            if ( count == 1 )
            {
                ProjectWrapper wrapper = ( ProjectWrapper ) selection.getFirstElement();
                messageBox.setMessage( "Are you sure you want to delete project '" + wrapper.getProject().getName()
                    + "'?" );
            }
            else
            {
                messageBox.setMessage( "Are you sure you want to delete these " + count + " projects?" );
            }
            if ( messageBox.open() == SWT.YES )
            {
                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

            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                SWT.YES | SWT.NO | SWT.ICON_QUESTION );
            int count = selection.size();
            if ( count == 1 )
            {
                ProjectWrapper wrapper = ( ProjectWrapper ) selection.getFirstElement();
                messageBox.setMessage( "Are you sure you want to delete project '" + wrapper.getProject().getName()
                    + "'?" );
            }
            else
            {
                messageBox.setMessage( "Are you sure you want to delete these " + count + " projects?" );
            }
            if ( messageBox.open() == SWT.YES )
            {
                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

     */
    public String getText( Object element )
    {
        if ( element instanceof ProjectWrapper )
        {
            ProjectWrapper projectWrapper = ( ProjectWrapper ) element;
            return projectWrapper.getProject().getName();
        }

        // Default
        return super.getText( element );
    }
View Full Code Here

            // Showing the confirmation window
            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

            if ( !projectsViewRoot.hasChildren() )
            {
                for ( Project project : Activator.getDefault().getProjectsHandler().getProjects() )
                {
                    projectsViewRoot.addChild( new ProjectWrapper( project, tableViewer ) );
                }
            }

            children = projectsViewRoot.getChildren();
View Full Code Here

     */
    public String getText( Object element )
    {
        if ( element instanceof ProjectWrapper )
        {
            ProjectWrapper projectWrapper = ( ProjectWrapper ) element;
            return projectWrapper.getProject().getName();
        }

        // Default
        return super.getText( element );
    }
View Full Code Here

            if ( !projectsViewRoot.hasChildren() )
            {
                for ( Project project : Activator.getDefault().getProjectsHandler().getProjects() )
                {
                    projectsViewRoot.addChild( new ProjectWrapper( project, tableViewer ) );
                }
            }

            children = projectsViewRoot.getChildren();
View Full Code Here

     */
    public String getText( Object element )
    {
        if ( element instanceof ProjectWrapper )
        {
            ProjectWrapper projectWrapper = ( ProjectWrapper ) element;
            return projectWrapper.getProject().getName();
        }

        // Default
        return super.getText( element );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.schemaeditor.view.wrappers.ProjectWrapper

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.