Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ffebf519bd973b6854e18eb34a3ad985a605d210 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*****************************************************************************
 * Copyright (c) 2013 CEA LIST.
 *
 *    
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.adltool.designer.bundle;

import java.util.ArrayList;

import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.papyrus.adltool.Activator;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.uml2.uml.Component;
import org.osgi.framework.Bundle;

/**
 * @deprecated
 *
 */
public class IPluginModelDescriptionDesigner extends AbstractBundleDescriptionDesigner {

	public String getSymbolicName(Object bundleProject) {
		if(bundleProject instanceof IPluginModelBase){
			return	((IPluginModelBase)bundleProject).getPluginBase().getId();
		}
		return null;
	}

	public void fillExportedPackages(Component bundleComponent, Object bundleProject) {
		// TODO Auto-generated method stub

	}
	@Override
	public void fillPluginProperties(Component bundleComponent, Object bundleProject) {
		if( bundleProject instanceof IPluginModelBase){
			IPluginModelBase tmpIPluginModelBase= (IPluginModelBase)bundleProject;
			BundleDescription tmpBundleDescription= tmpIPluginModelBase.getBundleDescription();
			fillPluginProperties(bundleComponent,tmpBundleDescription);

		}

	}

	public void fillPluginProperties(Component bundleComponent,BundleDescription bundleDesc ){
		
	}

	@Override
	public String getBundleValue(Object bundleProject, String key) {
		if( bundleProject instanceof IPluginModelBase){
			IPluginModelBase tmpIPluginModelBase= (IPluginModelBase)bundleProject;
			BundleDescription tmpBundleDescription= tmpIPluginModelBase.getBundleDescription();

			Bundle tmpBundle=Activator.getDefault().getBundleContext().getBundle(tmpBundleDescription.getBundleId());
			if(tmpBundle==null ){
				System.err.println("pb for "+tmpBundleDescription.getSymbolicName());
				return null;
			}
			return tmpBundle.getHeaders().get(key);
		}
		return null;
	}

	public String getName(Object bundleProject) {
		// TODO Auto-generated method stub
		return null;
	}

	public ArrayList<ReferencedOSGIElement> getRequiredBundle(Component bundleComponent, Object bundleProject) {
		// TODO Auto-generated method stub
		return null;
	}

}

Back to the top