Creating a Dimension List Dialog or Dimension List Panel

This topic provides sample code for creating a DimensionListDialog. The code for creating an OLAPDimensionListPanel is nearly identical to that for a DimensionListDialog, except that the constructor for the OLAPDimensionListPanel takes only two arguments, which are the dialog or frame and the data model.

The following code example shows how to create a DimensionListDialog and display it. The dialog is displayed as a result of an action by the user within the application's user interface, which is that the user has clicked a button.

This example assumes an existing connection to a MetadataManager, which provides consolidated access to metadata objects that have been compiled from one or more metadata sources. The code in this example assumes that the variables in the following list exist:


// Create the DimensionListDialog within a frame QueryAccessDimensionModel qadm = new QueryAccessDimensionModel (m_queryBuilder.getQueryContext().createQueryAccess(), null, m_queryBuilder.getErrorHandler(), m_currentDimension, strHier, m_queryBuilder.getMetadataManager()); DimensionListDialog dlg = new DimensionListDialog(top_parent, qadm, my_button); //Optionally set the locale and selection mode dlg.setLocale(m_queryBuilder.getLocale()); dlg.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // Display the DimensionListDialog. if (dlg.display() == DimensionListDialog.OK); else if (dimensionListDialog.display() == DimensionListDialog.CANCEL);

Creating a Dimension List or Dimension List Combo
Structure and Interactions of the Dimension List Beans