1 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 toString() { 58 String name = model.getPluginBase().getName(); 59 return model.getResourceString(name); 60 } 61 } 62 | Popular Tags |