Servoy 5.x Public API

com.servoy.j2db.plugins
Interface IClientPluginAccess

All Superinterfaces:
ILogLevel, IPluginAccess, IUIBlocker
All Known Subinterfaces:
IWebClientPluginAccess

public interface IClientPluginAccess
extends IPluginAccess, IUIBlocker, ILogLevel

Default client plugin api


Field Summary
static int CLIENT
          Constant returned by getApplicationType
static int HEADLESS_CLIENT
          Constant returned by getApplicationType
static int WEB_CLIENT
          Constant returned by getApplicationType
 
Fields inherited from interface com.servoy.j2db.plugins.IPluginAccess
PLATFORM_LINUX, PLATFORM_MAC, PLATFORM_OTHER, PLATFORM_WINDOWS
 
Fields inherited from interface com.servoy.j2db.util.ILogLevel
DEBUG, ERROR, FATAL, INFO, WARNING
 
Method Summary
 Object executeMethod(String context, String methodname, Object[] arguments, boolean async)
          Executes a method with method name and arguments in the given context If context is a form name a form method is executed, if null a global method will be assumed.
 void exportObject(Remote object)
          Deprecated. 
 String getApplicationName()
          Get the application name.
 int getApplicationType()
          Get the application type.
 IBeanManager getBeanManager()
          Get the bean manager (used to control beans).
 String getClientID()
          Get the clientID.
 ICmdManager getCmdManager()
          Get the cmd manager (used to execute undoable cmd).
 Window getCurrentWindow()
          Get the current showing window (Dialog or Frame) Use this one as a parent if you want to display a dialog or other frame.
 IDatabaseManager getDatabaseManager()
          Get the database manager (used to control the rows/transactions etc).
 JMenu getExportMenu()
          Get the export menu, used by plugins to add export menu items (actions).
 IFormManager getFormManager()
          Get the form manager (used to control the forms, show etc).
 String getI18NMessage(String i18nKey, Object[] arguments)
          Get a message for the specified i18n key
 JMenu getImportMenu()
          Get the import menu, used by plugins to add import menu items (actions).
 URLStreamHandler getMediaURLStreamHandler()
          Returns a URLStreamHandler for handling servoy urls ('media' protocol).
 ResourceBundle getResourceBundle(Locale locale)
          ResourceBundle containing all the messages of the current loaded solution.
 Map getRuntimeProperties()
          Map containing runtime properties (will never be stored, and live one session)
 Remote getServerService(String name)
          Get a remote service, will not work in the Servoy Runtime product!
 URL getServerURL()
          Get the http server url
 String getSolutionName()
          Get the current solution name
 IToolbarPanel getToolbarPanel()
          Get the toolbar panel (used to control toolbars).
 Object getUserUID()
          Get the userUID.
 Window getWindow(String windowName)
          Gets the java Window for the JS window or JS dialog with the given name.
 void handleException(String msg, Exception detail)
          Invoke the Servoy solution error handler with a msg and exception.
 boolean isInDeveloper()
          Returns whether or not this client is running in the developer.
 void output(Object msg)
          Output something on the out stream and in log.
 void output(Object msg, int level)
          Output something on the out stream and in log.
 void registerURLStreamHandler(String protocolName, URLStreamHandler handler)
          Register a URLStreamHandler for a protocol
 void reportWarningInStatus(String s)
          Report a warning in the status (will be shown in red).
 void setStatusText(String txt)
          set a status text in the status area.
 void showFileOpenDialog(IMediaUploadCallback callback, String fileNameHint, boolean multiSelect, String[] filter, int selection, String dialogTitle)
          Opens the file dialog on the client so that a user can upload a file.
 
Methods inherited from interface com.servoy.j2db.plugins.IPluginAccess
getExecutor, getPlatform, getPluginManager, getReleaseNumber, getSettings, getVersion
 
Methods inherited from interface com.servoy.j2db.util.IUIBlocker
blockGUI, releaseGUI
 

Field Detail

CLIENT

static final int CLIENT
Constant returned by getApplicationType

See Also:
Constant Field Values

HEADLESS_CLIENT

static final int HEADLESS_CLIENT
Constant returned by getApplicationType

See Also:
Constant Field Values

WEB_CLIENT

static final int WEB_CLIENT
Constant returned by getApplicationType

See Also:
Constant Field Values
Method Detail

executeMethod

Object executeMethod(String context,
                     String methodname,
                     Object[] arguments,
                     boolean async)
                     throws Exception
Executes a method with method name and arguments in the given context If context is a form name a form method is executed, if null a global method will be assumed.

Parameters:
context - This is the form name or null if the method is a global method.
methodname - The method name to be executed
arguments - The arguments that the method will get.
async - Execute the method asynchronously or not. If true this method will return immediately with null.
Returns:
null if called with "true" for async flag, otherwise the method result is returned
Throws:
Exception
See Also:
FunctionDefinition

exportObject

@Deprecated
void exportObject(Remote object)
                  throws Exception
Deprecated. 

exports a remote object on the client that can be transfered to the server (with a remote server call) that can have call backs.

Parameters:
object - The remote object to export
Throws:
Exception

