Rule Execution Server API

ilog.rules.studio.res.ui.generator.impl.wizard
Class IlrAbstractRESConfigurationSelectionDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.TrayDialog
              extended by org.eclipse.ui.dialogs.SelectionDialog
                  extended by org.eclipse.ui.dialogs.SelectionStatusDialog
                      extended by ilog.rules.studio.res.ui.generator.impl.wizard.IlrAbstractRESConfigurationSelectionDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

public abstract class IlrAbstractRESConfigurationSelectionDialog
extends org.eclipse.ui.dialogs.SelectionStatusDialog

Create a dialog used to select a Rule Execution Server Configuration from the workspace. The dialog provides a button that allows creation of a new configuration if needed.

The list of proposed configurations can be limited by implementing the isRESConfigurationSupported(IlrExecutionServer) method.

The list of allowed application server types proposed in the creation wizard can be limited by implementing the isApplicationServerSupported(String) method.

Since:
JRules 6.6

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
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
IlrAbstractRESConfigurationSelectionDialog(org.eclipse.swt.widgets.Shell parentShell)
          Constructs an instance of IlrAbstractServerConfigurationSelectionDialog.
 
Method Summary
protected  void access$setResult(List<Object> result)
          Set the result using the super class implementation of setResult.
protected  void access$superButtonPressed(int id)
          Set the result using the super class implementation of buttonPressed.
 void addFilter(org.eclipse.jface.viewers.ViewerFilter filter)
          Adds a filter to the tree viewer.
protected  void cancelPressed()
          Handles cancel button pressed event.
 void create()
          Creates widgetry for this window in a new top-level shell.
protected  org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
          Creates the tree viewer.
protected  String getDestinationProjectLocation()
          Returns the destination directory of the client project to use as the destination directory for the file persistence if the RuleApp is not deployed on an application server.
protected  String getProjectName()
          Returns the client project name.
 ilog.rules.studio.res.server.IlrExecutionServer getSelection()
          Gets the Rule Execution Server configuration selected in the wizard.
protected  org.eclipse.jface.viewers.TreeViewer getTreeViewer()
          Returns the tree viewer.
protected  void handleShellCloseEvent()
          Handles a shell close event.
protected abstract  boolean isApplicationServerEnvironmentSupported()
          Returns true if the configuration created through the dialog is for an application server.
protected abstract  boolean isApplicationServerSupported(String type)
          Returns true if the specified application server can be created through the dialog.
protected abstract  boolean isRESConfigurationSupported(ilog.rules.studio.res.server.IlrExecutionServer configuration)
          Returns true if the specified configuration can be selected through the dialog.
 void setAllowMultiple(boolean allowMultiple)
          Specifies if multiple selection is allowed.
 void setComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
          Sets the comparator used by the tree viewer.
 void setDoubleClickSelects(boolean doubleClickSelects)
          Specifies if default selected events (double click) are created.
 void setEmptyListMessage(String message)
          Sets the message to be displayed if the list is empty.
 void setInitialSelection(Object selection)
          Sets the initial selection.
 void setInput(Object input)
          Sets the tree input.
protected  void setProjectName(String name)
          Stores the client project name.
 void setSize(int width, int height)
          Sets the size of the tree in unit of characters.
 void setValidator(org.eclipse.ui.dialogs.ISelectionStatusValidator validator)
          Sets an optional validator to check if the selection is valid.
protected  void updateOKStatus()
          Validate the receiver and update the ok status.
 
Methods inherited from class org.eclipse.ui.dialogs.SelectionStatusDialog
computeResult, configureShell, createButtonBar, getFirstResult, okPressed, setImage, setResult, setStatusLineAboveButtons, updateButtonsEnableState, updateStatus
 
Methods inherited from class org.eclipse.ui.dialogs.SelectionDialog
createButtonsForButtonBar, createMessageArea, getDialogBoundsSettings, getDialogBoundsStrategy, getInitialElementSelections, getInitialSelections, getMessage, getOkButton, getResult, isResizable, setDialogBoundsSettings, setInitialElementSelections, setInitialSelections, setMessage, setResult, setSelectionResult, setTitle
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
close, closeTray, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createContents, createDialogArea, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, 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
 

Constructor Detail

IlrAbstractRESConfigurationSelectionDialog

public IlrAbstractRESConfigurationSelectionDialog(org.eclipse.swt.widgets.Shell parentShell)
Constructs an instance of IlrAbstractServerConfigurationSelectionDialog.

Parameters:
parentShell - The parent shell for the dialog.
Method Detail

