public class DBObjectTypePicker
extends java.lang.Object
This can be used in two ways - either the picker component can be embedded in a piece of UI, or a dialog can be fired to choose the types.
Constructor and Description |
---|
DBObjectTypePicker()
Creates a new picker.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.lang.String> |
getAvailableTypes()
Gets all the types that are available in the picker.
|
java.util.Collection<java.lang.String> |
getDefaultSelection()
Gets the list of types that was (or will be) selected by default in
this picker.
|
protected javax.swing.Icon |
getIcon(java.lang.String type)
Gets the Icon to use on the checkbox for the given type.
|
protected java.lang.String |
getLabel(java.lang.String type)
Gets the (translated) label for the given object type.
|
java.awt.Component |
getPickerComponent()
Gets the picker Component.
|
java.util.Collection<java.lang.String> |
getSelectedTypes()
Gets the currently selected object types in the picker.
|
void |
setAvailableTypes(DBObjectProvider pro,
boolean include,
java.lang.String... types)
Sets the available types for the picker.
|
void |
setComponentName(java.lang.String name)
Sets a Component name on all the active components in the picker based
on the given base name.
|
void |
setSelectedTypes(java.util.Collection<java.lang.String> types)
Sets the types that are selected in the picker.
|
boolean |
showFilterTypesDialog(java.awt.Component parent)
Launches a new dialog, containing the picker component, for the user
to pick the types with.
|
public DBObjectTypePicker()
setAvailableTypes(oracle.javatools.db.DBObjectProvider, boolean, java.lang.String...)
is called.public void setComponentName(java.lang.String name)
showFilterTypesDialog(java.awt.Component)
is used the
dialog will have the given name. This is called with a default in the
constructor.name
- the base name to usepublic void setAvailableTypes(DBObjectProvider pro, boolean include, java.lang.String... types)
If both provider and types are given then any type the provider doesn't support will be ignored.
The resulting available types will all be automatically selected in the picker.
pro
- the provider the types are being picked for (can be null)include
- if true then all types
are made available (if
they are supported by pro
). If false the provider's types are
all made available apart from those in types
.types
- the specific types to include/exclude from the picker
depending on the value of include. If no types are supplied
include
is ignored.protected java.lang.String getLabel(java.lang.String type)
type
- the object type to display in the pickerprotected javax.swing.Icon getIcon(java.lang.String type)
type
- the object type to display in the pickerpublic java.util.Collection<java.lang.String> getAvailableTypes()
public java.awt.Component getPickerComponent()
public boolean showFilterTypesDialog(java.awt.Component parent)
parent
- the Component to parent the dialog withpublic final java.util.Collection<java.lang.String> getSelectedTypes()
Comparing this value against getDefaultSelection()
will tell
the caller whether the user has changed the default state of the
checkboxes (i.e. whether anything was filtered out).
public final void setSelectedTypes(java.util.Collection<java.lang.String> types)
types
- the types to select. If null or empty all types this will
reset the selection (i.e. everything will be selected).setAvailableTypes(oracle.javatools.db.DBObjectProvider, boolean, java.lang.String...)
public final java.util.Collection<java.lang.String> getDefaultSelection()
If there is a "default object type filter" set in the extension hook
data this might not be the same as getAvailableTypes()
.