1 11 package org.eclipse.ui.help; 12 13 import org.eclipse.help.IContext; 14 import org.eclipse.help.IHelp; 15 import org.eclipse.jface.action.IAction; 16 import org.eclipse.swt.events.HelpListener; 17 import org.eclipse.swt.widgets.Control; 18 import org.eclipse.swt.widgets.Menu; 19 import org.eclipse.swt.widgets.MenuItem; 20 import org.eclipse.ui.PlatformUI; 21 import org.eclipse.ui.commands.ICommand; 22 import org.eclipse.ui.internal.help.WorkbenchHelpSystem; 23 24 54 public class WorkbenchHelp { 55 56 59 private WorkbenchHelp() { 60 } 61 62 70 public static void displayHelp() { 71 PlatformUI.getWorkbench().getHelpSystem().displayHelp(); 72 } 73 74 92 public static void displayContext(IContext context, int x, int y) { 93 PlatformUI.getWorkbench().getHelpSystem().displayContext(context, x, y); 94 } 95 96 115 public static void displayHelpResource(String href) { 116 PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(href); 117 } 118 119 129 public static HelpListener createHelpListener(ICommand command) { 130 return WorkbenchHelpSystem.getInstance().createHelpListener(command); 131 } 132 133 142 public static void displayHelp(String contextId) { 143 PlatformUI.getWorkbench().getHelpSystem().displayHelp(contextId); 144 } 145 146 155 public static void displayHelp(IContext context) { 156 PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); 157 } 158 159 173 public static Object getHelp(Control control) { 174 return control.getData(WorkbenchHelpSystem.HELP_KEY); 175 } 176 177 191 public static Object getHelp(Menu menu) { 192 return menu.getData(WorkbenchHelpSystem.HELP_KEY); 193 } 194 195 209 public static Object getHelp(MenuItem menuItem) { 210 return menuItem.getData(WorkbenchHelpSystem.HELP_KEY); 211 } 212 213 221 public static IHelp getHelpSupport() { 222 return WorkbenchHelpSystem.getInstance().getHelpSupport(); 223 } 224 225 226 234 public static boolean isContextHelpDisplayed() { 235 return PlatformUI.getWorkbench().getHelpSystem().isContextHelpDisplayed(); 236 } 237 238 252 public static void setHelp(IAction action, final Object [] contexts) { 253 WorkbenchHelpSystem.getInstance().setHelp(action, contexts); 254 } 255 256 270 public static void setHelp(IAction action, final IContextComputer computer) { 271 WorkbenchHelpSystem.getInstance().setHelp(action, computer); 272 } 273 274 288 public static void setHelp(Control control, Object [] contexts) { 289 WorkbenchHelpSystem.getInstance().setHelp(control, contexts); 290 } 291 292 306 public static void setHelp(Control control, IContextComputer computer) { 307 WorkbenchHelpSystem.getInstance().setHelp(control, computer); 308 } 309 310 324 public static void setHelp(Menu menu, Object [] contexts) { 325 WorkbenchHelpSystem.getInstance().setHelp(menu, contexts); 326 } 327 328 342 public static void setHelp(Menu menu, IContextComputer computer) { 343 WorkbenchHelpSystem.getInstance().setHelp(menu, computer); 344 } 345 346 360 public static void setHelp(MenuItem item, Object [] contexts) { 361 WorkbenchHelpSystem.getInstance().setHelp(item, contexts); 362 } 363 364 378 public static void setHelp(MenuItem item, IContextComputer computer) { 379 WorkbenchHelpSystem.getInstance().setHelp(item, computer); 380 } 381 382 389 public static void setHelp(IAction action, final String contextId) { 390 PlatformUI.getWorkbench().getHelpSystem().setHelp(action, contextId); 391 } 392 393 400 public static void setHelp(Control control, String contextId) { 401 PlatformUI.getWorkbench().getHelpSystem().setHelp(control, contextId); 402 } 403 404 411 public static void setHelp(Menu menu, String contextId) { 412 PlatformUI.getWorkbench().getHelpSystem().setHelp(menu, contextId); 413 } 414 415 422 public static void setHelp(MenuItem item, String contextId) { 423 PlatformUI.getWorkbench().getHelpSystem().setHelp(item, contextId); 424 } 425 } 426 | Popular Tags |