1 11 package org.eclipse.update.internal.operations; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.update.core.*; 15 16 17 21 public class FeatureStatus extends Status { 22 public final static int CODE_OTHER = IStatus.OK; public final static int CODE_PREREQ_FEATURE = 1; 24 public final static int CODE_PREREQ_PLUGIN = 2; 25 public final static int CODE_EXCLUSIVE = 4; 26 public final static int CODE_CYCLE = 8; 27 public final static int CODE_OPTIONAL_CHILD = 16; 28 public final static int CODE_ENVIRONMENT = 32; 29 IFeature feature; 30 31 public FeatureStatus(IFeature feature, int severity, String pluginId, int code, String message, Throwable exception) { 32 super(severity, pluginId, code, message, exception); 33 this.feature = feature; 34 } 35 public IFeature getFeature() { 36 return feature; 37 } 38 public boolean equals(Object obj) { 39 if (!(obj instanceof FeatureStatus)) 40 return false; 41 FeatureStatus fs = (FeatureStatus) obj; 42 if (fs.getFeature() == feature) 44 return true; 45 else if (fs.getFeature() == null && feature == null) 46 return fs.getMessage().equals(getMessage()); 47 else if (fs.getFeature() == null && feature != null) 48 return false; 49 else if (fs.getFeature() != null && feature == null) 50 return false; 51 else if (fs.getFeature().equals(feature)) 52 return true; 53 else 54 return false; 55 } 56 57 } 58 | Popular Tags |