Unidata IDV Workshop for version 6.2u2 > Java Developer Topics > Data Sources
5.5.2 Creating a Weather Text Data Source
Let's create a custom Data Source for our weather text.
- Change to the example directory.
cd /home/idv/idv/ucar/unidata/apps/example
- Open WxTextDataSource.java in an editor and let's look what's there.
- Copy
datasource.xml
up from the resources subdirectory and
take a look at that.
- Now, edit WxTextChooser and change:
makeDataSource(urls, "FILE.ADDETEXT", ht);
to:
makeDataSource(urls, "ADDE.WXTEXT", ht);
to make the appropriate data source.
- Compile the chooser and data source.
- Start the IDV.
- Select a product from the
Weather Text
chooser
and click the Add Source
button.
- Notice in the
Field Selector
, that our
data choices defined in the data source are listed in the
Fields
panel.
- Expand the first category and click on
Weather Text Bulletin
.
Notice which displays are availble for this parameter.
- Display the data in the
Text/Html Display
.
Now let's remove the extraneous data choices and try this again.
- Exit the IDV.
- Open WxTextDataSource.java in an editor.
- Remove the section in
doMakeDataChoices()
which adds the
extra data choices.
- Start the IDV and load in some weather text.
- Notice the change in the
Fields
panel.
- Save this as your default bundle and then reload it.
Unidata IDV Workshop for version 6.2u2 > Java Developer Topics > Data Sources