com.mindoo.remote.api.org.eclipse.ui
Interface IRemotePartService

All Superinterfaces:
IRemoteEclipseWrapper

public interface IRemotePartService
extends IRemoteEclipseWrapper

Remote API Wrapper for the org.eclipse.ui.IPartService (Online documentation)

Original documentation:
A part service tracks the creation and activation of parts within a workbench page.


Field Summary
static int ALLEVENTS
          Bit flag that combines all single bit flags
static int PARTACTIVATED
          Bit flag to get notified when a part was activated
static int PARTBROUGHTTOTOP
          Bit flag to get notified after a part has been brought to top
static int PARTCLOSED
          Bit flag to get notified after a part is closed
static int PARTDEACTIVATED
          Bit flag to get notified when a part was deactivated
static int PARTOPENED
          Bit flag to get notified when a part was opened
 
Method Summary
 void addPartListenerSSJSLib(int eventMask, java.lang.String uniqueId, java.lang.String server, java.lang.String dbPath, java.lang.String ssjsLibName, java.lang.String methodName, java.lang.Object data)
          Use this method to get notified of part events in the system, e.g. that a viewpart has been activated, opened or closed.
 IRemoteWorkbenchPart getActivePart()
          Returns the active part.
 IRemoteWorkbenchPartReference getActivePartReference()
          Returns the active part reference.
 java.util.List<IRemoteWorkbenchPartReference> getLastActiveParts()
          Helper method that returns a history of the last 20 active parts.
 void removePartListenerSSJSLib(java.lang.String uniqueId)
          Use this method to unregister a preregistered listener
 
Methods inherited from interface com.mindoo.remote.api.IRemoteEclipseWrapper
_internalGetId, equalWrappedObjects
 

Field Detail

PARTACTIVATED

static final int PARTACTIVATED
Bit flag to get notified when a part was activated

See Also:
Constant Field Values

PARTDEACTIVATED

static final int PARTDEACTIVATED
Bit flag to get notified when a part was deactivated

See Also:
Constant Field Values

PARTBROUGHTTOTOP

static final int PARTBROUGHTTOTOP
Bit flag to get notified after a part has been brought to top

See Also:
Constant Field Values

PARTCLOSED

static final int PARTCLOSED
Bit flag to get notified after a part is closed

See Also:
Constant Field Values

PARTOPENED

static final int PARTOPENED
Bit flag to get notified when a part was opened

See Also:
Constant Field Values

ALLEVENTS

static final int ALLEVENTS
Bit flag that combines all single bit flags

See Also:
Constant Field Values
Method Detail

getActivePart

IRemoteWorkbenchPart getActivePart()
                                   throws RemoteEclipseAPIException
Returns the active part.

Returns:
the active part, or null if no part is currently active
Throws:
RemoteEclipseAPIException

getLastActiveParts

java.util.List<IRemoteWorkbenchPartReference> getLastActiveParts()
                                                                 throws RemoteEclipseAPIException
Helper method that returns a history of the last 20 active parts. Using this method is useful for example for code in sidebar apps. Clicking on UI elements in the sidebar often moves the active part into the sidebar, so it's hard to find the part that was active right before the sidebar part

Returns:
part references, last active part as the first entry
Throws:
RemoteEclipseAPIException

getActivePartReference

IRemoteWorkbenchPartReference getActivePartReference()
                                                     throws RemoteEclipseAPIException
Returns the active part reference.

Returns:
the active part reference, or null if no part is currently active
Throws:
RemoteEclipseAPIException

addPartListenerSSJSLib

void addPartListenerSSJSLib(int eventMask,
                            java.lang.String uniqueId,
                            java.lang.String server,
                            java.lang.String dbPath,
                            java.lang.String ssjsLibName,
                            java.lang.String methodName,
                            java.lang.Object data)
                            throws RemoteEclipseAPIException
Use this method to get notified of part events in the system, e.g. that a viewpart has been activated, opened or closed.

Please note that the code in the SSJS library is launched using an alternative JavaScript engine. That means that it's not possible to use Java classes inside the NSF and @formula code known from SSJS (we just use the design element and the JavaScript editor to enter/store code), however it is possible to use the JDK's classes and Eclipse APIs.

The XPages2Eclipse API will use the following call syntax to call the JavaScript method:

methodName(uniqueId:String, eventBit:int, part:IRemoteWorkbenchPart, data:String);

The code is executed asynchronously in a background thread, the API will automatically delegate UI accessing calls to the SWT UI thread (e.g. opening new viewparts via the remote API).

In addition, the API keeps the order of events for a listener with a specific uniqueId.

The following global variables will automatically be filled with values:

session - the current session
database - the database of the SSJS library design element
eclipseconnection - a handle for a remote API connection

Parameters:
eventMask - bitmask of events that are relevant for this listener, -1 means all events
uniqueId - unique id to be used when calling #removePartListener(String), existing listeners with this ID will be overwritten
server - server of SSJS database
dbPath - filepath of SSJS database
ssjsLibName - SSJS library name
methodName - method name in JavaScript
data - any value that will be passed to the JS function as last method argument
Throws:
RemoteEclipseAPIException
See Also:
PARTACTIVATED, PARTDEACTIVATED, PARTBROUGHTTOTOP, PARTCLOSED, PARTOPENED, ALLEVENTS

removePartListenerSSJSLib

void removePartListenerSSJSLib(java.lang.String uniqueId)
Use this method to unregister a preregistered listener

Parameters:
uniqueId - unique id that was used when calling #addPartListenerSSJSLib(int, String, String, String, String, String)