1 11 12 package org.eclipse.ui.internal; 13 14 import org.eclipse.jface.action.IContributionItem; 15 import org.eclipse.jface.action.IContributionManager; 16 import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem; 17 import org.eclipse.swt.widgets.Composite; 18 import org.eclipse.swt.widgets.CoolBar; 19 import org.eclipse.swt.widgets.Menu; 20 import org.eclipse.swt.widgets.ToolBar; 21 22 30 final class PlaceholderContributionItem implements IContributionItem { 31 32 35 private final String id; 36 37 41 private final int storedHeight; 42 43 47 private final int storedMinimumItems; 48 49 52 private final boolean storedUseChevron; 53 54 58 private final int storedWidth; 59 60 67 PlaceholderContributionItem(final IToolBarContributionItem item) { 68 item.saveWidgetState(); 69 id = item.getId(); 70 storedHeight = item.getCurrentHeight(); 71 storedWidth = item.getCurrentWidth(); 72 storedMinimumItems = item.getMinimumItemsToShow(); 73 storedUseChevron = item.getUseChevron(); 74 } 75 76 81 public void dispose() { 82 } 84 85 90 public void fill(Composite parent) { 91 throw new UnsupportedOperationException (); 92 } 93 94 100 public void fill(CoolBar parent, int index) { 101 throw new UnsupportedOperationException (); 102 103 } 104 105 111 public void fill(Menu parent, int index) { 112 throw new UnsupportedOperationException (); 113 114 } 115 116 122 public void fill(ToolBar parent, int index) { 123 throw new UnsupportedOperationException (); 124 125 } 126 127 132 int getHeight() { 133 return storedHeight; 134 } 135 136 141 public String getId() { 142 return id; 143 } 144 145 150 int getWidth() { 151 return storedWidth; 152 } 153 154 162 int getMinimumItemsToShow() { 163 return storedMinimumItems; 164 } 165 166 173 boolean getUseChevron() { 174 return storedUseChevron; 175 } 176 177 182 public boolean isDirty() { 183 return false; 184 } 185 186 191 public boolean isDynamic() { 192 return false; 193 } 194 195 200 public boolean isEnabled() { 201 return false; 203 } 204 205 210 public boolean isGroupMarker() { 211 return false; 212 } 213 214 219 public boolean isSeparator() { 220 return false; 221 } 222 223 228 public boolean isVisible() { 229 return false; 230 } 231 232 237 public void saveWidgetState() { 238 240 } 241 242 247 public void setParent(IContributionManager parent) { 248 250 } 251 252 257 public void setVisible(boolean visible) { 258 } 260 261 265 public String toString() { 266 return "PlaceholderContributionItem(" + id + ")"; } 268 269 274 public void update() { 275 update(null); 276 277 } 278 279 284 public void update(String identifier) { 285 } 287 } 288 | Popular Tags |