net.sourceforge.geeboss.util
Class WidgetUtil

java.lang.Object
  extended by net.sourceforge.geeboss.util.WidgetUtil

public class WidgetUtil
extends java.lang.Object

Utility class for widgets


Method Summary
static void createWildCardMenu(org.eclipse.swt.widgets.Text text, java.lang.String[] wildcards)
          Apply a wildcard popup menu to the text.
static void createWildCardMenu(org.eclipse.swt.widgets.Text text, java.lang.String[] wildcards, java.lang.String[] labels)
          Apply a wildcard popup menu to the text.
static void initMnemonics(org.eclipse.swt.widgets.Button[] buttons)
          Set Mnemonics to the given Array of Buttons.
static void initMnemonics(org.eclipse.swt.widgets.Menu menu)
          Init the mnemonics for the given Menu
static void initMnemonics(org.eclipse.swt.widgets.MenuItem[] items)
          Recursivly sets the mnemonic for each Menu and MenuItem.
static boolean isset(org.eclipse.swt.widgets.Widget widget)
          Check the given widget for being NULL or disposed.
static void tweakTextWidget(org.eclipse.swt.widgets.Text text)
          Tweak the Text widget with adding listeners to call the selectAll() Method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createWildCardMenu

public static void createWildCardMenu(org.eclipse.swt.widgets.Text text,
                                      java.lang.String[] wildcards)
Apply a wildcard popup menu to the text. Wildcards a displayed as "[TEXT]" and represent replaceable parameters.

Parameters:
text - The control to append the menu
wildcards - The wildcards to add to the menu

createWildCardMenu

public static void createWildCardMenu(org.eclipse.swt.widgets.Text text,
                                      java.lang.String[] wildcards,
                                      java.lang.String[] labels)
Apply a wildcard popup menu to the text. Wildcards a displayed as "[TEXT]" and represent replaceable parameters.

Parameters:
text - The control to append the menu
wildcards - The wildcards to add to the menu
labels - The labels for the menuitems

initMnemonics

public static void initMnemonics(org.eclipse.swt.widgets.Menu menu)
Init the mnemonics for the given Menu

Parameters:
menu - The Menu to init the Mnemonics

initMnemonics

public static void initMnemonics(org.eclipse.swt.widgets.MenuItem[] items)
Recursivly sets the mnemonic for each Menu and MenuItem. The method trys to set a mnemonic that has not yet been set (trys all chars of the name).

Parameters:
items - The MenuItems

initMnemonics

public static void initMnemonics(org.eclipse.swt.widgets.Button[] buttons)
Set Mnemonics to the given Array of Buttons.

Parameters:
buttons - The Buttons

isset

public static boolean isset(org.eclipse.swt.widgets.Widget widget)
Check the given widget for being NULL or disposed. Return false in that case.

Parameters:
widget - The widget to check
Returns:
boolean true if the widget is alive

tweakTextWidget

public static void tweakTextWidget(org.eclipse.swt.widgets.Text text)
Tweak the Text widget with adding listeners to call the selectAll() Method. The Method is called on MouseDoubleClick and on CTRL+A / CMD+A pressed.

Parameters:
text - The Text widget to tweak


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.