com.sibvisions.rad.ui
Class Webstart

java.lang.Object
  extended by com.sibvisions.rad.ui.Webstart

public final class Webstart
extends Object

The Webstart class allows encapsulated access to the javax.jnlp service objects. It's safe to use the class within browser applets because the service detection will be made with reflective calls.


Method Summary
static String getClipboard()
          Gets the current text from the clipboard.
static String getCodeBase()
          Gets the codebase from the JNLP BasicService.
static String getProperty(String pKey)
          Gets the value of a property through the PersistenceService.
static boolean isJnlp()
          Gets if the jvm was started as JNLP webstart process.
static void setClipboard(String pText)
          Sets the given text to the clipboard.
static void setProperty(String pKey, String pValue)
          Set the value of a property through the PersistenceService.
static boolean showDocument(String pDocumentName)
          Shows a document via the JNLP BasicService.
static IFileHandle[] showOpenDialog(boolean pMultiSelection)
          Opens a file chooser dialog via the JNLP FileOpenService.
static void showSaveDialog(IFileHandle pFileHandle)
          Opens a file save dialog with the JNLP FileSaveService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isJnlp

public static boolean isJnlp()
Gets if the jvm was started as JNLP webstart process.

Returns:
true if started as JNLP, otherwise false

showDocument

public static boolean showDocument(String pDocumentName)
                            throws Exception
Shows a document via the JNLP BasicService.

Parameters:
pDocumentName - the name/path of the document
Returns:
true if the request succeded, otherwise false
Throws:
Exception - if the service execution is not possible

showOpenDialog

public static IFileHandle[] showOpenDialog(boolean pMultiSelection)
                                    throws Exception
Opens a file chooser dialog via the JNLP FileOpenService.

Parameters:
pMultiSelection - true to allowe multi file selection, false for single file selection
Returns:
the list of selected IFileHandle
Throws:
Exception - if the service execution is not possible

showSaveDialog

public static void showSaveDialog(IFileHandle pFileHandle)
                           throws Exception
Opens a file save dialog with the JNLP FileSaveService.

Parameters:
pFileHandle - the IFileHandle to store
Throws:
Exception - if the service execution is not possible

getCodeBase

public static String getCodeBase()
                          throws Exception
Gets the codebase from the JNLP BasicService.

Returns:
the codebase or null if the codebase is not set
Throws:
Exception - if the service execution is not possible

setClipboard

public static void setClipboard(String pText)
                         throws Exception
Sets the given text to the clipboard.

Parameters:
pText - the text
Throws:
Exception - if clipboard access fails

getClipboard

public static String getClipboard()
                           throws Exception
Gets the current text from the clipboard.

Returns:
the text
Throws:
Exception - if clipboard access fails

setProperty

public static void setProperty(String pKey,
                               String pValue)
Set the value of a property through the PersistenceService.

Parameters:
pKey - the property name
pValue - the value set

getProperty

public static String getProperty(String pKey)
Gets the value of a property through the PersistenceService.

Parameters:
pKey - the property name
Returns:
the value or null if the property was not found


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.