View | Details | Raw Unified | Return to bug 191130 | Differences between
and this patch

Collapse All | Expand All

(-)UI/org/eclipse/rse/internal/ui/SystemResourceListener.java (-7 / +11 lines)
Lines 14-19 Link Here
14
 * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
14
 * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
15
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
16
 * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
16
 * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
17
 * David Dykstal (IBM) - [191130] log exception instead of printing, do not log if project is not available
17
 ********************************************************************************/
18
 ********************************************************************************/
18
19
19
package org.eclipse.rse.internal.ui;
20
package org.eclipse.rse.internal.ui;
Lines 25-30 Link Here
25
import org.eclipse.core.resources.IResourceChangeListener;
26
import org.eclipse.core.resources.IResourceChangeListener;
26
import org.eclipse.core.resources.IResourceDelta;
27
import org.eclipse.core.resources.IResourceDelta;
27
import org.eclipse.core.resources.IWorkspace;
28
import org.eclipse.core.resources.IWorkspace;
29
import org.eclipse.core.runtime.CoreException;
28
import org.eclipse.rse.core.ISystemResourceListener;
30
import org.eclipse.rse.core.ISystemResourceListener;
29
import org.eclipse.rse.core.RSECorePlugin;
31
import org.eclipse.rse.core.RSECorePlugin;
30
import org.eclipse.rse.core.SystemResourceManager;
32
import org.eclipse.rse.core.SystemResourceManager;
Lines 361-376 Link Here
361
            {
363
            {
362
            	if (!resource.getName().equals(remoteSystemsProject.getName()))
364
            	if (!resource.getName().equals(remoteSystemsProject.getName()))
363
            	  return true;
365
            	  return true;
366
                // [191130] the event can be ignored if the project cannot be accessed
367
            	if (!resource.isAccessible()) return true;
364
                try
368
                try
365
                {
369
                {
366
                    if (!(((IProject) resource).hasNature(RemoteSystemsProject.ID)))
370
                    if (!(((IProject) resource).hasNature(RemoteSystemsProject.ID)))
367
                        return true;
371
                        return true;
368
                }
372
					}
369
                catch (Exception exc)
373
                catch (CoreException exc)
370
                {
374
                {
371
                	System.out.println("Exception trying to test the natures of the project that fired a resource change event"); //$NON-NLS-1$
375
                	RSECorePlugin.getDefault().getLogger().logError("Exception trying to test the natures of the project that fired a resource change event", exc); //$NON-NLS-1$
372
                }
376
				}
373
            }
377
			}
374
        }
378
        }
375
        return false;
379
        return false;
376
    }
380
    }
