Project Notes
Project: The Borland Multilingual International
Store
Description
The International Sample Application brings together the
power and functionality of JBuilder's JavaBeans Component Library and DataBroker
architecture into an internationally enabled, multi-lingual, on-line shopping
application.
Getting Started...
Before running the application,
please select Build | Rebuild Project
"IntlDemo.jpr" to build all the necessary packages
required by the application. Because this application uses JDK ResourceBundle
classes, a 'rebuild' (as opposed to a 'build') is necessary to ensure that
resources in subpackages are compiled. If you have tried to run the application
without first doing a rebuild, a MissingResourceException will be thrown (check
View | Execution log) and the application will not run.
Furthermore, the application assumes that you have installed
JBuilder into a directory named '\JBuilder' off of the root directory of
the current drive. If you have installed JBuilder to a directory name other
than '\JBuilder' you will need to do the following:
- Display the list of files within the borland.samples.intl.application
package by expanding that package node from within the navigation pane
for this project.
- Click on the 'AppDataModule.java' file to load that file
into the editor.
- From the menu, select Search | Replace.
- Enter '\\JBuilder' as the search value.
- Enter the directory name of your JBuilder installation
(e.g., '\\MyJBuilder') as the replacement value.
- Select 'Replace All' and then 'All' to replace all occurrences
of '\\JBuilder'.
Finally, you must add the '\JBuilder\myclasses' and '\JBuilder\samples'
directories to the IDECLASSPATH variable defined in your JBuilder\bin\JBuilder.INI
file in order to use the UI designer with any of the frames used in this
application. Failure to do so will prevent JBuilder from locating the resource
files it needs to display localized text within the designer. Note:
Remember to exit from JBuilder before modifying your JBuilder.INI file.
After rebuilding all of the packages within this project,
you may select Run | Run Applet in "IntlDemo.html" to run this
sample as an applet, or select the "IntlDemo.java" file in the
project's navigation pane and select Run | Run "IntlDemo" to
run this sample as an application. When run as an applet, this sample uses
the applet parameters defined within this .html file to make a connection
to a database source. By default, the following JDBC parameters are
used. If you have not already created an ODBC alias pointing to the \JBuilder\samples\borland\samples\application\data\IntlDemo.gdb
Interbase database, you will need to do so in order to run this sample
as an applet.
- url -- jdbc:odbc:IntlDemo
- user -- SYSDBA
- password -- masterkey
- driver -- sun.jdbc.odbc.JdbcOdbcDriver
When running this sample as an application, you may specify
the use of either a TextDataFile (the default setting) or JDBC database
as the application's data source. To specify a JDBC database as the
provider, you must pass JDBC connection information to the sample via command
line parameters ( Run | Parameters | Command Line Parameters)
as follows:
java IntlDemo url username password driver
Example:
java IntlDemo jdbc:odbc:IntlDemo SYSDBA masterkey sun.jdbc.odbc.JdbcOdbcDriver
Note that because the use of an ODBC driver requires loading
a .DLL file installed on the client, you will not be able to run the sample
as an applet via a browser (such as the JDK1.1 appletviewer) without using
an 100% pure java JDBC driver (such as Interbase's InterServer/InterClient)
on your web/database server.
Things to See and Do While Visiting The Borland Multilingual
Store
WelcomeFrame
- Double-click on a leaf of the LocaleChooser JavaBean's
locale tree to change your default locales (you can do this at any
time during the demo).
- Grab the split pane separator and resize the panes; note
that the WrappingTextViewer JavaBean wraps lines of text appropriately
for your current locale.
- Change your default locale a few times, and note that
the InternationalClock JavaBean formats the current time based on your
current locale.
- ProductFrame
- Click on the radio buttons to filter store products by
category.
- Browse the store's available products, and see that the
ViewOnlyNavigationBar JavaBean disables its buttons to let you know you're
at the end of a product category.
- Press 'Add to Order' to add the currently displayed product
to your order form.
- Press 'View Order' to view your current order.
- OrderFrame
- Enter your name and address information into the customer
info area, and note that edit masks guide you through order entry. An AnnotatedEmptyItemPainter
indicates which values are required to complete your order.
- Select a credit card type, and enter a credit card no;
an edit mask restricts you to entering only digits, and guides you through
entering the correct digit pattern for your credit card choice.
- After ordering a product, double-click in the Quantity
column and see how the IntegerSpinItemEditor helps you enter a new quantity.
(Press Enter or click in another column to save your change. Press Esc
to cancel)
- After you've ordered some products, change the exchange
rate value to see what your order totals would be in your local currency.
- Press the 'Cancel Order' button to cancel your order.
- Press the 'Save Order' button to submit your order.
Enter your password to complete the order. From the WelcomeFrame, click
'View a Previous Order' to select yourself from the customer database,
and review your previous orders.
Note: You will only be able to view data from a
particular locale if you have already installed the appropriate font for
that locale and modified the corresponding entry in your JDK font.properties
file.
Summary of JBCL and DataBroker Functionality Used
JBCL components
- ButtonControl (used in several Frames)
- LabelControl (used in several Frames)
- TabPanel (OrderFrame)
- CheckboxPanel (ProductFrame)
- TreeControl (LocaleChooser)
- BevelPanel (used in several Frames)
- SplitPanel (WelcomeFrame)
- DecoratedFrame (used for every frame)
- MaskableTextItemEditor (IntegerSpinEditor)
- (data-aware) GridControl (OrderFrame, CustomerLookupDialog)
- (data-aware) ChoiceControl (OrderFrame)
- (data-aware) ImageControl (ProductFrame)
Custom components
- Model/View custom model (BasicOrderedTreeContainer)
- Model/View custom item editor (IntegerSpinEditor)
- Model/View custom item painter (AnnotatedEmptyItemPainter)
- Model/View single/multi graph selection (LocaleChooser)
- Data-aware component (WrappingTextViewer, ViewOnlyNavigationBar)
- Locale-sensitive component (LocaleChooser, WrappingTextViewer,
InternationalClock)
DataBroker functionality
- DataModule (AppDataModule)
- TableDataSet (AppDataModule)
- TextDataFile (AppDataModule)
- Database (AppDataModule)
- QueryDataSet (AppDataModule)
- DataSetExceptionHandler (ResourcedDataSetExceptionHandler)
- CalcFieldListener (AppDataModule)
- CalcAggFieldListener (AppDataModule)
- EditListener (AppDataModule)
- RowFilterListener (AppDataModule)
- MasterLink (AppDataModule)
- Data resolving (AppDataModule)
- Single-record frame (ProductFrame, OrderFrame)
- Locale-sensitive edit masks (OrderFrame)
- Locale-sensitive display masks (OrderFrame)
- International/multilingual data (all frames)
JDK i18n functionality
- ListResourceBundle (all frames)
- BreakIterator (WrappingTextViewer)
- Collation (LocaleChooser)
- DateFormat (WelcomeFrame, InternationalClock)
- MessageFormat (ResourcedDataSetExceptionHandler)
Packages
Package Name |
Description |
borland.samples.intl |
main project file and application launcher |
borland.samples.intl.application |
data module and supporting files; application execption handler |
borland.samples.intl.application.data |
TextDataFiles and Interbase database used by the sample |
borland.samples.intl.application.resources |
localized application resources |
borland.samples.intl.beans |
JavaBeans used in the application |
borland.samples.intl.beans.event |
event and event listener interface used by locale-sensitive beans |
borland.samples.intl.beans.resources |
resources (images and resourcing bundles) used by the beans |
borland.samples.intl.gui |
classes used to build the application's GUI |
borland.samples.intl.gui.resources |
resources (images and ResourceBundles) used by GUI elements |
borland.samples.intl.util |
a few utility classes |
borland.samples.intl.doc |
application documentation and source file javadoc |