Class TypeSelectionDialog


  • public class TypeSelectionDialog
    extends java.lang.Object
    Implements a type selection dialog.
    Author:
    Holger Eichelberger
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getActualTypeString​(IDatatype type, java.lang.String deflt)
      Returns "(actual: )" if type is not null, deflt else.
      static java.lang.String getActualTypeString​(Value value, java.lang.String deflt)
      Returns "(actual: )" if value is not null, deflt else.
      static <T extends IDatatype>
      T
      open​(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.util.Collection<T> types)
      Opens a type selection dialog based on the given title and types.
      static <T extends IDatatype>
      T
      open​(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.util.Collection<T> types, T selected)
      Opens a type selection dialog based on the given title and types.
      static Compound selectCompoundType​(org.eclipse.swt.widgets.Shell shell, java.lang.String title, IResolutionScope scope, Compound type)
      Allows the user to select a compound type from all refining types from type.
      static Compound selectCompoundType​(org.eclipse.swt.widgets.Shell shell, java.lang.String title, IResolutionScope scope, Compound type, Compound current)
      Allows the user to select a compound type from all refining types from type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeSelectionDialog

        public TypeSelectionDialog()
    • Method Detail

      • open

        public static <T extends IDatatype> T open​(org.eclipse.swt.widgets.Shell shell,
                                                   java.lang.String title,
                                                   java.util.Collection<T> types)
        Opens a type selection dialog based on the given title and types. No type is selected by default.
        Type Parameters:
        T - the specific data type to work with
        Parameters:
        shell - the parent shell
        title - the title
        types - the types to select from
        Returns:
        the selected datatype, null if none was selected
      • open

        public static <T extends IDatatype> T open​(org.eclipse.swt.widgets.Shell shell,
                                                   java.lang.String title,
                                                   java.util.Collection<T> types,
                                                   T selected)
        Opens a type selection dialog based on the given title and types.
        Type Parameters:
        T - the specific data type to work with
        Parameters:
        shell - the parent shell
        title - the title
        types - the types to select from
        selected - the type to be selected by default, null for none
        Returns:
        the selected datatype, null if none was selected
      • selectCompoundType

        public static Compound selectCompoundType​(org.eclipse.swt.widgets.Shell shell,
                                                  java.lang.String title,
                                                  IResolutionScope scope,
                                                  Compound type)
        Allows the user to select a compound type from all refining types from type. No selection is shown if there are no refining types. No selection is made in the dialog.
        Parameters:
        shell - the shell to display the dialog
        title - the dialog title
        scope - the search scope/project
        type - the compound type to search refined types for
        Returns:
        the selected type, type if there was none, null if a selection dialog was show but no selection was made
      • selectCompoundType

        public static Compound selectCompoundType​(org.eclipse.swt.widgets.Shell shell,
                                                  java.lang.String title,
                                                  IResolutionScope scope,
                                                  Compound type,
                                                  Compound current)
        Allows the user to select a compound type from all refining types from type. No selection is shown if there are no refining types.
        Parameters:
        shell - the shell to display the dialog
        title - the dialog title
        scope - the search scope/project
        type - the compound type to search refined types for
        current - the type to be selected in the dialog, null for no selection
        Returns:
        the selected type, type if there was none, null if a selection dialog was show but no selection was made
      • getActualTypeString

        public static java.lang.String getActualTypeString​(Value value,
                                                           java.lang.String deflt)
        Returns "(actual: )" if value is not null, deflt else. Can be used to compose the title of a type selection dialog. [utility]
        Parameters:
        value - the value to return the type string for
        deflt - the default if value is null
        Returns:
        the type string
      • getActualTypeString

        public static java.lang.String getActualTypeString​(IDatatype type,
                                                           java.lang.String deflt)
        Returns "(actual: )" if type is not null, deflt else. Can be used to compose the title of a type selection dialog. [utility]
        Parameters:
        type - the value to return the type string for
        deflt - the default if value is null
        Returns:
        the type string