org.eclipse.emf.emfstore.internal.client.ui.controller
Class AbstractEMFStoreUIController<T>

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.ui.common.MonitoredEMFStoreAction<T>
      extended by org.eclipse.emf.emfstore.internal.client.ui.controller.AbstractEMFStoreUIController<T>
Type Parameters:
T - return type of the controller
Direct Known Subclasses:
UIAddServerController, UIAddTagController, UICheckoutController, UICommitProjectController, UICompareRevisionsController, UICreateBranchController, UICreateLocalProjectController, UICreateRemoteProjectController, UIDeleteProjectController, UIDeleteRemoteProjectController, UIEditServerPropertiesController, UIGenericExportImportController, UILoginSessionController, UILogoutSessionController, UIManageOrgUnitsController, UIMergeController, UIRegisterEPackageController, UIRemoveServerController, UIRemoveTagController, UIRevertCommitController, UIRevertOperationController, UIShareProjectController, UIShowHistoryController, UIShowProjectPropertiesController, UIUndoLastOperationController, UIUpdateProjectController, UIUpdateProjectToVersionController

public abstract class AbstractEMFStoreUIController<T>
extends MonitoredEMFStoreAction<T>

Abstract UI controller class. UI controllers are responsible for calling the controllers that do the actual work and handle UI related aspects of executing them. This might be, opening some information dialogs as well as handling exceptions thrown by the controllers. The action executed by a controller may either be run in the UI thread or get executed in its own thread. If the controller's action should be executed in its own thread clients need to wrap all UI calls with RunInUIThread or RunInUI.runWithResult(java.util.concurrent.Callable) to avoid invalid thread access exceptions.

Author:
ovonwesen, emueller

Constructor Summary
AbstractEMFStoreUIController(org.eclipse.swt.widgets.Shell shell)
          Constructor.
AbstractEMFStoreUIController(org.eclipse.swt.widgets.Shell shell, boolean cancelable)
          Constructor.
AbstractEMFStoreUIController(org.eclipse.swt.widgets.Shell shell, boolean fork, boolean cancelable)
          Constructor.
 
Method Summary
 boolean confirm(String title, String message)
          Shows a confirmation dialog.
 org.eclipse.swt.widgets.Shell getShell()
          Returns the shell used by the UI controller.
 void setShell(org.eclipse.swt.widgets.Shell newShell)
          Sets the shell to be used by this UI controller.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.client.ui.common.MonitoredEMFStoreAction
afterRun, doRun, execute, executeSub, isForked, preRun
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEMFStoreUIController

public AbstractEMFStoreUIController(org.eclipse.swt.widgets.Shell shell)
Constructor. The constructed UI controller will executed its action in the UI thread.

Parameters:
shell - the shell that will be used during execution of the controller's action

AbstractEMFStoreUIController

public AbstractEMFStoreUIController(org.eclipse.swt.widgets.Shell shell,
                                    boolean cancelable)
Constructor. The constructed UI controller will executed its action in the UI thread.

Parameters:
shell - the shell that will be used during execution of the controller's action
cancelable - whether the controller's action is cancelable

AbstractEMFStoreUIController

public AbstractEMFStoreUIController(org.eclipse.swt.widgets.Shell shell,
                                    boolean fork,
                                    boolean cancelable)
Constructor.

Parameters:
shell - the shell that will be used during execution of the controller's action
fork - whether the controller's action will fork an own thread that runs outside of the UI thread
cancelable - whether the controller's action is cancelable
Method Detail

getShell

public org.eclipse.swt.widgets.Shell getShell()
Returns the shell used by the UI controller.

Returns:
the shell

setShell

public void setShell(org.eclipse.swt.widgets.Shell newShell)
Sets the shell to be used by this UI controller.

Parameters:
newShell - the shell to be used by the UI controller

confirm

public boolean confirm(String title,
                       String message)
Shows a confirmation dialog.

Parameters:
title - the title of the confirmation dialog
message - the message to be shown in the dialog
Returns:
true, if the user confirms the dialog by clicking "Yes", otherwise false


Copyright © 2015. All Rights Reserved.