Both QueryBuilder and CalcBuilder use a similar architecture for establishing their context, container, and panels. The following list shows the objects and interfaces that are used when working with a builder, its container, and panels:
CalcBuilder
or QueryBuilder
object, which implements the BuilderContext
interface (that extends the GuiContext
interface).
CalcBuilderDialog
or QueryBuilderDialog
object, which implements the BuilderDialog
interface and serves as the container for the panels.
DefaultStandardPanel
object, which implements the StandardPanel
interface. All default builder panels extend DefaultStandardPanel
. Each panel has a unique ID that you can use to track the panel independent of the panel's index in the container.
Ensure that the panel implements the StandardPanel
interface.
The easiest way to accomplish this is to derive a class from the DefaultStandardPanel
class in oracle.dss.datautil.gui.panel.
Override some methods of the DefaultStandardPanel
class.
Create an instance of the new DefaultStandardPanel
class that
you derived in Step 1. Ensure that this instance has a unique panel ID.
Add the new panel object by calling the addPanel
method of
the builder object, which requires two parameters.
The first parameter identifies the panel to add. If you use a null value for the second parameter, then the new panel is added at the end of the container. To insert the panel in a different location, use the ID of the panel that should follow the new panel as the second parameter.
Tip: Use care when adding a panel before the Welcome panel. The CalcBuilder or QueryBuilder considers your newly added panel as the Welcome panel and so does not assign a step number to your panel. After displaying your newly added panel first, the CalcBuilder or QueryBuilder displays its Welcome panel with the text "Step 1 of x" in the title bar, where x represents the number of the steps in the wizard.
Run the CalcBuilder or QueryBuilder.
DefaultStandardPanel
classThe following list describes the methods of the DefaultStandardPanel
class that you should override:
cleanup
-- Clears resources that were allocated by the panel.
getId
-- Retrieves the ID for the panel.
initUIContent
-- Specifies the contents for the panel. For the CalcBuilder, the content is the CalcStep
object. For the QueryBuilder, the content varies by panel.
updateData
-- Specifies whether to update the data in the user interface or to save the data into a data structure.
validateContents
-- Validates the contents of the panel, for CalcBuilder only. In CalcBuilder, the hintValidate
object parameter includes information about the CalcStep
that is being validated.