KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > feature > PluginReference


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.ui.editor.feature;
12
13 import org.eclipse.pde.core.plugin.IPluginModelBase;
14 import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
15
16
17 public class PluginReference {
18     private IFeaturePlugin reference;
19     private IPluginModelBase model;
20     private boolean fragment;
21
22 public PluginReference(IFeaturePlugin reference, IPluginModelBase model) {
23     this.reference = reference;
24     this.model = model;
25 }
26 public IPluginModelBase getModel() {
27     return model;
28 }
29 public IFeaturePlugin getReference() {
30     return reference;
31 }
32 public boolean isFragment() {
33     return fragment;
34 }
35 public boolean isInSync() {
36     if (model == null)
37         return false;
38     if (reference==null) return true;
39     if (!reference.getId().equals(model.getPluginBase().getId()))
40         return false;
41     if (!reference.getVersion().equals(model.getPluginBase().getVersion()))
42         return false;
43     return true;
44 }
45 public boolean isUnresolved() {
46     return false;
47 }
48 public void setFragment(boolean newFragment) {
49     fragment = newFragment;
50 }
51 public void setModel(IPluginModelBase newModel) {
52     model = newModel;
53 }
54 public void setReference(IFeaturePlugin newReference) {
55     reference = newReference;
56 }
57     public String JavaDoc toString() {
58         String JavaDoc name = model.getPluginBase().getName();
59         return model.getResourceString(name);
60     }
61 }
62
Popular Tags