KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > builders > PDEMarkerFactory


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.builders;
12
13 import org.eclipse.core.resources.IFile;
14 import org.eclipse.core.resources.IMarker;
15 import org.eclipse.core.runtime.CoreException;
16
17 public class PDEMarkerFactory implements IMarkerFactory {
18     
19     public static final String JavaDoc MARKER_ID = "org.eclipse.pde.core.problem"; //$NON-NLS-1$
20

21     public static final int NO_RESOLUTION = -1;
22     
23     // manifest source fixes
24
public static final int M_DEPRECATED_AUTOSTART = 0x1001; // other problem
25
public static final int M_JAVA_PACKAGE__PORTED = 0x1002; // fatal error
26
public static final int M_SINGLETON_DIR_NOT_SET = 0x1003; // other problem
27
public static final int M_SINGLETON_ATT_NOT_SET = 0x1004; // other problem
28
public static final int M_PROJECT_BUILD_ORDER_ENTRIES = 0x1005;
29     public static final int M_EXPORT_PKG_NOT_EXIST = 0x1006; // other problem
30
public static final int M_IMPORT_PKG_NOT_AVAILABLE = 0x1007; // fatal error
31
public static final int M_REQ_BUNDLE_NOT_AVAILABLE = 0x1008; // fatal error
32
public static final int M_UNKNOWN_CLASS = 0x1009; // fatal error
33
public static final int M_UNKNOWN_ACTIVATOR = 0x1010; // fatal error
34
public static final int M_SINGLETON_DIR_NOT_SUPPORTED = 0x1011; // other problem
35
public static final int M_DIRECTIVE_HAS_NO_EFFECT = 0x1012; // other problem
36
public static final int M_MISMATCHED_EXEC_ENV = 0x1013; // fatal error
37
public static final int M_UNKNOW_EXEC_ENV = 0x1014; // other problem
38
public static final int M_DEPRECATED_IMPORT_SERVICE = 0x1015; // deprecation
39
public static final int M_DEPRECATED_EXPORT_SERVICE = 0x1016; // deprecation
40
public static final int M_UNECESSARY_DEP = 0x1017; // other problem
41
public static final int M_MISSING_EXPORT_PKGS = 0x1018; // other problem
42

43     // build properties fixes
44
public static final int B_APPEND_SLASH_FOLDER_ENTRY = 0x2001;
45     public static final int B_REMOVE_SLASH_FILE_ENTRY = 0x2002;
46     public static final int B_ADDDITION = 0x2003;
47     public static final int B_SOURCE_ADDITION = 0x2004;
48     public static final int B_REMOVAL = 0x2005;
49     
50     // plugin.xml fixes
51
public static final int P_ILLEGAL_XML_NODE = 0x3001;
52     public static final int P_UNTRANSLATED_NODE = 0x3002;
53     public static final int P_UNKNOWN_CLASS = 0x3003;
54     
55     // marker attribute keys
56
public static final String JavaDoc BK_BUILD_ENTRY = "buildEntry.key"; //$NON-NLS-1$
57
public static final String JavaDoc BK_BUILD_TOKEN = "buildEntry.tokenValue"; //$NON-NLS-1$
58
public static final String JavaDoc MPK_LOCATION_PATH = "xmlTree.locationPath"; //$NON-NLS-1$
59

60     // problem categories
61
public static final String JavaDoc CAT_FATAL = "fatal"; //$NON-NLS-1$
62
public static final String JavaDoc CAT_NLS = "nls"; //$NON-NLS-1$
63
public static final String JavaDoc CAT_DEPRECATION = "deprecation"; //$NON-NLS-1$
64
public static final String JavaDoc CAT_EE = "ee"; //$NON-NLS-1$
65
public static final String JavaDoc CAT_OTHER = ""; //$NON-NLS-1$
66

67     /**
68      * @see org.eclipse.pde.internal.core.builders.IMarkerFactory#createMarker(org.eclipse.core.resources.IFile)
69      */

70     public IMarker createMarker(IFile file) throws CoreException {
71         return createMarker(file, NO_RESOLUTION, ""); //$NON-NLS-1$
72
}
73     
74     public IMarker createMarker(IFile file, int id, String JavaDoc category) throws CoreException {
75         IMarker marker = file.createMarker(MARKER_ID);
76         marker.setAttribute("id", id); //$NON-NLS-1$
77
marker.setAttribute("categoryId", category); //$NON-NLS-1$
78
return marker;
79     }
80
81 }
82
Popular Tags