Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 166025 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/hyades/test/ui/internal/navigator/proxy/DeploymentProxyNode.java (+6 lines)
Lines 49-54 Link Here
49
				addBidirectionalReference("Deploy2Location", (IReferencerProxyNode) location, "Location2Deploy"); //$NON-NLS-1$ //$NON-NLS-2$
49
				addBidirectionalReference("Deploy2Location", (IReferencerProxyNode) location, "Location2Deploy"); //$NON-NLS-1$ //$NON-NLS-2$
50
			}
50
			}
51
		}
51
		}
52
		for (Iterator it = deploy.getRefLocations().iterator(); it.hasNext();) {
53
			IProxyNode location = FileProxyNodeCache.getInstance().getCorrespondingProxy((CFGLocation)it.next());
54
			if(location != null) {
55
				addBidirectionalReference("Deploy2Location", (IReferencerProxyNode) location, "Location2Deploy"); //$NON-NLS-1$ //$NON-NLS-2$
56
			}
57
		}
52
	}
58
	}
53
59
54
	/**
60
	/**
(-)src/org/eclipse/hyades/test/ui/util/TestUIUtil.java (-1 / +60 lines)
Lines 12-19 Link Here
12
package org.eclipse.hyades.test.ui.util;
12
package org.eclipse.hyades.test.ui.util;
13
13
14
import java.io.File;
14
import java.io.File;
15
import java.util.ArrayList;
16
import java.util.Collection;
15
import java.util.Iterator;
17
import java.util.Iterator;
16
import java.util.List;
18
import java.util.List;
19
import java.util.Set;
17
20
18
import org.eclipse.core.resources.IFile;
21
import org.eclipse.core.resources.IFile;
19
import org.eclipse.core.runtime.IAdaptable;
22
import org.eclipse.core.runtime.IAdaptable;
Lines 22-27 Link Here
22
import org.eclipse.hyades.models.common.facades.behavioral.INamedElement;
25
import org.eclipse.hyades.models.common.facades.behavioral.INamedElement;
23
import org.eclipse.hyades.test.core.util.EMFUtil;
26
import org.eclipse.hyades.test.core.util.EMFUtil;
24
import org.eclipse.hyades.test.ui.UiPlugin;
27
import org.eclipse.hyades.test.ui.UiPlugin;
28
import org.eclipse.hyades.test.ui.internal.navigator.TestNavigator;
29
import org.eclipse.hyades.test.ui.internal.navigator.proxy.reference.ReferenceTypeRegistry;
30
import org.eclipse.hyades.test.ui.navigator.EObjectProxyNode;
31
import org.eclipse.hyades.test.ui.navigator.IFileProxyManager;
32
import org.eclipse.hyades.test.ui.navigator.IProxyNode;
25
import org.eclipse.hyades.ui.internal.util.UIUtil;
33
import org.eclipse.hyades.ui.internal.util.UIUtil;
26
import org.eclipse.ui.IEditorDescriptor;
34
import org.eclipse.ui.IEditorDescriptor;
27
import org.eclipse.ui.IEditorPart;
35
import org.eclipse.ui.IEditorPart;
Lines 40-50 Link Here
40
 * 
48
 * 
41
 * @author  Marcelo Paternostro
49
 * @author  Marcelo Paternostro
42
 * @author  Paul E. Slauenwhite
50
 * @author  Paul E. Slauenwhite
43
 * @version February 28, 2008
51
 * @author jbozier
52
 * @version April 16, 2008
44
 * @since   February 1, 2005
53
 * @since   February 1, 2005
45
 */
54
 */
46
public class TestUIUtil
55
public class TestUIUtil
47
{
56
{
57
	
58
	/**
59
	 * Return list of all file representing EMF resource that are explicitly referenced by the EMF object stored in file
60
	 * WARNING : this method will only work if test view have been already opened (return null else)
61
	 * @param file EMF resource used to calculate references
62
	 * @return list of depending resource, NULL if file is not representing an EMF object 
63
	 */
64
	public static List getExplicitDependencies(IFile file) {
65
		if (file == null) {
66
			return null;
67
		}
68
		// get active proxy manager
69
		IFileProxyManager proxManager = null;
70
		if(PlatformUI.getWorkbench() != null) {
71
			TestNavigator nav = TestNavigator.getTestNavigator(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
72
			if (nav != null) {
73
				proxManager = nav.getCurrentFileProxyManager();
74
			}
75
		}
76
		if (proxManager == null) {
77
			return null;
78
		}
79
		IProxyNode prox = proxManager.getProxy(file, null);
80
		if (prox == null) {
81
			return  null; // no proxy for this resource
82
		}		
83
		List ret = new ArrayList();
84
		EObjectProxyNode eproxy = null;
85
		if (prox instanceof EObjectProxyNode) {
86
			eproxy = (EObjectProxyNode)prox;
87
		} else {
88
			return null;
89
		}
90
		Set allTypes = eproxy.getReferenceTypes();
91
		for (Iterator it = allTypes.iterator(); it.hasNext(); ) {			
92
			String type = (String)it.next();
93
			if (ReferenceTypeRegistry.getInstance().isExplicit(type)) {
94
				Collection references = eproxy.getReferences(type);
95
				for (Iterator it2 = references.iterator(); it2.hasNext();) {
96
					IProxyNode proxy = (IProxyNode) it2.next();
97
					IFile childFile = (IFile) proxy.getUnderlyingResource();
98
					if (childFile != null) {
99
						ret.add(childFile);
100
					}
101
				}
102
			}
103
		}
104
		return ret;
105
	}
106
	
48
	/**
107
	/**
49
	 * Returns a unique name based on the specified base and list of CMNNamedElement.
108
	 * Returns a unique name based on the specified base and list of CMNNamedElement.
50
	 * @param baseName
109
	 * @param baseName
(-)src/org/eclipse/hyades/test/ui/internal/editor/form/ArtifactLocationMapForm.java (+3 lines)
Lines 229-234 Link Here
229
						if(elements[i] instanceof CFGArtifactLocationPair)
229
						if(elements[i] instanceof CFGArtifactLocationPair)
230
						{
230
						{
231
							CFGArtifactLocationPair pair = (CFGArtifactLocationPair)elements[i];
231
							CFGArtifactLocationPair pair = (CFGArtifactLocationPair)elements[i];
232
							if((pair.getArtifact() == null) || (pair.getLocation() == null)) {
233
								continue;
234
							}
232
							if(pair.getArtifact().eIsProxy() || pair.getLocation().eIsProxy())
235
							if(pair.getArtifact().eIsProxy() || pair.getLocation().eIsProxy())
233
								continue;
236
								continue;
234
							resolvedEls.add(pair);
237
							resolvedEls.add(pair);

Return to bug 166025