Lines 733-739 Link Here
733
    {
737
    {
734
    	 SystemResourceListener us = null;
738
    	 SystemResourceListener us = null;
735
    	 if (inst == null)
739
    	 if (inst == null)
736
    	    us = getListener(SystemResourceManager.getRemoteSystemsProject());
740
    	    us = getListener(SystemResourceManager.getRemoteSystemsProject(false));
737
    	 else
741
    	 else
738
    	    us = inst;
742
    	    us = inst;
739
743
Lines 747-753 Link Here
747
    {
751
    {
748
    	 SystemResourceListener us = null;
752
    	 SystemResourceListener us = null;
749
    	 if (inst == null)
753
    	 if (inst == null)
750
    	    us = getListener(SystemResourceManager.getRemoteSystemsProject());
754
    	    us = getListener(SystemResourceManager.getRemoteSystemsProject(false));
751
    	 else
755
    	 else
752
    	    us = inst;
756
    	    us = inst;
753
    	    
757
    	    
(-)UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewResourceAdapterFactory.java (-2 / +3 lines)
Lines 12-18 Link Here
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * {Name} (company) - description of contribution.
15
 * David Dykstal (IBM) - [191130] fix unnecessary creation of the remote systems project
16
 *******************************************************************************/
16
 *******************************************************************************/
17
17
18
package org.eclipse.rse.internal.ui.view.team;
18
package org.eclipse.rse.internal.ui.view.team;
Lines 54-60 Link Here
54
	      if (adaptableObject instanceof ISystemRegistry)
54
	      if (adaptableObject instanceof ISystemRegistry)
55
	      {
55
	      {
56
	        //SystemRegistry sr = (SystemRegistry)adaptableObject; 
56
	        //SystemRegistry sr = (SystemRegistry)adaptableObject; 
57
	        adapter = SystemResourceManager.getRemoteSystemsProject();
57
	        // [191130] do not force the creation of the project, just return its handle
58
	        adapter = SystemResourceManager.getRemoteSystemsProject(false);
58
	      }
59
	      }
59
	      /* deferred
60
	      /* deferred
60
	      else if (adaptableObject instanceof SystemProfile)
61
	      else if (adaptableObject instanceof SystemProfile)
(-)UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewProfileAdapter.java (-1 / +2 lines)
Lines 17-22 Link Here
17
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
17
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
18
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
18
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
19
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
19
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
20
 * David Dykstal (IBM) - [191130] use new getRemoteSystemsProject(boolean) call
20
 ********************************************************************************/
21
 ********************************************************************************/
21
22
22
package org.eclipse.rse.internal.ui.view.team;
23
package org.eclipse.rse.internal.ui.view.team;
Lines 210-216 Link Here
210
	 */
211
	 */
211
	public Object getParent(Object element)
212
	public Object getParent(Object element)
212
	{
213
	{
213
		return SystemResourceManager.getRemoteSystemsProject();
214
		return SystemResourceManager.getRemoteSystemsProject(false);
214
	}
215
	}
215
	
216
	
216
	/**
217
	/**
(-)UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewRefreshAllAction.java (-3 / +6 lines)
Lines 13-21 Link Here
13
 * 
13
 * 
14
 * Contributors:
14
 * Contributors:
15
 * Michael Berger (IBM) - 146339 Added refresh action graphic.
15
 * Michael Berger (IBM) - 146339 Added refresh action graphic.
16
 * David Dykstal (IBM) - [191130] use new getRemoteSystemsProject(boolean) method
16
 *******************************************************************************/
17
 *******************************************************************************/
17
18
18
package org.eclipse.rse.internal.ui.view.team;
19
package org.eclipse.rse.internal.ui.view.team;
20
import org.eclipse.core.resources.IProject;
19
import org.eclipse.core.resources.IResource;
21
import org.eclipse.core.resources.IResource;
20
import org.eclipse.jface.viewers.IStructuredSelection;
22
import org.eclipse.jface.viewers.IStructuredSelection;
21
import org.eclipse.rse.core.SystemResourceManager;
23
import org.eclipse.rse.core.SystemResourceManager;
Lines 67-77 Link Here
67
	public void run() 
69
	public void run() 
68
	{
70
	{
69
		try {
71
		try {
70
		SystemResourceManager.getRemoteSystemsProject().refreshLocal(IResource.DEPTH_INFINITE, null);		
72
			IProject connectionsProject = SystemResourceManager.getRemoteSystemsProject(false);
73
			if (connectionsProject.isAccessible()) {
74
				connectionsProject.refreshLocal(IResource.DEPTH_INFINITE, null);		
75
			}
71
		} catch (Exception exc) {}
76
		} catch (Exception exc) {}
72
		
73
		SystemTeamView teamViewer = (SystemTeamView)teamView.getTreeViewer();
77
		SystemTeamView teamViewer = (SystemTeamView)teamView.getTreeViewer();
74
		teamViewer.refresh();
78
		teamViewer.refresh();
75
		//System.out.println("Running refresh all");
76
	}		
79
	}		
77
}
80
}
(-)src/org/eclipse/rse/internal/persistence/PFWorkspaceLocation.java (-1 / +2 lines)
Lines 10-15 Link Here
10
 * David Dykstal (IBM) - [189858] delayed the creation of the remote systems project by
10
 * David Dykstal (IBM) - [189858] delayed the creation of the remote systems project by
11
 *                                using handle-only operations. The project is created only
11
 *                                using handle-only operations. The project is created only
12
 *                                if required to exist for writing.
12
 *                                if required to exist for writing.
13
 * David Dykstal (IBM) - [191130] use explicit getRemoteSystemsProject(boolean) method
13
 *******************************************************************************/
14
 *******************************************************************************/
14
15
15
package org.eclipse.rse.internal.persistence;
16
package org.eclipse.rse.internal.persistence;
Lines 136-142 Link Here
136
	private void ensure(IContainer resource) {
137
	private void ensure(IContainer resource) {
137
		if (!resource.isAccessible()) {
138
		if (!resource.isAccessible()) {
138
			if (resource.getType() == IResource.PROJECT) {
139
			if (resource.getType() == IResource.PROJECT) {
139
				SystemResourceManager.getRemoteSystemsProject();
140
				SystemResourceManager.getRemoteSystemsProject(true);
140
			} else {
141
			} else {
141
				IFolder folder = (IFolder) resource;
142
				IFolder folder = (IFolder) resource;
142
				ensure(folder.getParent());
143
				ensure(folder.getParent());
(-)src/org/eclipse/rse/internal/persistence/SerializingProvider.java (-16 / +19 lines)
Lines 12-17 Link Here
12
 * 
12
 * 
13
 * Contributors:
13
 * Contributors:
14
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
14
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
15
 * David Dykstal (IBM) - [191130] use explicit getRemoteSystemsProject(boolean) method
15
 ********************************************************************************/
16
 ********************************************************************************/
16
17
17
package org.eclipse.rse.internal.persistence;
18
package org.eclipse.rse.internal.persistence;
Lines 57-77 Link Here
57
		 */
58
		 */
58
		List names = new Vector(10);
59
		List names = new Vector(10);
59
		try {
60
		try {
60
			IProject project = SystemResourceManager.getRemoteSystemsProject();
61
			IProject project = SystemResourceManager.getRemoteSystemsProject(false);
61
			IResource[] candidates = project.members();
62
			if (project.isAccessible()) {
62
			for (int i = 0; i < candidates.length; i++) {
63
				IResource[] candidates = project.members();
63
				IResource candidate = candidates[i];
64
				for (int i = 0; i < candidates.length; i++) {
64
				if (candidate.getType() == IResource.FOLDER) {
65
					IResource candidate = candidates[i];
65
					IFolder candidateFolder = (IFolder) candidate;
66
					if (candidate.getType() == IResource.FOLDER) {
66
					IResource[] children = candidateFolder.members();
67
						IFolder candidateFolder = (IFolder) candidate;
67
					if (children.length == 1) {
68
						IResource[] children = candidateFolder.members();
68
						IResource child = children[0];
69
						if (children.length == 1) {
69
						if (child.getType() == IResource.FILE) {
70
							IResource child = children[0];
70
							String profileName = candidateFolder.getName();
71
							if (child.getType() == IResource.FILE) {
71
							String domFileName = profileName + ".rsedom"; //$NON-NLS-1$
72
								String profileName = candidateFolder.getName();
72
							String childName = child.getName();
73
								String domFileName = profileName + ".rsedom"; //$NON-NLS-1$
73
							if (childName.equals(domFileName)) {
74
								String childName = child.getName();
74
								names.add(profileName);
75
								if (childName.equals(domFileName)) {
76
									names.add(profileName);
77
								}
75
							}
78
							}
76
						}
79
						}
77
					}
80
					}
Lines 114-120 Link Here
114
	}
117
	}
115
118
116
	private IFile getProfileFile(String domName, IProgressMonitor monitor) {
119
	private IFile getProfileFile(String domName, IProgressMonitor monitor) {
117
		IProject project = SystemResourceManager.getRemoteSystemsProject();
120
		IProject project = SystemResourceManager.getRemoteSystemsProject(true);
118
121
119
		// before loading, make sure the project is in synch
122
		// before loading, make sure the project is in synch
120
		try {
123
		try {
(-)src/org/eclipse/rse/core/SystemResourceManager.java (-14 / +18 lines)
Lines 19-24 Link Here
19
 *                                made ensureRemoteSystemsProject private instead of protected 
19
 *                                made ensureRemoteSystemsProject private instead of protected 
20
 * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
20
 * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
21
 *                                API to the user actions plugin
21
 *                                API to the user actions plugin
22
 * David Dykstal (IBM) - [191130] remove getRemoteSystemsProject() and getProfileFolder()
23
 *    as part of the work to removed the exception printed at startup.
22
 ********************************************************************************/
24
 ********************************************************************************/
23
25
24
package org.eclipse.rse.core;
26
package org.eclipse.rse.core;
Lines 148-169 Link Here
148
		  _listener.removeResourceChangeListener(l);
150
		  _listener.removeResourceChangeListener(l);
149
	}
151
	}
150
	
152
	
151
    /**
153
//    /**
152
	 * Get the default remote systems project.
154
//	 * Get the default remote systems project.
153
	 * If found but closed, this will open the project.
155
//	 * If found but closed, this will open the project.
154
	 * @return IProject handle of the project. Use exists() to test existence.
156
//	 * @return IProject handle of the project. Use exists() to test existence.
155
	 */
157
//	 * @deprecated use {@link #getRemoteSystemsProject(boolean)} instead.
156
	public static IProject getRemoteSystemsProject() 
158
//	 */
157
	{
159
//	public static IProject getRemoteSystemsProject() 
158
		return getRemoteSystemsProject(true);
160
//	{
159
	}
161
//		return getRemoteSystemsProject(true);
162
//	}
160
163
161
	/**
164
	/**
162
	 * Get the default remote systems project.
165
	 * Get the default remote systems project.
163
	 * If found but closed, this will open the project.
166
	 * If found but closed, this will open the project.
164
	 * @param force if true force the creation of the project if not found.
167
	 * @param force if true force the creation of the project if not found.
165
	 * In any case, returns handle to the project.
168
	 * In any case, returns handle to the project.
166
	 * @return IProject handle of the project. Use exists() to test existence.
169
	 * @return IProject handle of the project. Clients should use 
170
	 * exists() or isAccessible() to test existence.
167
	 */
171
	 */
168
	public static IProject getRemoteSystemsProject(boolean force) {
172
	public static IProject getRemoteSystemsProject(boolean force) {
169
		if (remoteSystemsProject == null) {
173
		if (remoteSystemsProject == null) {
Lines 273-282 Link Here
273
    /**
277
    /**
274
     * Get profiles folder for a given profile name
278
     * Get profiles folder for a given profile name
275
     */
279
     */
276
    public static IFolder getProfileFolder(String profileName)
280
//    public static IFolder getProfileFolder(String profileName)
277
    {
281
//    {
278
        return getResourceHelpers().getOrCreateFolder(getRemoteSystemsProject(),profileName);      	
282
//        return getResourceHelpers().getOrCreateFolder(getRemoteSystemsProject(),profileName);      	
279
    }
283
//    }
280
284
281
285
282
    // -------------------
286
    // -------------------

Return to bug 191130