Class TypeSelectionDialog
- java.lang.Object
-
- net.ssehub.easy.producer.ui.internal.TypeSelectionDialog
-
public class TypeSelectionDialog extends java.lang.ObjectImplements a type selection dialog.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTypeSelectionDialog.TypeLabelProviderImplements a type label provider.
-
Constructor Summary
Constructors Constructor Description TypeSelectionDialog()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetActualTypeString(IDatatype type, java.lang.String deflt)Returns "(actual:)" if typeis not null,defltelse.static java.lang.StringgetActualTypeString(Value value, java.lang.String deflt)Returns "(actual:)" if valueis not null,defltelse.static <T extends IDatatype>
Topen(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.util.Collection<T> types)Opens a type selection dialog based on the giventitleandtypes.static <T extends IDatatype>
Topen(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 giventitleandtypes.static CompoundselectCompoundType(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 fromtype.static CompoundselectCompoundType(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 fromtype.
-
-
-
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 giventitleandtypes. No type is selected by default.- Type Parameters:
T- the specific data type to work with- Parameters:
shell- the parent shelltitle- the titletypes- 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 giventitleandtypes.- Type Parameters:
T- the specific data type to work with- Parameters:
shell- the parent shelltitle- the titletypes- the types to select fromselected- 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 fromtype. No selection is shown if there are no refining types. No selection is made in the dialog.- Parameters:
shell- the shell to display the dialogtitle- the dialog titlescope- the search scope/projecttype- the compound type to search refined types for- Returns:
- the selected type,
typeif 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 fromtype. No selection is shown if there are no refining types.- Parameters:
shell- the shell to display the dialogtitle- the dialog titlescope- the search scope/projecttype- the compound type to search refined types forcurrent- the type to be selected in the dialog, null for no selection- Returns:
- the selected type,
typeif 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 valueis not null,defltelse. Can be used to compose the title of a type selection dialog. [utility]- Parameters:
value- the value to return the type string fordeflt- the default ifvalueis null- Returns:
- the type string
-
getActualTypeString
public static java.lang.String getActualTypeString(IDatatype type, java.lang.String deflt)
Returns "(actual:)" if typeis not null,defltelse. Can be used to compose the title of a type selection dialog. [utility]- Parameters:
type- the value to return the type string fordeflt- the default ifvalueis null- Returns:
- the type string
-
-