Revision 2265
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/adapters/CAAdapterFactory.java (revision 2265) | ||
---|---|---|
2 | 2 |
package org.txm.ca.rcp.adapters; |
3 | 3 |
|
4 | 4 |
import org.eclipse.jface.resource.ImageDescriptor; |
5 |
import org.eclipse.ui.model.IWorkbenchAdapter; |
|
6 | 5 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
7 | 6 |
import org.osgi.framework.FrameworkUtil; |
8 | 7 |
import org.txm.ca.core.functions.CA; |
9 | 8 |
import org.txm.rcp.adapters.TXMResultAdapter; |
10 | 9 |
import org.txm.rcp.adapters.TXMResultAdapterFactory; |
11 | 10 |
|
12 |
|
|
13 | 11 |
/** |
14 | 12 |
* A factory for creating Adapter objects. |
15 |
*
|
|
13 |
* |
|
16 | 14 |
* @author mdecorde |
17 | 15 |
* @author sjacquot |
18 | 16 |
*/ |
19 | 17 |
public class CAAdapterFactory extends TXMResultAdapterFactory { |
20 | 18 |
|
21 |
|
|
22 |
public static final ImageDescriptor ICON = |
|
23 |
AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(CAAdapterFactory.class).getSymbolicName(), |
|
24 |
"platform:/plugin/"+ FrameworkUtil.getBundle(CAAdapterFactory.class).getSymbolicName() + "/icons/ca.png"); //$NON-NLS-1$ //$NON-NLS-2$ |
|
25 |
|
|
19 |
public static final ImageDescriptor ICON = AbstractUIPlugin.imageDescriptorFromPlugin( |
|
20 |
FrameworkUtil.getBundle(CAAdapterFactory.class).getSymbolicName(), |
|
21 |
"platform:/plugin/" + FrameworkUtil.getBundle(CAAdapterFactory.class).getSymbolicName() + "/icons/ca.png"); //$NON-NLS-1$ //$NON-NLS-2$ |
|
22 |
|
|
26 | 23 |
/** |
27 | 24 |
* Gets the adapter. |
28 | 25 |
* |
29 |
* @param adaptableObject the adaptable object |
|
30 |
* @param adapterType the adapter type |
|
26 |
* @param adaptableObject |
|
27 |
* the adaptable object |
|
28 |
* @param adapterType |
|
29 |
* the adapter type |
|
31 | 30 |
* @return the adapter |
32 |
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) |
|
31 |
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, |
|
32 |
* java.lang.Class) |
|
33 | 33 |
*/ |
34 | 34 |
@Override |
35 | 35 |
public Object getAdapter(Object adaptableObject, Class adapterType) { |
36 |
if(this.canAdapt(adapterType) && adaptableObject instanceof CA) {
|
|
36 |
if (this.canAdapt(adapterType) && adaptableObject instanceof CA) {
|
|
37 | 37 |
return new TXMResultAdapter() { |
38 | 38 |
@Override |
39 | 39 |
public ImageDescriptor getImageDescriptor(Object object) { |
... | ... | |
43 | 43 |
} |
44 | 44 |
return null; |
45 | 45 |
} |
46 |
|
|
47 |
|
|
48 | 46 |
} |
Also available in: Unified diff