~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwnerConfiguration.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2000, 2006 QNX Software Systems and others.
 
3
 * All rights reserved. This program and the accompanying materials
 
4
 * are made available under the terms of the Eclipse Public License v1.0
 
5
 * which accompanies this distribution, and is available at
 
6
 * http://www.eclipse.org/legal/epl-v10.html
 
7
 *
 
8
 * Contributors:
 
9
 *     QNX Software Systems - Initial API and implementation
 
10
 *******************************************************************************/
 
11
package org.eclipse.cdt.internal.core;
 
12
 
 
13
import org.eclipse.cdt.core.ICOwner;
 
14
import org.eclipse.core.runtime.CoreException;
 
15
import org.eclipse.core.runtime.IConfigurationElement;
 
16
 
 
17
public class COwnerConfiguration {
 
18
 
 
19
        final IConfigurationElement fElement;
 
20
        final String fOwnerID, fName;
 
21
        
 
22
        public COwnerConfiguration(IConfigurationElement element) {
 
23
                fElement = element;
 
24
                fOwnerID = fElement.getDeclaringExtension().getUniqueIdentifier();
 
25
                fName = fElement.getDeclaringExtension().getLabel();
 
26
        }
 
27
 
 
28
        public COwnerConfiguration(String id, String name) {
 
29
                fElement = null;
 
30
                fOwnerID = id;
 
31
                fName = name;
 
32
        }
 
33
        
 
34
        public String getOwnerID() {
 
35
                return fOwnerID;
 
36
        }
 
37
 
 
38
        public String getName() {
 
39
                return fName;
 
40
        }
 
41
 
 
42
        public String getPlatform() {
 
43
                String platform = null;
 
44
                if  (fElement != null) {
 
45
                        platform = fElement.getAttribute("platform"); //$NON-NLS-1$
 
46
                }
 
47
                return platform == null ? "*" : platform; //$NON-NLS-1$
 
48
        }
 
49
 
 
50
        public ICOwner createOwner() throws CoreException {
 
51
                if (fElement != null) {
 
52
                        return (ICOwner) fElement.createExecutableExtension("class"); //$NON-NLS-1$
 
53
                }
 
54
                return null;
 
55
        }
 
56
 
 
57
        public String getNature() {
 
58
                return fElement != null ? fElement.getAttribute("natureID") : null; //$NON-NLS-1$
 
59
        }
 
60
        
 
61
}