ilog.rules.studio.res.ui.generator.impl.wizard
Class IlrAbstractRESConfigurationSelectionDialog
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.Dialog
-
- org.eclipse.jface.dialogs.TrayDialog
-
- org.eclipse.ui.dialogs.SelectionDialog
-
- org.eclipse.ui.dialogs.SelectionStatusDialog
-
- 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
-
-
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
-
-
Constructor Summary
Constructors Constructor and Description IlrAbstractRESConfigurationSelectionDialog(org.eclipse.swt.widgets.Shell parentShell)
Constructs an instance ofIlrAbstractServerConfigurationSelectionDialog
.
-
Method Summary
Methods Modifier and Type Method and Description protected void
access$setResult(java.util.List<java.lang.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 java.lang.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 java.lang.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(java.lang.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(java.lang.String message)
Sets the message to be displayed if the list is empty.void
setInitialSelection(java.lang.Object selection)
Sets the initial selection.void
setInput(java.lang.Object input)
Sets the tree input.protected void
setProjectName(java.lang.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
-
-
-
-
Constructor Detail
-
IlrAbstractRESConfigurationSelectionDialog
public IlrAbstractRESConfigurationSelectionDialog(org.eclipse.swt.widgets.Shell parentShell)
Constructs an instance ofIlrAbstractServerConfigurationSelectionDialog
.- Parameters:
parentShell
- The parent shell for the dialog.
-
-
Method Detail
-
setInitialSelection
public void setInitialSelection(java.lang.Object selection)
Sets the initial selection. Convenience method.- Parameters:
selection
- the initial selection.
-
setEmptyListMessage
public void setEmptyListMessage(java.lang.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(java.lang.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 classorg.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(java.util.List<java.lang.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 classorg.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 classorg.eclipse.ui.dialogs.SelectionStatusDialog
-
getDestinationProjectLocation
protected java.lang.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(java.lang.String type)
Returns true if the specified application server can be created through the dialog. The possible values are defined in theIlrRESConfiguration
interface. Returns false otherwise. This method is only called if the methodisApplicationServerEnvironmentSupported()
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(java.lang.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 java.lang.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
-
-