1 11 package org.eclipse.update.internal.ui.model; 12 13 import java.io.*; 14 import java.net.*; 15 16 import org.eclipse.core.runtime.*; 17 import org.eclipse.update.core.*; 18 import org.eclipse.update.core.model.*; 19 import org.eclipse.update.internal.ui.*; 20 21 public class MissingFeature implements IFeature { 22 23 private URL url; 24 private ISite site; 25 private IFeatureReference reference; 26 private IFeature parent; 27 private IURLEntry desc; 28 private VersionedIdentifier id = new VersionedIdentifier(UpdateUIMessages.MissingFeature_id, "0.0.0"); public MissingFeature(ISite site, URL url) { 30 this.site = site; 31 this.url = url; 32 desc = new IURLEntry() { 33 public URL getURL() { 34 return null; 35 } 36 public String getAnnotation() { 37 return UpdateUIMessages.MissingFeature_desc_unknown; 38 } 39 public Object getAdapter(Class key) { 40 return null; 41 } 42 public int getType() { 43 return IURLEntry.UPDATE_SITE; 44 } 45 }; 46 } 47 public MissingFeature(IFeatureReference ref) { 48 this(null, ref); 49 } 50 51 public MissingFeature(IFeature parent, IFeatureReference ref) { 52 this(ref.getSite(), ref.getURL()); 53 this.reference = ref; 54 this.parent = parent; 55 56 if (isOptional()) { 57 desc = new IURLEntry() { 58 public URL getURL() { 59 return null; 60 } 61 public String getAnnotation() { 62 return UpdateUIMessages.MissingFeature_desc_optional; 63 } 64 public Object getAdapter(Class key) { 65 return null; 66 } 67 public int getType() { 68 return IURLEntry.UPDATE_SITE; 69 } 70 }; 71 } 72 } 73 74 public boolean isOptional() { 75 return reference != null 76 && reference instanceof IIncludedFeatureReference 77 && ((IIncludedFeatureReference) reference).isOptional(); 78 } 79 80 public IFeature getParent() { 81 return parent; 82 } 83 84 public URL getOriginatingSiteURL() { 85 VersionedIdentifier vid = getVersionedIdentifier(); 86 if (vid == null) 87 return null; 88 String key = vid.getIdentifier(); 89 return UpdateUI.getOriginatingURL(key); 90 } 91 92 95 public VersionedIdentifier getVersionedIdentifier() { 96 if (reference != null) { 97 try { 98 return reference.getVersionedIdentifier(); 99 } catch (CoreException e) { 100 } 101 } 102 return id; 103 } 104 105 108 public ISite getSite() { 109 return site; 110 } 111 112 115 public String getLabel() { 116 if (reference != null 117 && reference instanceof IIncludedFeatureReference) { 118 String name = ((IIncludedFeatureReference) reference).getName(); 119 if (name != null) 120 return name; 121 } 122 return url.toString(); 123 } 124 125 128 public URL getURL() { 129 return url; 130 } 131 132 135 public IURLEntry getUpdateSiteEntry() { 136 return null; 137 } 138 139 142 public IURLEntry[] getDiscoverySiteEntries() { 143 return null; 144 } 145 146 149 public String getProvider() { 150 return UpdateUIMessages.MissingFeature_provider; 151 } 152 153 156 public IURLEntry getDescription() { 157 return desc; 158 } 159 160 163 public IURLEntry getCopyright() { 164 return null; 165 } 166 167 170 public IURLEntry getLicense() { 171 return null; 172 } 173 174 177 public String getOS() { 178 return null; 179 } 180 181 184 public String getWS() { 185 return null; 186 } 187 188 191 public String getNL() { 192 return null; 193 } 194 195 198 public String getOSArch() { 199 return null; 200 } 201 202 205 public URL getImage() { 206 return null; 207 } 208 209 212 public IImport[] getImports() { 213 return null; 214 } 215 216 219 public String [] getArchives() { 220 return null; 221 } 222 223 226 public INonPluginEntry[] getNonPluginEntries() { 227 return null; 228 } 229 230 233 public void addNonPluginEntry(INonPluginEntry dataEntry) { 234 } 235 236 239 public long getDownloadSize() { 240 return 0; 241 } 242 243 246 public long getInstallSize() { 247 return 0; 248 } 249 250 253 public boolean isPrimary() { 254 return false; 255 } 256 257 260 public String getApplication() { 261 return null; 262 } 263 264 267 public IPluginEntry[] getPluginEntries() { 268 return new IPluginEntry[0]; 269 } 270 271 274 public int getPluginEntryCount() { 275 return 0; 276 } 277 278 281 public long getDownloadSize(IPluginEntry entry) { 282 return 0; 283 } 284 285 288 public long getInstallSize(IPluginEntry entry) { 289 return 0; 290 } 291 292 295 public void addPluginEntry(IPluginEntry pluginEntry) { 296 } 297 298 301 public void store(IPluginEntry entry, String name, InputStream inStream) 302 throws CoreException { 303 } 304 305 308 public Object getAdapter(Class adapter) { 309 return null; 310 } 311 312 315 public void remove(IPluginEntry entry) throws CoreException { 316 } 317 318 321 public void setFeatureContentProvider(IFeatureContentProvider featureContentProvider) { 322 } 323 324 327 public IFeatureContentConsumer getFeatureContentConsumer() 328 throws CoreException { 329 return null; 330 } 331 332 335 public void setSite(ISite site) throws CoreException { 336 this.site = site; 337 } 338 339 342 public IFeatureContentProvider getFeatureContentProvider() 343 throws CoreException { 344 return null; 345 } 346 347 350 public IFeatureReference install( 351 IFeature targetFeature, 352 IVerificationListener verificationListener, 353 IProgressMonitor monitor) 354 throws CoreException { 355 return null; 356 } 357 358 361 public IFeatureReference install( 362 IFeature targetFeature, 363 IFeatureReference[] optionalFeatures, 364 IVerificationListener verificationListener, 365 IProgressMonitor monitor) 366 throws InstallAbortedException, CoreException { 367 return null; 368 } 369 372 public void remove(IProgressMonitor monitor) throws CoreException { 373 } 374 375 378 public void remove(IPluginEntry entry, IProgressMonitor monitor) 379 throws CoreException { 380 } 381 382 385 public int getNonPluginEntryCount() { 386 return 0; 387 } 388 389 392 public IInstallHandlerEntry getInstallHandlerEntry() { 393 return null; 394 } 395 398 public IIncludedFeatureReference[] getIncludedFeatureReferences() 399 throws CoreException { 400 return new IIncludedFeatureReference[0]; 401 } 402 403 406 public String getAffinityFeature() { 407 return null; 408 } 409 412 public IIncludedFeatureReference[] getRawIncludedFeatureReferences() 413 throws CoreException { 414 return getIncludedFeatureReferences(); 415 } 416 417 420 public INonPluginEntry[] getRawNonPluginEntries() { 421 return getNonPluginEntries(); 422 } 423 424 427 public IPluginEntry[] getRawPluginEntries() { 428 return getPluginEntries(); 429 } 430 431 434 public String getPrimaryPluginID() { 435 return null; 436 } 437 438 441 public IImport[] getRawImports() { 442 return new IImport[0]; 443 } 444 445 448 public boolean isPatch() { 449 return false; 450 } 451 452 public boolean isExclusive() { 453 return false; 454 } 455 456 } 457 | Popular Tags |