com.vlsolutions.swing.docking

Class DockingSelectorDialog


public class DockingSelectorDialog
extends JDialog

A Helper class providing information about the visibility of user components.

This dialog shows which user components are docked, auto-hidden, not visible, and is capable of dynamicaly altering the dockingpanel layout on user selection (for example, to show an unvisible component).

User components shown are those which are already docked and those which have been registered with the registerDockableComponent() method of DockingPanel.

Example of usage :

 Frame f = ...  // frame containing the docking panel
 DockingPanel dockingPanel = ...
 DockingSelectorDialog dlg = new DockingSelectorDialog(f);
 dlg.setDockingPanel(dockingPanel);
 dlg.pack();
 dlg.setLocationRelativeTo(f);
 dlg.setVisible(true); // modal

 // optional
 if (dlg.getClosingState() == DockingSelectorDialog.CONFIRM){
    // do something more
 }
 
See Also:
DockingPanel

Field Summary

static int
CANCEL
Closing state of the dialog when the user has selected the cancel option
static int
CONFIRM
Closing state of the dialog when the user has selected the confirm option

Constructor Summary

DockingSelectorDialog()
Default constructor.
DockingSelectorDialog(Dialog owner)
Constructor for Dialog parent window.
DockingSelectorDialog(Frame owner)
Constructor for Frame parent window.

Method Summary

int
getClosingState()
Returns the users close choice as CONFIRM or CANCEL (remember this dialog is modal).
void
setCancelButtonText(String text)
Change the cancel button text (hook for i18n)
void
setCancelButtonTooltipText(String text)
Change the cancel button tootip text (hook for i18n)
void
setConfirmButtonText(String text)
Change the confirm button text (hook for i18n)
void
setConfirmButtonTooltipText(String text)
Change the confirm button tooltip text (hook for i18n)
void
setDockingDesktop(DockingDesktop desktop)
Requiered to initialize this dialog.
void
setWizardLabelText(String wizardLabelText)
Change the wizard label text (an explanation of the behaviour of this dialog).

Field Details

CANCEL

public static final int CANCEL
Closing state of the dialog when the user has selected the cancel option
Field Value:
1

CONFIRM

public static final int CONFIRM
Closing state of the dialog when the user has selected the confirm option
Field Value:
0

Constructor Details

DockingSelectorDialog

public DockingSelectorDialog()
Default constructor.

modal dialog with DISPOSE_ON_CLOSE option, needs a pack() and setVisible(true) after creation


DockingSelectorDialog

public DockingSelectorDialog(Dialog owner)
Constructor for Dialog parent window.

modal dialog with DISPOSE_ON_CLOSE option, needs a pack() and setVisible(true) after creation.


DockingSelectorDialog

public DockingSelectorDialog(Frame owner)
Constructor for Frame parent window.

modal dialog with DISPOSE_ON_CLOSE option, needs a pack() and setVisible(true) after creation.

Method Details

getClosingState

public int getClosingState()
Returns the users close choice as CONFIRM or CANCEL (remember this dialog is modal).

Use this method if you need to know how is was closed. If the used has confirmed, the docking panel is automaticaly updated by the confirm button action.


setCancelButtonText

public void setCancelButtonText(String text)
Change the cancel button text (hook for i18n)

setCancelButtonTooltipText

public void setCancelButtonTooltipText(String text)
Change the cancel button tootip text (hook for i18n)

setConfirmButtonText

public void setConfirmButtonText(String text)
Change the confirm button text (hook for i18n)

setConfirmButtonTooltipText

public void setConfirmButtonTooltipText(String text)
Change the confirm button tooltip text (hook for i18n)

setDockingDesktop

public void setDockingDesktop(DockingDesktop desktop)
Requiered to initialize this dialog.

Invoke this method before packing the dialog.


setWizardLabelText

public void setWizardLabelText(String wizardLabelText)
Change the wizard label text (an explanation of the behaviour of this dialog).

HTML format is supported like in any JLabel.


© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications