Class StringVariableSelectionDialog

  • All Implemented Interfaces:
    IShellProvider

    public class StringVariableSelectionDialog
    extends ElementListSelectionDialog
    A dialog that prompts the user to choose and configure a string substitution variable.

    Clients may instantiate this class.

    Since:
    3.1
    Restriction:
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • StringVariableSelectionDialog

        public StringVariableSelectionDialog​(Shell parent)
        Constructs a new string substitution variable selection dialog.
        Parameters:
        parent - parent shell
    • Method Detail

      • getVariableExpression

        public String getVariableExpression()
        Returns the variable expression the user generated from this dialog, or null if none.
        Returns:
        variable expression the user generated from this dialog, or null if none
      • addVariableFilter

        public void addVariableFilter​(StringVariableSelectionDialog.VariableFilter filter)
        Add the given variable filter. Has no effect if the given filter has already been added. Must be called before the dialog is opened.
        Parameters:
        filter - the filter to add
        Since:
        3.6
      • setFilters

        public void setFilters​(StringVariableSelectionDialog.VariableFilter[] filters)
        Sets the filters, replacing any previous filters. Must be called before the dialog is opened.
        Parameters:
        filters - an array of variable filters, use empty Array or null to reset all Filters.
        Since:
        3.6
      • createContents

        protected Control createContents​(Composite parent)
        Description copied from class: Dialog
        The Dialog implementation of this Window method creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size. It then calls the createDialogArea and createButtonBar methods to create the dialog area and button bar, respectively. Overriding createDialogArea and createButtonBar are recommended rather than overriding this method.
        Overrides:
        createContents in class Dialog
        Parameters:
        parent - the parent composite for the controls in this window. The type of layout used is determined by getLayout()
        Returns:
        the control that will be returned by subsequent calls to getContents()
      • createDialogArea

        protected Control createDialogArea​(Composite parent)
        Description copied from class: Dialog
        Creates and returns the contents of the upper part of this dialog (above the button bar).

        The Dialog implementation of this framework method creates and returns a new Composite with standard margins and spacing.

        The returned control's layout data must be an instance of GridData. This method must not modify the parent's layout.

        Subclasses must override this method but may call super as in the following example:

         Composite composite = (Composite) super.createDialogArea(parent);
         //add controls to composite as necessary
         return composite;
         
        Overrides:
        createDialogArea in class ElementListSelectionDialog
        Parameters:
        parent - the parent composite to contain the dialog area
        Returns:
        the dialog area control
      • editVariables

        protected void editVariables()
        Opens the preference dialog to the correct page an allows editing of variables
      • configureArgument

        protected void configureArgument()
        Configures the argument for the selected variable.
      • okPressed

        protected void okPressed()
        Description copied from class: Dialog
        Notifies that the ok button of this dialog has been pressed.

        The Dialog implementation of this framework method sets this dialog's return code to Window.OK and closes the dialog. Subclasses may override.

        Overrides:
        okPressed in class SelectionStatusDialog