1 11 package org.eclipse.update.core.model; 12 13 import org.eclipse.update.core.FeatureReference; 14 import org.eclipse.update.core.IFeatureReference; 15 import org.eclipse.update.core.IImport; 16 import org.eclipse.update.core.IIncludedFeatureReference; 17 import org.eclipse.update.core.IUpdateConstants; 18 import org.eclipse.update.core.Import; 19 20 21 37 public class IncludedFeatureReferenceModel extends FeatureReference { 38 39 private boolean isOptional; 41 private int searchLocation; 42 43 55 public IncludedFeatureReferenceModel() { 56 super(); 57 isOptional(false); 58 setSearchLocation(IUpdateConstants.SEARCH_ROOT); 59 } 60 61 62 63 69 public IncludedFeatureReferenceModel(IncludedFeatureReferenceModel includedFeatureRef) { 70 super((FeatureReferenceModel)includedFeatureRef); 71 isOptional(includedFeatureRef.isOptional()); 72 setLabel(includedFeatureRef.getLabel()); 73 setSearchLocation(includedFeatureRef.getSearchLocation()); 74 setArch(includedFeatureRef.getOSArch()); 75 setWS(includedFeatureRef.getWS()); 76 setOS(includedFeatureRef.getOS()); 77 setNL(includedFeatureRef.getNL()); 78 setPatch(includedFeatureRef.getPatch()); 79 } 80 81 85 public IncludedFeatureReferenceModel(IFeatureReference featureReference) { 86 super((FeatureReferenceModel)featureReference); 87 if (featureReference instanceof IIncludedFeatureReference) 88 isOptional( ((IIncludedFeatureReference)featureReference).isOptional() ); 89 else 90 isOptional(false); 91 setSearchLocation(IUpdateConstants.SEARCH_ROOT); 92 setLabel(getLabel()); 93 } 94 95 110 public int getMatch(){ 111 return Import.RULE_PERFECT; 112 } 113 114 125 126 public int getSearchLocation(){ 127 return searchLocation; 128 } 129 130 131 132 138 public boolean isOptional() { 139 return isOptional; 140 } 141 142 143 144 145 149 public void isOptional(boolean isOptional) { 150 this.isOptional = isOptional; 151 } 152 153 158 public void setMatchingRule(int matchingRule) { 159 } 160 161 165 public void setSearchLocation(int searchLocation) { 166 this.searchLocation = searchLocation; 167 } 168 } 169 | Popular Tags |