de.cau.cs.kieler.kwebs.client.ui
Class AbstractServerConfigDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by de.cau.cs.kieler.kwebs.client.ui.AbstractServerConfigDialog
All Implemented Interfaces:
IShellProvider
Direct Known Subclasses:
EditServerConfigDialog, NewServerConfigDialog

public abstract class AbstractServerConfigDialog
extends Dialog

Abstract class for providing basic dialog functionality for NewServerConfigDialog and EditProviderDialog.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
protected  Button checkButton
          Button for testing service availability.
protected  Button detailButton
          Button for showing service details.
protected  Text serverConfigAddress
          Service address of server configuration.
protected  Text serverConfigName
          Name of the server configuration.
protected  Text truststore
          Path to trust store for HTTPS connections.
protected  Button truststoreButton
          The button for the trust store selection dialog.
protected  Text truststorePass
          Password for trust store.
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, 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
 
Constructor Summary
protected AbstractServerConfigDialog(Shell parentShell)
          Creates a dialog with elements for editing a server configuration.
 
Method Summary
protected  void buttonPressed(int buttonId)
          
protected  void checkAvailability()
          Checks whether the layout service derived from the user entered parameters is reachable.
protected  Control createDialogArea(Composite parent)
          
protected  void displayDetails()
          Checks whether the layout service derived from the user entered parameters is reachable.
protected  URI getAddress()
          Returns an URI representing the service address used when doing layout with this server configuration.
protected  String getName()
          Returns the name of the server configuration.
protected  String getTruststore()
          Returns the path to the trust store file used when doing layout with this server configuration.
protected  String getTruststorePass()
          Returns the password for the trust store file used when doing layout with this server configuration.
protected abstract  void handleServerConfigUpdate(ServerConfigData updatedServerConfig)
          To be implemented by inherited classes to handle the server configuration data edited in this dialog.
protected abstract  boolean warningOnDouble(ServerConfigData theserverConfig)
          Returns whether a warning should be displayed if an equal server configuration already exists in the server configuration list.
protected abstract  boolean warningOnInvalid(ServerConfigData theserverConfig)
          Returns whether a warning should be displayed if the current configuration resembles an invalid server configuration.
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverConfigName

protected Text serverConfigName
Name of the server configuration.


serverConfigAddress

protected Text serverConfigAddress
Service address of server configuration.


truststore

protected Text truststore
Path to trust store for HTTPS connections.


truststorePass

protected Text truststorePass
Password for trust store.


truststoreButton

protected Button truststoreButton
The button for the trust store selection dialog.


checkButton

protected Button checkButton
Button for testing service availability.


detailButton

protected Button detailButton
Button for showing service details.

Constructor Detail

AbstractServerConfigDialog

protected AbstractServerConfigDialog(Shell parentShell)
Creates a dialog with elements for editing a server configuration.

Parameters:
parentShell - the parent shell of this dialog
Method Detail

createDialogArea

protected Control createDialogArea(Composite parent)

Overrides:
createDialogArea in class Dialog

buttonPressed

protected void buttonPressed(int buttonId)

Overrides:
buttonPressed in class Dialog

warningOnDouble

protected abstract boolean warningOnDouble(ServerConfigData theserverConfig)
Returns whether a warning should be displayed if an equal server configuration already exists in the server configuration list.

Parameters:
theserverConfig - the server configuration which is equal to the server configuration resembled by the currently entered server configuration data
Returns:
whether a warning should be displayed if an equal server configuration already exists in the server configuration list

warningOnInvalid

protected abstract boolean warningOnInvalid(ServerConfigData theserverConfig)
Returns whether a warning should be displayed if the current configuration resembles an invalid server configuration.

Parameters:
theserverConfig - the server configuration resembling the currently entered server configuration data
Returns:
whether a warning should be displayed if the current configuration resembles an invalid server configuration

handleServerConfigUpdate

protected abstract void handleServerConfigUpdate(ServerConfigData updatedServerConfig)
To be implemented by inherited classes to handle the server configuration data edited in this dialog. This may be updating an existing server configuration or creating a new server configuration.

Parameters:
updatedServerConfig - the server configuration to handle

getName

protected final String getName()
Returns the name of the server configuration.

Returns:
the contents of the text element for the server configuration name

getAddress

protected final URI getAddress()
Returns an URI representing the service address used when doing layout with this server configuration.

Returns:
an URI created from the contents of the text element for the server configuration address

getTruststore

protected final String getTruststore()
Returns the path to the trust store file used when doing layout with this server configuration.

Returns:
the contents of the text element for the trust store path

getTruststorePass

protected final String getTruststorePass()
Returns the password for the trust store file used when doing layout with this server configuration.

Returns:
the contents of the text element for the trust store password

checkAvailability

protected final void checkAvailability()
Checks whether the layout service derived from the user entered parameters is reachable.


displayDetails

protected final void displayDetails()
Checks whether the layout service derived from the user entered parameters is reachable.