Class StringVariableSelectionDialog

  • All Implemented Interfaces:

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

    Clients may instantiate this class.

    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.
        parent - parent shell
    • Method Detail

      • getVariableExpression

        public String getVariableExpression()
        Returns the variable expression the user generated from this dialog, or null if none.
        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.
        filter - the filter to add
      • setFilters

        public void setFilters​(StringVariableSelectionDialog.VariableFilter[] filters)
        Sets the filters, replacing any previous filters. Must be called before the dialog is opened.
        filters - an array of variable filters, use empty Array or null to reset all Filters.
      • 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.
        createContents in class Dialog
        parent - the parent composite for the controls in this window. The type of layout used is determined by getLayout()
        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;
        createDialogArea in class ElementListSelectionDialog
        parent - the parent composite to contain the dialog area
        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.

        okPressed in class SelectionStatusDialog