blob: ea0623e4c8a1a451ef43ebf7ec5609b448dde0a1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
<title>DeveloperAdapterFactory Class After Editing</title>
</head>
<body>
<h1>DeveloperAdapterFactory Class After Editing</h1>
<pre><samp>
package samples.model;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.rse.ui.view.AbstractSystemRemoteAdapterFactory;
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
import org.eclipse.ui.views.properties.IPropertySource;
/**
* This factory maps requests for an adapter object from a given remote object.
*/
public class DeveloperAdapterFactory
extends AbstractSystemRemoteAdapterFactory
implements IAdapterFactory
{
<b>private TeamResourceAdapter teamAdapter = new TeamResourceAdapter();
private DeveloperResourceAdapter developerAdapter = new DeveloperResourceAdapter();</b>
/**
* Constructor for DeveloperAdapterFactory.
*/
public DeveloperAdapterFactory()
{
super();
}
/**
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(Object, Class)
*/
public Object getAdapter(Object adaptableObject, Class adapterType)
{
<b>ISystemViewElementAdapter adapter = null;
if (adaptableObject instanceof TeamResource)
adapter = teamAdapter;
else if (adaptableObject instanceof DeveloperResource)
adapter = developerAdapter;
// <i>these lines are very important! </i>
if ((adapter != null) && (adapterType == IPropertySource.class))
adapter.setPropertySourceInput(adaptableObject);
return adapter;</b>
}
}
</samp></pre>
</body>
</html>
|