Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.Project


        projectPath = projectPath.replaceAll("\\\\", "/"); //$NON-NLS-1$//$NON-NLS-2$

        while (projectPath.endsWith("/")) { //$NON-NLS-1$
            projectPath = projectPath.substring(0, projectPath.length() - 2);
        }
        Project project = ProjectPlugin.getPlugin().getProjectRegistry()
                .getProject(projectPath + File.separator + projectName + ".udig"); //$NON-NLS-1$ //$NON-NLS-2$
        project.setName(projectName);
        Resource projectResource = project.eResource();
        try {
            projectResource.save(Collections.EMPTY_MAP);
        } catch (IOException e) {
            ProjectUIPlugin.log(
                    "Error during saving the project file of an anew created project", e); //$NON-NLS-1$
View Full Code Here


    }
    @Override
    public void perform( IProgressMonitor monitor ) {
        Collection<ProjectElement> elements = toProjectElements();

        Project destination = (Project) getDestination();

        Collection<Project> projects = collectAffectedProjects(elements, destination);

        Collection<String> messages = ProjectPlugin.saveProjects(projects);
        if (!messages.isEmpty()) {
            MessageDialog
                    .openError(
                            Display.getDefault().getActiveShell(),
                            "Error saving projects",
                            "An error occurred while attempting to save projects.  Please verify you have write access to the project files and no other applications have locked the files.");
            return;
        }

        Collection<ProjectElement> allElements = removeFromOldProjects(elements);

        destination.getElementsInternal().addAll(allElements);

        Collection<String> errors = ProjectPlugin.saveProjects(projects);

        if (!errors.isEmpty()) {
            MessageDialog
View Full Code Here

    private Collection<ProjectElement> removeFromOldProjects( Collection<ProjectElement> elements ) {
        HashSet<ProjectElement> all = new HashSet<ProjectElement>();
       
        for( ProjectElement projectElement : elements ) {
            Project projectInternal = projectElement.getProjectInternal();
            all.add(projectElement);
            List<ProjectElement> children = projectElement.getElements(ProjectElement.class);
            all.addAll(removeFromOldProjects(children));
            if (projectInternal != null) {
                projectInternal.getElementsInternal().remove(projectElement);
            }
        }
       
        return all;
    }
View Full Code Here

        Collection<Project> projects = new HashSet<Project>();
        projects.add(destination);

        for( ProjectElement projectElement : elements ) {
            Project projectInternal = projectElement.getProjectInternal();
            if (projectInternal != null) {
                projects.add(projectInternal);
            }
            Collection<Project> affectedProjects = collectAffectedProjects(projectElement
                    .getElements(ProjectElement.class), destination);
View Full Code Here

     *
     * @return The current active project, or null if no such project exists.
     * @deprecated - use to {@link ApplicationGIS#getActiveProject()}
     */
    public static IProject getActiveProject() {
        Project project = ProjectPlugin.getPlugin().getProjectRegistry()
            .getCurrentProject();
       
        if (project != null) return project;
       
        return ProjectPlugin.getPlugin().getProjectRegistry()
View Full Code Here

     * Obtains the current project.
     *
     * @return The current active project
     */
    public static IProject getActiveProject() {
        Project project = ProjectPlugin.getPlugin().getProjectRegistry()
                .getCurrentProject();

        if (project != null)
            return project;

View Full Code Here

     * can't find one.
     *
     * @uml.property name="projectInternal"
     */
    public Project getProjectInternal() {
        Project genResult = getProjectInternalGen();
        if (genResult == null) {
            EObject parent = eContainer();
            while (parent != null) {
                if (parent instanceof Project) {
                    return (Project) parent;
View Full Code Here

     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetProjectInternal(Project newProjectInternal,
            NotificationChain msgs) {
        Project oldProjectInternal = projectInternal;
        projectInternal = newProjectInternal;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
                    ProjectPackage.MAP__PROJECT_INTERNAL, oldProjectInternal, newProjectInternal);
            if (msgs == null)
View Full Code Here

     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetProjectInternal( Project newProjectInternal,
            NotificationChain msgs ) {
        Project oldProjectInternal = projectInternal;
        projectInternal = newProjectInternal;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelPackage.PAGE__PROJECT_INTERNAL, oldProjectInternal, newProjectInternal);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case ProjectPackage.PROJECT: {
            Project project = (Project) theEObject;
            T result = caseProject(project);
            if (result == null)
                result = caseIProject(project);
            if (result == null)
                result = defaultCase(theEObject);
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.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.