1 11 12 package org.eclipse.ui.internal.menus; 13 14 import org.eclipse.jface.action.IContributionItem; 15 import org.eclipse.jface.action.IContributionManager; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.swt.widgets.CoolBar; 18 import org.eclipse.swt.widgets.Menu; 19 import org.eclipse.swt.widgets.ToolBar; 20 21 34 final class LegacyContributionItem implements IContributionItem { 35 36 40 private final ILayoutNode node; 41 42 48 LegacyContributionItem(final ILayoutNode node) { 49 if (node == null) { 50 throw new NullPointerException ( 51 "A legacy contribution item requires a non-null layout node"); } 53 this.node = node; 54 } 55 56 61 public void dispose() { 62 64 } 65 66 71 public void fill(Composite parent) { 72 74 } 75 76 82 public void fill(CoolBar parent, int index) { 83 85 } 86 87 93 public void fill(Menu parent, int index) { 94 96 } 97 98 104 public void fill(ToolBar parent, int index) { 105 107 } 108 109 public final String getId() { 110 return node.getId(); 111 } 112 113 118 public boolean isDirty() { 119 return false; 121 } 122 123 128 public boolean isDynamic() { 129 return false; 131 } 132 133 138 public boolean isEnabled() { 139 return false; 141 } 142 143 148 public boolean isGroupMarker() { 149 return false; 151 } 152 153 158 public boolean isSeparator() { 159 return false; 161 } 162 163 168 public boolean isVisible() { 169 return false; 171 } 172 173 178 public void saveWidgetState() { 179 181 } 182 183 188 public void setParent(IContributionManager parent) { 189 191 } 192 193 198 public void setVisible(boolean visible) { 199 201 } 202 203 208 public void update() { 209 211 } 212 213 218 public void update(String id) { 219 221 } 222 223 public final String toString() { 224 final StringBuffer buffer = new StringBuffer (); 225 buffer.append("LegacyContributionItem("); buffer.append(node); 227 buffer.append(')'); 228 return buffer.toString(); 229 } 230 } 231 | Popular Tags |