Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1126d682474495052403080039e87e4eb1fc588f (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
/**********************************************************************
 * Copyright (c) 2002,2003 QNX Software Systems Ltd. and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v0.5
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors: 
 * QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core;

import org.eclipse.cdt.core.ICExtension;
import org.eclipse.cdt.core.ICExtensionReference;
import org.eclipse.core.runtime.CoreException;

public class CExtensionReference implements ICExtensionReference {
	private CDescriptor fDescriptor;
	private String fName;
	private String fId;
		
	public CExtensionReference(CDescriptor descriptor, String name, String id) {
		fDescriptor = descriptor;
		fName = name;
		fId = id;
	}

	public String getExtension() {
		return fName;
	}

	public String getID() {
		return fId;
	}

	private CExtensionInfo getInfo() {
		return fDescriptor.getInfo(this);
	}

	public void setExtensionData(String key, String value) {
		getInfo().setAttribute(key, value);
	}

	public String getExtensionData(String key) {
		return getInfo().getAttribute(key);
	}
	
	public ICExtension createExtension() throws CoreException {
		return fDescriptor.createExtensions(this);
	}

}

Back to the top