com.sibvisions.rad.application
Class ApplicationUtil

java.lang.Object
  extended by com.sibvisions.rad.application.ApplicationUtil

public class ApplicationUtil
extends Object

The ApplicationUtil is a utility class which provides methods and constants which will be used from applications.


Field Summary
static UICellFormat BLUE_CELL
          Blue cell.
static UINumberCellEditor CENTERED_NUMBER_EDITOR
          Centered number cell editor.
static UITextCellEditor CENTERED_TEXT_EDITOR
          Centered text cell editor.
static UICellFormat GREEN_CELL
          Green cell.
static UIImageViewer IMAGE_VIEWER
          The Image Viewer.
static UITextCellEditor MULTILINE_EDITOR
          Multiline (text area) cell editor.
static UICellFormat ORANGE_CELL
          Orange cell.
static UITextCellEditor PASSWORD_EDITOR
          Passwort cell editor.
static UICellFormat RED_CELL
          Red cell.
static UIChoiceCellEditor TRUEFALSE_EDITOR
          True/False choice cell editor for BooleanDataTypes.
static UICellFormat YELLOW_CELL
          Yellow cell.
static UIChoiceCellEditor YESNO_EDITOR
          Yes/No choice cell editor.
 
Constructor Summary
protected ApplicationUtil()
          Invisible constructor, because ApplictionUtil is a utility class.
 
Method Summary
static int convertAlignment(String pAlign)
          Converts an alignment "name" to the constant value.
static UIChoiceCellEditor createTFChoiceCellEditor()
          Returns a new checkbox cell editor with True, False values.
static UIChoiceCellEditor createYNChoiceCellEditor()
          Returns a new checkbox cell editor with "Y", "N" values.
static String[] getAllVisibleColumns(IDataBook pDataBook)
          Gets all visible columns on screen.
static byte[] getImageData(IImage pImage)
          Gets the raw image data.
static ILauncher getLauncher(IComponent pComponent)
          Gets the launcher for a specific component.
static byte[] scaleImage(IFileHandle pFileHandle, int pWidth, int pHeight)
          It reads the file handle and scales the image to the determined width and height.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RED_CELL

public static final UICellFormat RED_CELL
Red cell.


ORANGE_CELL

public static final UICellFormat ORANGE_CELL
Orange cell.


YELLOW_CELL

public static final UICellFormat YELLOW_CELL
Yellow cell.


BLUE_CELL

public static final UICellFormat BLUE_CELL
Blue cell.


GREEN_CELL

public static final UICellFormat GREEN_CELL
Green cell.


PASSWORD_EDITOR

public static final UITextCellEditor PASSWORD_EDITOR
Passwort cell editor.


CENTERED_TEXT_EDITOR

public static final UITextCellEditor CENTERED_TEXT_EDITOR
Centered text cell editor.


CENTERED_NUMBER_EDITOR

public static final UINumberCellEditor CENTERED_NUMBER_EDITOR
Centered number cell editor.


MULTILINE_EDITOR

public static final UITextCellEditor MULTILINE_EDITOR
Multiline (text area) cell editor.


YESNO_EDITOR

public static final UIChoiceCellEditor YESNO_EDITOR
Yes/No choice cell editor.


TRUEFALSE_EDITOR

public static final UIChoiceCellEditor TRUEFALSE_EDITOR
True/False choice cell editor for BooleanDataTypes.


IMAGE_VIEWER

public static final UIImageViewer IMAGE_VIEWER
The Image Viewer.

Constructor Detail

ApplicationUtil

protected ApplicationUtil()
Invisible constructor, because ApplictionUtil is a utility class.

Method Detail

createTFChoiceCellEditor

public static UIChoiceCellEditor createTFChoiceCellEditor()
Returns a new checkbox cell editor with True, False values.

Returns:
a new checkbox cell editor with True, False values.

createYNChoiceCellEditor

public static UIChoiceCellEditor createYNChoiceCellEditor()
Returns a new checkbox cell editor with "Y", "N" values.

Returns:
a new checkbox cell editor with "Y", "N" values.

getAllVisibleColumns

public static String[] getAllVisibleColumns(IDataBook pDataBook)
Gets all visible columns on screen.

Parameters:
pDataBook - the data book.
Returns:
all visible columns on screen.

getLauncher

public static ILauncher getLauncher(IComponent pComponent)
Gets the launcher for a specific component. The component should be added.

Parameters:
pComponent - any added component
Returns:
the launcher or null if the component is not added

scaleImage

public static byte[] scaleImage(IFileHandle pFileHandle,
                                int pWidth,
                                int pHeight)
                         throws IOException
It reads the file handle and scales the image to the determined width and height.

Parameters:
pFileHandle - the FileHandle to use.
pWidth - the width to use.
pHeight - the heigth to use.
Returns:
the scaled image with the determined width and height.
Throws:
IOException - if the image can't read or scaled.

getImageData

public static byte[] getImageData(IImage pImage)
                           throws IOException
Gets the raw image data.

Parameters:
pImage - the image
Returns:
the image data as bytes
Throws:
IOException - if image conversion fails

convertAlignment

public static int convertAlignment(String pAlign)
Converts an alignment "name" to the constant value.

Parameters:
pAlign - the alignment: "left", "right", "top", "bottom", "center", "stretch"
Returns:
the alignment from IAlignmentConstants


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.