KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > correction > RemoveStaticProjectReferences


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.ui.correction;
12
13 import org.eclipse.core.resources.IMarker;
14 import org.eclipse.core.resources.IProject;
15 import org.eclipse.core.resources.IProjectDescription;
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.pde.core.IBaseModel;
18 import org.eclipse.pde.internal.ui.PDEUIMessages;
19
20 public class RemoveStaticProjectReferences extends AbstractPDEMarkerResolution {
21
22     public RemoveStaticProjectReferences(int type) {
23         super(type);
24     }
25
26     public String JavaDoc getDescription() {
27         return PDEUIMessages.RemoveBuildOrderEntries_desc;
28     }
29
30     public String JavaDoc getLabel() {
31         return PDEUIMessages.RemoveBuildOrderEntries_label;
32     }
33
34     public void run(IMarker marker) {
35         try {
36             IProject project = marker.getResource().getProject();
37             if (project == null) return;
38             IProjectDescription projDesc = project.getDescription();
39             if (projDesc == null) return;
40             projDesc.setReferencedProjects(new IProject[0]);
41             project.setDescription(projDesc, null);
42         } catch (CoreException e) {
43         }
44     }
45
46     protected void createChange(IBaseModel model) {
47         // overridden run method handles everything
48
}
49 }
50
Popular Tags