getApplicationName

String getApplicationName()
Get the application name.

Returns:
String

getApplicationType

int getApplicationType()
Get the application type. Will return one of the client constants like CLIENT for the smart client.

Returns:
int the type

getBeanManager

IBeanManager getBeanManager()
Get the bean manager (used to control beans).

Returns:
IBeanManager

getClientID

String getClientID()
Get the clientID.

Returns:
String the client id, for use in dataserver.

getCmdManager

ICmdManager getCmdManager()
Get the cmd manager (used to execute undoable cmd).

Returns:
ICmdManager

getCurrentWindow

Window getCurrentWindow()
Get the current showing window (Dialog or Frame) Use this one as a parent if you want to display a dialog or other frame.

Returns:
Window

getDatabaseManager

IDatabaseManager getDatabaseManager()
Get the database manager (used to control the rows/transactions etc).

Returns:
the database manager

getExportMenu

JMenu getExportMenu()
Get the export menu, used by plugins to add export menu items (actions).

Returns:
JMenu

getFormManager

IFormManager getFormManager()
Get the form manager (used to control the forms, show etc). Note: the form manager can be casted to a ISwingFormManager for more usage

Returns:
the form manager

getI18NMessage

String getI18NMessage(String i18nKey,
                      Object[] arguments)
Get a message for the specified i18n key

Parameters:
i18nKey - The key
arguments - Arguments to be used that are inserted in the found message (null if no args).
Returns:
the string if the key is found.

getImportMenu

JMenu getImportMenu()
Get the import menu, used by plugins to add import menu items (actions).

Returns:
JMenu

getMediaURLStreamHandler

URLStreamHandler getMediaURLStreamHandler()
Returns a URLStreamHandler for handling servoy urls ('media' protocol). Use this when you construct urls to those by using one of the URL constructors: URL.URL(URL, String, URLStreamHandler) or URL.URL(String, String, int, String, URLStreamHandler)

Returns:
The URLStreamHandler for the protocol 'media'
Since:
5.2

getResourceBundle

ResourceBundle getResourceBundle(Locale locale)
ResourceBundle containing all the messages of the current loaded solution.

Parameters:
locale - The locale for which the resource bundle must be created, null if it has to use the default from the client.
Since:
Servoy 3.5.3

getRuntimeProperties

Map getRuntimeProperties()
Map containing runtime properties (will never be stored, and live one session)

Since:
Servoy 3.5

getServerService

Remote getServerService(String name)
                        throws Exception
Get a remote service, will not work in the Servoy Runtime product!

Throws:
Exception

getServerURL

URL getServerURL()
Get the http server url


getSolutionName

String getSolutionName()
Get the current solution name

Returns:
the name, returns null if no solution is open
Since:
2.2rc4

getToolbarPanel

IToolbarPanel getToolbarPanel()
Get the toolbar panel (used to control toolbars).

Returns:
IToolbarPanel

getUserUID

Object getUserUID()
Get the userUID.

Returns:
int the user id, null if not logged in

getWindow

Window getWindow(String windowName)
Gets the java Window for the JS window or JS dialog with the given name.

Parameters:
windowName - the name of the window as given when opening a window or dialog from JS. If windowName is null, the main application frame is returned.
Returns:
the dialog or frame instance that corresponds to the given window name.

handleException

void handleException(String msg,
                     Exception detail)
Invoke the Servoy solution error handler with a msg and exception. Shows a dialog if no solution error handler present (reports in log for headless/web-client)

Parameters:
msg -
detail -
Since:
3.5

isInDeveloper

boolean isInDeveloper()
Returns whether or not this client is running in the developer.

Returns:
true if this client is running in developer

output

void output(Object msg)
Output something on the out stream and in log. (if running in debugger view console)

Parameters:
msg -

output

void output(Object msg,
            int level)
Output something on the out stream and in log. (if running in debugger view console)

Parameters:
msg -
level - the severity level
Since:
5.0
See Also:
ILogLevel

registerURLStreamHandler

void registerURLStreamHandler(String protocolName,
                              URLStreamHandler handler)
Register a URLStreamHandler for a protocol

Parameters:
protocolName -
handler -

reportWarningInStatus

void reportWarningInStatus(String s)
Report a warning in the status (will be shown in red).
Note:Status will be cleared automatically

Parameters:
s - the warning

setStatusText

void setStatusText(String txt)
set a status text in the status area.


showFileOpenDialog

void showFileOpenDialog(IMediaUploadCallback callback,
                        String fileNameHint,
                        boolean multiSelect,
                        String[] filter,
                        int selection,
                        String dialogTitle)
Opens the file dialog on the client so that a user can upload a file. That file will be given as an argument to the given function. Only the IMediaUploadCallback is mandatory and will be used, the other arguments can be null and can be ignored by the implementation.

Parameters:
callback - The IMediaUploadCallback for the call back.
fileNameHint - A String which file the user should open.
multiSelect - Multi select files at once.
filter - A string array of filenames that are allowed.
selection - A JFileChooser constant if it should select directories or files.
dialogTitle - The dialog title.

Copyright © 2010 Servoy B.V.