1 11 package org.eclipse.jface.action; 12 13 import org.eclipse.swt.widgets.Composite; 14 import org.eclipse.swt.widgets.CoolBar; 15 import org.eclipse.swt.widgets.Menu; 16 import org.eclipse.swt.widgets.ToolBar; 17 18 21 public abstract class ContributionItem implements IContributionItem { 22 23 26 private String id = null; 27 28 32 private boolean visible = true; 33 34 37 private IContributionManager parent; 38 39 43 protected ContributionItem() { 44 this(null); 45 } 46 47 54 protected ContributionItem(String id) { 55 this.id = id; 56 } 57 58 62 public void dispose() { 63 } 64 65 69 public void fill(Composite parent) { 70 } 71 72 76 public void fill(Menu menu, int index) { 77 } 78 79 83 public void fill(ToolBar parent, int index) { 84 } 85 86 92 public void fill(CoolBar parent, int index) { 93 } 94 95 101 public void saveWidgetState() { 102 } 103 104 107 public String getId() { 108 return id; 109 } 110 111 118 public IContributionManager getParent() { 119 return parent; 120 } 121 122 126 public boolean isDirty() { 127 return isDynamic(); 129 } 130 131 135 public boolean isEnabled() { 136 return true; 137 } 138 139 143 public boolean isDynamic() { 144 return false; 145 } 146 147 151 public boolean isGroupMarker() { 152 return false; 153 } 154 155 159 public boolean isSeparator() { 160 return false; 161 } 162 163 169 public boolean isVisible() { 170 return visible; 171 } 172 173 178 public void setVisible(boolean visible) { 179 this.visible = visible; 180 } 181 182 186 public String toString() { 187 return getClass().getName() + "(id=" + getId() + ")"; } 189 190 194 public void update() { 195 } 196 197 200 public void setParent(IContributionManager parent) { 201 this.parent = parent; 202 } 203 204 209 public void update(String id) { 210 } 211 } 212 | Popular Tags |