Class TabHelper
java.lang.Object
de.uka.ipd.sdq.workflow.launchconfig.tabs.TabHelper
Provides methods helpful when working with
ILaunchConfiguration
,.
AbstractLaunchConfigurationTab
and related classes.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
createFileInputParts
(Composite parent, ModifyListener modifyListener, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, String defaultFileURI) static void
createFileInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI) Creates a section in the parent container for selection files.static void
createFileInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI, boolean allowMultipleSelection) Creates a section in the parent container for selection files.static void
createFileInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, String defaultFileURI) Creates a section in the parent container for selection files.static void
createFileInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, String defaultFileURI, boolean allowMultipleSelection) Creates a section in the parent container for selection files.static void
createFileInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, Shell dialogShell, String defaultFileURI) Creates a section in the parent container for file selection.static void
createFileInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, Shell dialogShell, String defaultFileURI, boolean useMultipleSelection) Creates a section in the parent container for file selection.static void
createFolderInputSection
(Composite parentContainer, ModifyListener modifyListener, String groupLabel, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, String defaultFileURI) Helper method to create an input section for selecting a folder.static void
createInputParts
(Composite parent, ModifyListener modifyListener, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI, boolean allowMultipleSelection, boolean useFolder) static CTabFolder
createTabFolder
(ILaunchConfigurationTabGroup tabGroup, ILaunchConfigurationDialog dialog, String mode, Composite parent, int style) Given anILaunchConfigurationTabGroup
, this method constructs an.static boolean
validateFilenameExtension
(String filePath, String[] extensions) Checks if a file name is not empty and has one of the given extensions.
-
Constructor Details
-
TabHelper
public TabHelper()
-
-
Method Details
-
createTabFolder
public static CTabFolder createTabFolder(ILaunchConfigurationTabGroup tabGroup, ILaunchConfigurationDialog dialog, String mode, Composite parent, int style) Given anILaunchConfigurationTabGroup
, this method constructs an.- Parameters:
tabGroup
- the tab group from which the CTabFolder will be createddialog
- seeILaunchConfigurationTabGroup.createTabs(ILaunchConfigurationDialog, String)
mode
- seeILaunchConfigurationTabGroup.createTabs(ILaunchConfigurationDialog, String)
parent
- seeComposite(Composite, int)
style
- seeComposite(Composite, int)
- Returns:
- the c tab folder
CTabFolder
containing the same tabs as the passed ILaunchConfigurationTabGroup.Note that the resulting tab folder does not support launch-specific methods like
ILaunchConfigurationTabGroup.performApply(ILaunchConfigurationWorkingCopy)
. If the tab folder is intended to work in an launch configuration environment (e.g. in a nested tab setting), use delegates to the corresponding methods of the tabs provided by the passed tabGroup.
-
createFileInputSection
public static void createFileInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, Shell dialogShell, String defaultFileURI) Creates a section in the parent container for file selection. Creates aGroup
with a label. Inside the group, a text field for the file with the given extension, a button to load from the workspace and a button to load from the file system are displayed. The dialog title is derived from modelFileLabel.- Parameters:
parentContainer
- The parent containermodifyListener
- The listener for modificationsgroupLabel
- The label of the group.fileExtensionRestrictions
- The extensions to loadtextFileNameToLoad
- The text field that contains the filename. Its parent will be reset to the appropriate group within this method.dialogShell
- Shell used for the file selection dialogs.defaultFileURI
- Default URI used for the file.
-
createFileInputSection
public static void createFileInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, Shell dialogShell, String defaultFileURI, boolean useMultipleSelection) Creates a section in the parent container for file selection. Creates aGroup
with a label. Inside the group, a text field for the file with the given extension, a button to load from the workspace and a button to load from the file system are displayed. The dialog title is derived from modelFileLabel.- Parameters:
parentContainer
- The parent containermodifyListener
- The listener for modificationsgroupLabel
- The label of the group.fileExtensionRestrictions
- The extensions to loadtextFileNameToLoad
- The text field that contains the filename. Its parent will be reset to the appropriate group within this method.dialogShell
- Shell used for the file selection dialogs.defaultFileURI
- Default URI used for the file.useMultipleSelection
- if true, multiple files can be selected.
-
createFileInputSection
public static void createFileInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, String defaultFileURI) Creates a section in the parent container for selection files. Creates aGroup
with a label. Inside the group, a text field for the file with the given extension, a button to load from the workspace and a button to load from the file system are displayed.- Parameters:
parentContainer
- The parent containermodifyListener
- The listener for modificationsgroupLabel
- The label of the group.fileExtensionRestrictions
- The extensions to loadtextFileNameToLoad
- The text field that contains the filename. Its parent will be reset to the appropriate group within this method.dialogTitle
- Title used for the file selection dialogs.dialogShell
- Shell used for the file selection dialogs.defaultFileURI
- Default URI used for the file.
-
createFileInputSection
public static void createFileInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, String defaultFileURI, boolean allowMultipleSelection) Creates a section in the parent container for selection files. Creates aGroup
with a label. Inside the group, a text field for the file with the given extension, a button to load from the workspace and a button to load from the file system are displayed.- Parameters:
parentContainer
- The parent containermodifyListener
- The listener for modificationsgroupLabel
- The label of the group.fileExtensionRestrictions
- The extensions to loadtextFileNameToLoad
- The text field that contains the filename. Its parent will be reset to the appropriate group within this method.dialogTitle
- Title used for the file selection dialogs.dialogShell
- Shell used for the file selection dialogs.defaultFileURI
- Default URI used for the file.allowMultipleSelection
- if true, multiple files can be selected.
-
createFileInputSection
public static void createFileInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI) Creates a section in the parent container for selection files. Creates aGroup
with a label. Inside the group, a text field for the file with the given extension, a button to load from the workspace and a button to load from the file system are displayed.- Parameters:
parentContainer
- The parent containermodifyListener
- The listener for modificationsgroupLabel
- The label of the group.fileExtensionRestrictions
- The extensions to loadtextFileNameToLoad
- The text field that contains the filename. Its parent will be reset to the appropriate group within this method.dialogTitle
- Title used for the file selection dialogs.dialogShell
- Shell used for the file selection dialogs.showWorkspaceSelectionButton
- indicates whether a workspace selection button is shownshowFileSystemSelectionButton
- indicates whether a file system selection button is showndefaultFileURI
- Default URI used for the file.
-
createFileInputSection
public static void createFileInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI, boolean allowMultipleSelection) Creates a section in the parent container for selection files. Creates aGroup
with a label. Inside the group, a text field for the file with the given extension, a button to load from the workspace and a button to load from the file system are displayed.- Parameters:
parentContainer
- The parent containermodifyListener
- The listener for modificationsgroupLabel
- The label of the group.fileExtensionRestrictions
- The extensions to loadtextFileNameToLoad
- The text field that contains the filename. Its parent will be reset to the appropriate group within this method.dialogTitle
- Title used for the file selection dialogs.dialogShell
- Shell used for the file selection dialogs.showWorkspaceSelectionButton
- indicates whether a workspace selection button is shownshowFileSystemSelectionButton
- indicates whether a file system selection button is showndefaultFileURI
- Default URI used for the file.allowMultipleSelection
- if true, multiple files can be selected.
-
createFileInputParts
-
createInputParts
public static void createInputParts(Composite parent, ModifyListener modifyListener, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI, boolean allowMultipleSelection, boolean useFolder) -
createFolderInputSection
public static void createFolderInputSection(Composite parentContainer, ModifyListener modifyListener, String groupLabel, Text textFileNameToLoad, String dialogTitle, Shell dialogShell, String defaultFileURI) Helper method to create an input section for selecting a folder.- Parameters:
parentContainer
- The parent UI container to place the elements in.modifyListener
- The listener to register if the input changes.groupLabel
- The label for the section group.textFileNameToLoad
- The text input field for the file name.dialogTitle
- The title for the file selection dialog.dialogShell
- The ui shell to interact with.defaultFileURI
- The default file to present.
-
validateFilenameExtension
Checks if a file name is not empty and has one of the given extensions.- Parameters:
filePath
- Path of the file.extensions
- Set of extensions. The strings have to be of the format*.[extension]
. An example string value is*.system
.- Returns:
true
if, and only if, the check succeeds.
-