utils
Class StockIcon

java.lang.Object
  extended by utils.StockIcon

public class StockIcon
extends java.lang.Object

This class provides easy access to the icons in use by the program. The icons can be system stock icons or the program's stock icons


Field Summary
static int ICON_ABOUT
           
static int ICON_CANCEL
           
static int ICON_CLEAR
           
static int ICON_CLOSE
           
static int ICON_FULLSCREEN
           
static int ICON_GO_BACK
           
static int ICON_GO_DOWN
           
static int ICON_GO_FORWARD
           
static int ICON_GO_UP
           
static int ICON_HELP
           
static int ICON_OK
           
static int ICON_OPEN
           
static int ICON_PREFERENCES
           
static int ICON_PRINT
           
static int ICON_PRINT_PREVIEW
           
static int ICON_QUIT
           
static int ICON_REDO
           
static int ICON_SAVE
           
static int ICON_SAVE_AS
           
static int ICON_UNDO
           
static int SIZE_LARGE_TOOLBAR
          The size of a large toolbar or button icon
static int SIZE_MENU
          The size of a menu icon
static int SIZE_SMALL_TOOLBAR
          The size of a small tollbar or button icon
 
Constructor Summary
StockIcon()
           
 
Method Summary
static org.eclipse.swt.graphics.ImageData getIcon(int icon, int size, boolean allowOSStockIcon)
          Returns the matching stock image for the given constant image icon, which should be one of the icon constants specified in class StockIcon, the given constant image size, which should be one of the icon size constants specified in class StockIcon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_MENU

public static final int SIZE_MENU
The size of a menu icon

See Also:
Constant Field Values

SIZE_SMALL_TOOLBAR

public static final int SIZE_SMALL_TOOLBAR
The size of a small tollbar or button icon

See Also:
Constant Field Values

SIZE_LARGE_TOOLBAR

public static final int SIZE_LARGE_TOOLBAR
The size of a large toolbar or button icon

See Also:
Constant Field Values

ICON_HELP

public static final int ICON_HELP
See Also:
Constant Field Values

ICON_ABOUT

public static final int ICON_ABOUT
See Also:
Constant Field Values

ICON_OPEN

public static final int ICON_OPEN
See Also:
Constant Field Values

ICON_PREFERENCES

public static final int ICON_PREFERENCES
See Also:
Constant Field Values

ICON_QUIT

public static final int ICON_QUIT
See Also:
Constant Field Values

ICON_FULLSCREEN

public static final int ICON_FULLSCREEN
See Also:
Constant Field Values

ICON_UNDO

public static final int ICON_UNDO
See Also:
Constant Field Values

ICON_REDO

public static final int ICON_REDO
See Also:
Constant Field Values

ICON_CLEAR

public static final int ICON_CLEAR
See Also:
Constant Field Values

ICON_SAVE

public static final int ICON_SAVE
See Also:
Constant Field Values

ICON_SAVE_AS

public static final int ICON_SAVE_AS
See Also:
Constant Field Values

ICON_PRINT_PREVIEW

public static final int ICON_PRINT_PREVIEW
See Also:
Constant Field Values

ICON_PRINT

public static final int ICON_PRINT
See Also:
Constant Field Values

ICON_CLOSE

public static final int ICON_CLOSE
See Also:
Constant Field Values

ICON_CANCEL

public static final int ICON_CANCEL
See Also:
Constant Field Values

ICON_OK

public static final int ICON_OK
See Also:
Constant Field Values

ICON_GO_UP

public static final int ICON_GO_UP
See Also:
Constant Field Values

ICON_GO_BACK

public static final int ICON_GO_BACK
See Also:
Constant Field Values

ICON_GO_FORWARD

public static final int ICON_GO_FORWARD
See Also:
Constant Field Values

ICON_GO_DOWN

public static final int ICON_GO_DOWN
See Also:
Constant Field Values
Constructor Detail

StockIcon

public StockIcon()
Method Detail

getIcon

public static org.eclipse.swt.graphics.ImageData getIcon(int icon,
                                                         int size,
                                                         boolean allowOSStockIcon)
Returns the matching stock image for the given constant image icon, which should be one of the icon constants specified in class StockIcon, the given constant image size, which should be one of the icon size constants specified in class StockIcon. This image should not be free'd because it could be that was allocated by the system, not the application.

If the allowOSStockIcon flag is set to true then the method tries to search for a matching system stock icon before returning the local stock icons folder

Parameters:
icon - the StockIcon icon constant
size - the StockIcon icon size constant
allowOSStockIcon - whether to search for a matching system stock icon before returning the local stock icon
Returns:
the corresponding image data or null if match is not found
See Also:
icon size constants use:, SIZE_MENU, SIZE_SMALL_TOOLBAR, SIZE_LARGE_TOOLBAR