com.ibm.carma.ui.dialog
Class CarmaConnectDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.IconAndMessageDialog
              extended by org.eclipse.jface.dialogs.ProgressMonitorDialog
                  extended by com.ibm.carma.ui.dialog.CarmaConnectDialog
All Implemented Interfaces:
org.eclipse.jface.operation.IRunnableContext, org.eclipse.jface.window.IShellProvider

public class CarmaConnectDialog
extends org.eclipse.jface.dialogs.ProgressMonitorDialog

This is the dialog class used to display the connect dialog to the user. All errors that occur during the connection attempt are displayed to the user via this class. This class should be run from a UI Thread. The following is a sample code snippet of how this class can be used:

 if (!CarmaConnectDialog.connectCarma(getShell(), carma))
    return; //carma is not connected, so carry on
 
 //continue with a connected carma
 


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Method Summary
static boolean connectCarma(org.eclipse.swt.widgets.Shell parentShell, CARMA carma)
          Will connect carma if it is disconnected.
 
Methods inherited from class org.eclipse.jface.dialogs.ProgressMonitorDialog
close, getOpenOnRun, getProgressMonitor, open, run, setCancelable, setOpenOnRun
 
Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog
getErrorImage, getInfoImage, getQuestionImage, getWarningImage
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, create, getBlockedHandler, getImage, setBlockedHandler, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
getDefaultImage, getDefaultImages, getDefaultOrientation, getReturnCode, getShell, getWindowManager, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setWindowManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

connectCarma

public static boolean connectCarma(org.eclipse.swt.widgets.Shell parentShell,
                                   CARMA carma)
Will connect carma if it is disconnected. If necessary will prompt user for username and password. Will display any error messages to the user. If cancelled or an error occurs, we will return false, otherwise we will return true

Parameters:
parentShell -
carma -
Returns:
true if carma is connected, false if not