1 11 package org.eclipse.ui.internal.activities.ws; 12 13 import java.util.Set ; 14 15 import org.eclipse.ui.activities.IActivity; 16 import org.eclipse.ui.activities.IActivityListener; 17 import org.eclipse.ui.activities.ICategory; 18 import org.eclipse.ui.activities.NotDefinedException; 19 20 28 public class CategorizedActivity implements IActivity { 29 30 33 private IActivity activity; 34 35 38 private ICategory category; 39 40 47 public CategorizedActivity(ICategory category, IActivity activity) { 48 this.activity = activity; 49 this.category = category; 50 } 51 52 55 public void addActivityListener(IActivityListener activityListener) { 56 activity.addActivityListener(activityListener); 57 } 58 59 62 public int compareTo(Object o) { 63 return activity.compareTo(o); 64 } 65 66 69 public boolean equals(Object o) { 70 if (o instanceof CategorizedActivity) { 71 if (((CategorizedActivity) o).getCategory().equals(getCategory())) { 72 return ((CategorizedActivity) o).getActivity().equals( 73 getActivity()); 74 } 75 } 76 return false; 77 } 78 79 82 public IActivity getActivity() { 83 return activity; 84 } 85 86 89 public Set getActivityRequirementBindings() { 90 return activity.getActivityRequirementBindings(); 91 } 92 93 96 public Set getActivityPatternBindings() { 97 return activity.getActivityPatternBindings(); 98 } 99 100 103 public ICategory getCategory() { 104 return category; 105 } 106 107 110 public String getId() { 111 return activity.getId(); 112 } 113 114 117 public String getName() throws NotDefinedException { 118 return activity.getName(); 119 } 120 121 124 public int hashCode() { 125 return activity.hashCode(); 126 } 127 128 131 public boolean isDefined() { 132 return activity.isDefined(); 133 } 134 135 138 public boolean isEnabled() { 139 return activity.isEnabled(); 140 } 141 142 145 public void removeActivityListener(IActivityListener activityListener) { 146 activity.removeActivityListener(activityListener); 147 } 148 149 152 public String toString() { 153 return category.getId() + " -> " + activity.getId(); } 155 156 159 public String getDescription() throws NotDefinedException { 160 return activity.getDescription(); 161 } 162 163 166 public boolean isDefaultEnabled() throws NotDefinedException { 167 return activity.isDefaultEnabled(); 168 } 169 } 170 | Popular Tags |