Class ApplicationUiSupport
java.lang.Object
com.e1c.g5.dt.internal.applications.ui.ApplicationUiSupport
- All Implemented Interfaces:
IApplicationUiSupport
The
IApplicationUiSupport
implementation.
Applications are deemed to be started if their lifecycle state
(IApplicationManager.getLifecycleState(com.e1c.g5.dt.applications.ILifecycleAware)
) is either
LifecycleState.STARTED
(as needed for applications on standalone server)
or LifecycleState.UNKNOWN
(as always is for infobase applications,
see InfobaseApplicationProvisionDelegate).
Publishes the following metrics under com.e1c.g5.dt.applications.ui/event/ensureUpdated.
using provided IMonitoringEventDispatcher
:
- userDecision:(update|skip|cancel) - user choice when an application had to be updated.
- updated.userDecision - an application was updated according with user decision.
- notUpdated.REASON - an application was not updated because of the specified reason
which could be one of the following:
- alreadySynchronized.ibChanges:(resolved|notResolved) - no update was needed. The value shows if infobase-side changes were resolved (absent or imported) or not (present but rejected).
- userDecision:(skip|cancel) - an user has decided not to update an application. The value shows if an user has decided just to skip an update or cancel whole operation.
- updateInProgress - an application is already being updated right now.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.core.runtime.IStatus
ensureUpdated
(org.eclipse.swt.widgets.Shell shell, IApplication application, PublishKind publishKind, ExecutionContext executionContext, String mode, org.eclipse.core.runtime.IProgressMonitor monitor) Updates application if necessary.void
Shows and updates Applications view.void
showErrorDialog
(org.eclipse.swt.widgets.Shell shell, String message, Throwable cause) Shows standard error dialog with message compound frommessage
and messages fromcause
and its parent causes
-
Constructor Details
-
ApplicationUiSupport
public ApplicationUiSupport()
-
-
Method Details
-
ensureUpdated
public org.eclipse.core.runtime.IStatus ensureUpdated(org.eclipse.swt.widgets.Shell shell, IApplication application, PublishKind publishKind, ExecutionContext executionContext, String mode, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Description copied from interface:IApplicationUiSupport
Updates application if necessary.- If application is not prepared yet then it is prepared using the specified desired launch mode. As to what preparing application means see IApplicationManager.prepare(IApplication, String, ExecutionContext, IProgressMonitor). If application has already been launched but using a different mode then it is implementation specific as to what happens.
- Then application state is checked to determine if infobase needs to be updated.
- If updates are needed then the specified
update mode
is used to perform the update. An implementation might ask user for a confirmation to update infobase.
- Specified by:
ensureUpdated
in interfaceIApplicationUiSupport
- Parameters:
shell
- Shell to be used to display messages to user. If thecontext
does not yet has ExecutionContext.ACTIVE_SHELL_NAME specified then theshell
will be propagated to thecontext
. Must not benull
.application
- Application to check and update. Must not benull
.publishKind
- Update type to use when the application has to be updated. Must not benull
.executionContext
- Context to be used for checking application state and updating it if necessary. Must not benull
.mode
- Desired application launch mode: either ILaunchManager.RUN_MODE or ILaunchManager.DEBUG_MODE. Must not benull
.monitor
- the progress monitor ornull
if not needed- Returns:
IStatus.OK
if operation should proceed (no update was needed, application was updated or user has decided not to update) orIStatus.CANCEL
if operation has been cancelled or cannot proceed (unresolved conflict with infobase). Nevernull
.- Throws:
org.eclipse.core.runtime.CoreException
- If application state cannot be determined, infobase cannot be checked for changes, or application launch or update fails.
-
showAndUpdateView
public void showAndUpdateView() throws org.eclipse.core.runtime.CoreExceptionDescription copied from interface:IApplicationUiSupport
Shows and updates Applications view.- Specified by:
showAndUpdateView
in interfaceIApplicationUiSupport
- Throws:
org.eclipse.core.runtime.CoreException
- if show or update fails
-
showErrorDialog
Description copied from interface:IApplicationUiSupport
Shows standard error dialog with message compound frommessage
and messages fromcause
and its parent causes- Specified by:
showErrorDialog
in interfaceIApplicationUiSupport
- Parameters:
shell
- actualShell
for open error dialog, cannot benull
message
- error message to show, cannot benull
cause
- cause of error dialog, can benull
, if is is notnull
all messages it and its parent cause will be added to show error message
-