java.lang.Object
de.uka.ipd.sdq.workflow.launchconfig.tabs.TabHelper

public class TabHelper extends Object
Provides methods helpful when working with ILaunchConfiguration,. AbstractLaunchConfigurationTab and related classes.
  • Constructor Details

    • TabHelper

      public TabHelper()
  • Method Details

    • createTabFolder

      public static CTabFolder createTabFolder(ILaunchConfigurationTabGroup tabGroup, ILaunchConfigurationDialog dialog, String mode, Composite parent, int style)
      Given an ILaunchConfigurationTabGroup, this method constructs an.
      Parameters:
      tabGroup - the tab group from which the CTabFolder will be created
      dialog - see ILaunchConfigurationTabGroup.createTabs(ILaunchConfigurationDialog, String)
      mode - see ILaunchConfigurationTabGroup.createTabs(ILaunchConfigurationDialog, String)
      parent - see Composite(Composite, int)
      style - see Composite(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 a Group 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 container
      modifyListener - The listener for modifications
      groupLabel - The label of the group.
      fileExtensionRestrictions - The extensions to load
      textFileNameToLoad - 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 a Group 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 container
      modifyListener - The listener for modifications
      groupLabel - The label of the group.
      fileExtensionRestrictions - The extensions to load
      textFileNameToLoad - 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 a Group 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 container
      modifyListener - The listener for modifications
      groupLabel - The label of the group.
      fileExtensionRestrictions - The extensions to load
      textFileNameToLoad - 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 a Group 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 container
      modifyListener - The listener for modifications
      groupLabel - The label of the group.
      fileExtensionRestrictions - The extensions to load
      textFileNameToLoad - 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 a Group 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 container
      modifyListener - The listener for modifications
      groupLabel - The label of the group.
      fileExtensionRestrictions - The extensions to load
      textFileNameToLoad - 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 shown
      showFileSystemSelectionButton - indicates whether a file system selection button is shown
      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, boolean showWorkspaceSelectionButton, boolean showFileSystemSelectionButton, String defaultFileURI, boolean allowMultipleSelection)
      Creates a section in the parent container for selection files. Creates a Group 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 container
      modifyListener - The listener for modifications
      groupLabel - The label of the group.
      fileExtensionRestrictions - The extensions to load
      textFileNameToLoad - 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 shown
      showFileSystemSelectionButton - indicates whether a file system selection button is shown
      defaultFileURI - Default URI used for the file.
      allowMultipleSelection - if true, multiple files can be selected.
    • createFileInputParts

      public static void createFileInputParts(Composite parent, ModifyListener modifyListener, String[] fileExtensionRestrictions, Text textFileNameToLoad, String dialogTitle, String defaultFileURI)
    • 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

      public static boolean validateFilenameExtension(String filePath, String[] extensions)
      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.