public class DataSelector extends DataSourceHolder
DataSource
,
DataCategory
and
DataChoice
in a selection GUI.
It holds a list of DataSources. For each DataSource
there is a DataTree
that shows the
DataChoices of the DataSource. There is a list of
ControlDescriptor
-s
that are shown in the DataControlDialog
Modifier and Type | Class and Description |
---|---|
static class |
DataSelector.DataSourceWrapper
Class DataSourceWrapper Holds the selector gui for a data source
|
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
COLOR_BADSEARCH
Color for failed search
|
formulaDataSource, frame, idv, treatFormulaDataSourceSpecial
Constructor and Description |
---|
DataSelector(IntegratedDataViewer idv,
boolean horizontalOrientation,
DataSource formulaDataSource)
Create a DataSelector with the given idv and lsit of formulas
|
DataSelector(IntegratedDataViewer idv,
DataSource formulaDataSource)
Create a DataSelector with the given idv and lsit of formulas
|
DataSelector(IntegratedDataViewer idv,
java.awt.Dimension defaultSize,
boolean singletonDataSource)
Create a DataSelector with the given idv and list of formulas
|
Modifier and Type | Method and Description |
---|---|
void |
addDataSource(DataSource dataSource)
Add the
DataSource and its
DataChoice -s into the gui |
void |
dataSourceChanged(DataSource dataSource)
The given data source has changed.
|
void |
dataSourceTimeChanged(DataSource dataSource)
Change the gui when the given data source has changed.
|
void |
displayTemplatesChanged()
Be notified of a change to the display templates
|
void |
dispose()
Remove all references to anything we may have.
|
javax.swing.JComponent |
getButtons()
Return the JComponent that holds the Create and Close buttons.
|
javax.swing.JComponent |
getContents()
Return the GUI contents
|
static java.lang.String |
getNameForDataSource(DataSource ds)
A helper method to find the label to use for the given
DataSource . |
static java.lang.String |
getNameForDataSource(DataSource ds,
int length,
boolean alwaysDoIt)
A helper method to find the label to use for the given
DataSource . |
protected boolean |
removeDataSourceInner(DataSource dataSource)
Remove the specified data source only if it is
not the formulaDataSource.
|
void |
setDataSource(DataSource dataSource)
Set the data source shown by this selector
|
addDisplayControl, addDisplayControl, doClose, doMakeFrame, getDataSources, getDerivedIcon, getFrame, getIdv, getLocationOnScreen, getName, removeAllDataSources, removeDataSource, removeDisplayControl, setDefaultSize, setFrame, show
public static final java.awt.Color COLOR_BADSEARCH
public DataSelector(IntegratedDataViewer idv, DataSource formulaDataSource)
idv
- The IDVformulaDataSource
- Contains the end-user formulaspublic DataSelector(IntegratedDataViewer idv, boolean horizontalOrientation, DataSource formulaDataSource)
idv
- The IDVhorizontalOrientation
- Should this be configured with normal dimensionsformulaDataSource
- Contains the end-user formulaspublic DataSelector(IntegratedDataViewer idv, java.awt.Dimension defaultSize, boolean singletonDataSource)
idv
- The IDVdefaultSize
- Size of the windowsingletonDataSource
- Does this dialog just show one data sourcepublic void setDataSource(DataSource dataSource)
dataSource
- The data sourcepublic javax.swing.JComponent getContents()
getContents
in class DataSourceHolder
public javax.swing.JComponent getButtons()
getButtons
in class DataSourceHolder
public void dispose()
dispose
in class DataSourceHolder
protected boolean removeDataSourceInner(DataSource dataSource)
removeDataSourceInner
in class DataSourceHolder
dataSource
- The data source to removepublic void displayTemplatesChanged()
displayTemplatesChanged
in class DataSourceHolder
public void dataSourceTimeChanged(DataSource dataSource)
IntegratedDataViewer
When one of the DataControlDialog
-s changes the
times on the data source.dataSourceTimeChanged
in class DataSourceHolder
dataSource
- The data source that changedpublic void dataSourceChanged(DataSource dataSource)
dataSourceChanged
in class DataSourceHolder
dataSource
- The data source that changedpublic void addDataSource(DataSource dataSource)
DataSource
and its
DataChoice
-s into the guiaddDataSource
in class DataSourceHolder
dataSource
- The data source to addpublic static java.lang.String getNameForDataSource(DataSource ds)
DataSource
. If the length of
the toString of the data source is less than 30 just use that.
Else be a bit smart about truncating it.ds
- The data soruce to get a label forpublic static java.lang.String getNameForDataSource(DataSource ds, int length, boolean alwaysDoIt)
DataSource
. If the length of
the toString of the data source is less than 30 just use that.
Else be a bit smart about truncating it.ds
- The data soruce to get a label forlength
- String length to clip toalwaysDoIt
- If false then we only lip if this is a file or url