01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.editor.feature;
11:
12: import org.eclipse.pde.core.plugin.IPluginModelBase;
13: import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin;
14:
15: public class PluginReference {
16: private IFeaturePlugin reference;
17: private IPluginModelBase model;
18: private boolean fragment;
19:
20: public PluginReference(IFeaturePlugin reference,
21: IPluginModelBase model) {
22: this .reference = reference;
23: this .model = model;
24: }
25:
26: public IPluginModelBase getModel() {
27: return model;
28: }
29:
30: public IFeaturePlugin getReference() {
31: return reference;
32: }
33:
34: public boolean isFragment() {
35: return fragment;
36: }
37:
38: public boolean isInSync() {
39: if (model == null)
40: return false;
41: if (reference == null)
42: return true;
43: if (!reference.getId().equals(model.getPluginBase().getId()))
44: return false;
45: if (!reference.getVersion().equals(
46: model.getPluginBase().getVersion()))
47: return false;
48: return true;
49: }
50:
51: public boolean isUnresolved() {
52: return false;
53: }
54:
55: public void setFragment(boolean newFragment) {
56: fragment = newFragment;
57: }
58:
59: public void setModel(IPluginModelBase newModel) {
60: model = newModel;
61: }
62:
63: public void setReference(IFeaturePlugin newReference) {
64: reference = newReference;
65: }
66:
67: public String toString() {
68: String name = model.getPluginBase().getName();
69: return model.getResourceString(name);
70: }
71: }
|