setInitialSelection

public void setInitialSelection(Object selection)
Sets the initial selection. Convenience method.

Parameters:
selection - the initial selection.

setEmptyListMessage

public void setEmptyListMessage(String message)
Sets the message to be displayed if the list is empty.

Parameters:
message - the message to be displayed.

setAllowMultiple

public void setAllowMultiple(boolean allowMultiple)
Specifies if multiple selection is allowed.

Parameters:
allowMultiple -

setDoubleClickSelects

public void setDoubleClickSelects(boolean doubleClickSelects)
Specifies if default selected events (double click) are created.

Parameters:
doubleClickSelects -

setComparator

public void setComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Sets the comparator used by the tree viewer.

Parameters:
comparator -

addFilter

public void addFilter(org.eclipse.jface.viewers.ViewerFilter filter)
Adds a filter to the tree viewer.

Parameters:
filter - a filter.

setValidator

public void setValidator(org.eclipse.ui.dialogs.ISelectionStatusValidator validator)
Sets an optional validator to check if the selection is valid. The validator is invoked whenever the selection changes.

Parameters:
validator - the validator to validate the selection.

setInput

public void setInput(Object input)
Sets the tree input.

Parameters:
input - the tree input.

setSize

public void setSize(int width,
                    int height)
Sets the size of the tree in unit of characters.

Parameters:
width - the width of the tree.
height - the height of the tree.

updateOKStatus

protected void updateOKStatus()
Validate the receiver and update the ok status.


cancelPressed

protected void cancelPressed()
Handles cancel button pressed event.

Overrides:
cancelPressed in class org.eclipse.jface.dialogs.Dialog

createTreeViewer

protected org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
Creates the tree viewer.

Parameters:
parent - the parent composite
Returns:
the tree viewer

getTreeViewer

protected org.eclipse.jface.viewers.TreeViewer getTreeViewer()
Returns the tree viewer.

Returns:
the tree viewer

access$superButtonPressed

protected void access$superButtonPressed(int id)
Set the result using the super class implementation of buttonPressed.

Parameters:
id -

access$setResult

protected void access$setResult(List<Object> result)
Set the result using the super class implementation of setResult.

Parameters:
result -

handleShellCloseEvent

protected void handleShellCloseEvent()
Handles a shell close event.

Overrides:
handleShellCloseEvent in class org.eclipse.jface.window.Window

getSelection

public ilog.rules.studio.res.server.IlrExecutionServer getSelection()
Gets the Rule Execution Server configuration selected in the wizard. Returns null if no configuration was selected.

Returns:
The Rule Execution Server configuration.

create

public void create()
Creates widgetry for this window in a new top-level shell.

Overrides:
create in class org.eclipse.ui.dialogs.SelectionStatusDialog

getDestinationProjectLocation

protected String getDestinationProjectLocation()
Returns the destination directory of the client project to use as the destination directory for the file persistence if the RuleApp is not deployed on an application server. Returns null if the directory for the file persistence can be the default name, which is res_data.

The default value is null.

Returns:
The destination directory of the client project.

isRESConfigurationSupported

protected abstract boolean isRESConfigurationSupported(ilog.rules.studio.res.server.IlrExecutionServer configuration)
Returns true if the specified configuration can be selected through the dialog. Returns false otherwise.

Parameters:
configuration - A configuration found in the workspace.
Returns:
True if the configuration is selectable. False otherwise.

isApplicationServerEnvironmentSupported

protected abstract boolean isApplicationServerEnvironmentSupported()
Returns true if the configuration created through the dialog is for an application server. Returns false otherwise.

Returns:
True if the configuraiton is for an application server. False otherwise.

isApplicationServerSupported

protected abstract boolean isApplicationServerSupported(String type)
Returns true if the specified application server can be created through the dialog. The possible values are defined in the IlrRESConfiguration interface. Returns false otherwise. This method is only called if the method isApplicationServerEnvironmentSupported() returns true to the J2EE environment.

Parameters:
type - A supported application server type.
Returns:
True if the application server is authorized. False otherwise.

setProjectName

protected void setProjectName(String name)
Stores the client project name. This name is used to automatically create a new configuration with the name the application server type and this name. Returns null if the name is not added to the default name, which is the application server type.

Parameters:
name - The project name.

getProjectName

protected String getProjectName()
Returns the client project name. This name is used to automatically create a new configuration with the name of the application server type and this name. Returns null if the name is not to be added to the default name, which is the application server type.

Returns:
The project name

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013