peakml.util.swt
Class SWTTools

java.lang.Object
  extended by peakml.util.swt.SWTTools

public class SWTTools
extends java.lang.Object

Provides utility functions for SWT-applications.


Constructor Summary
SWTTools()
           
 
Method Summary
static org.eclipse.swt.widgets.Menu createMenu(org.eclipse.swt.widgets.Menu menu, java.lang.String name)
          Creates a menu-option in the given menu with the given name.
static org.eclipse.swt.widgets.MenuItem createMenuItem(org.eclipse.swt.widgets.Listener listener, org.eclipse.swt.widgets.Menu menu, java.lang.String name, org.eclipse.swt.graphics.Image icon, int style, int accelerator)
          Creates an item in the given menu-option.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWTTools

public SWTTools()
Method Detail

createMenu

public static org.eclipse.swt.widgets.Menu createMenu(org.eclipse.swt.widgets.Menu menu,
                                                      java.lang.String name)
Creates a menu-option in the given menu with the given name. An example would be "F&ile" for the ubiquitous file-menu.

Parameters:
menu - The menu to create for.
name - The name of the menu-option.
Returns:
The menu-entry.

createMenuItem

public static org.eclipse.swt.widgets.MenuItem createMenuItem(org.eclipse.swt.widgets.Listener listener,
                                                              org.eclipse.swt.widgets.Menu menu,
                                                              java.lang.String name,
                                                              org.eclipse.swt.graphics.Image icon,
                                                              int style,
                                                              int accelerator)
Creates an item in the given menu-option.

Parameters:
listener - Listener for the callbacks.
menu - The menu-option.
name - The name of the item.
icon - Optional icon.
style - For example SWT.PUSH
accelerator - Accelarator key (can be SWT.NONE)
Returns:
The menu-item.