KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > natures > PDE


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation 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  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.core.natures;
12
13 import org.eclipse.core.resources.IProject;
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.pde.internal.core.PDECore;
16
17
18 public class PDE {
19     public static final String JavaDoc PLUGIN_ID = "org.eclipse.pde"; //$NON-NLS-1$
20

21     public static final String JavaDoc MANIFEST_BUILDER_ID =
22         PLUGIN_ID + "." + "ManifestBuilder"; //$NON-NLS-1$ //$NON-NLS-2$
23
public static final String JavaDoc SCHEMA_BUILDER_ID =
24         PLUGIN_ID + "." + "SchemaBuilder"; //$NON-NLS-1$ //$NON-NLS-2$
25
public static final String JavaDoc PLUGIN_NATURE = PLUGIN_ID + "." + "PluginNature"; //$NON-NLS-1$ //$NON-NLS-2$
26
public static final String JavaDoc FEATURE_NATURE = PLUGIN_ID + "." + "FeatureNature"; //$NON-NLS-1$ //$NON-NLS-2$
27
public static final String JavaDoc SITE_NATURE = PLUGIN_ID + "." + "UpdateSiteNature"; //$NON-NLS-1$ //$NON-NLS-2$
28
public static final String JavaDoc FEATURE_BUILDER_ID =
29         PLUGIN_ID + "." + "FeatureBuilder"; //$NON-NLS-1$ //$NON-NLS-2$
30
public static final String JavaDoc SITE_BUILDER_ID =
31         PLUGIN_ID + "." + "UpdateSiteBuilder"; //$NON-NLS-1$ //$NON-NLS-2$
32

33     
34     public static boolean hasPluginNature(IProject project) {
35         try {
36             return project.hasNature(PLUGIN_NATURE);
37         } catch (CoreException e) {
38             PDECore.log(e);
39             return false;
40         }
41     }
42     
43     public static boolean hasFeatureNature(IProject project) {
44         try {
45             return project.hasNature(FEATURE_NATURE);
46         } catch (CoreException e) {
47             PDECore.log(e);
48             return false;
49         }
50     }
51
52     public static boolean hasUpdateSiteNature(IProject project) {
53         try {
54             return project.hasNature(SITE_NATURE);
55         } catch (CoreException e) {
56             PDECore.log(e);
57             return false;
58         }
59     }
60         
61 }
62
Popular Tags