public class BasicOptionPaneUI extends OptionPaneUI
JOptionPane
.
BasicMessagePaneUI
provides a means to place an icon,
message and buttons into a Container
.
Generally, the layout will look like:
------------------ | i | message | | c | message | | o | message | | n | message | ------------------ | buttons | |________________|icon is an instance of
Icon
that is wrapped inside a
JLabel
. The message is an opaque object and is tested
for the following: if the message is a Component
it is
added to the Container
, if it is an Icon
it is wrapped inside a JLabel
and added to the
Container
otherwise it is wrapped inside a JLabel
.
The above layout is used when the option pane's
ComponentOrientation
property is horizontal, left-to-right.
The layout will be adjusted appropriately for other orientations.
The Container
, message, icon, and buttons are all
determined from abstract methods.
Modifier and Type | Class | Description |
---|---|---|
class |
BasicOptionPaneUI.ButtonActionListener |
This class should be treated as a "protected" inner class.
|
static class |
BasicOptionPaneUI.ButtonAreaLayout |
ButtonAreaLayout behaves in a similar manner to
FlowLayout . |
class |
BasicOptionPaneUI.PropertyChangeHandler |
This class should be treated as a "protected" inner class.
|
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
hasCustomComponents |
This is set to true in validateComponent if a Component is contained
in either the message or the buttons.
|
protected Component |
initialFocusComponent |
Component to receive focus when messaged with selectInitialValue.
|
protected JComponent |
inputComponent |
JComponent provide for input if optionPane.getWantsInput() returns
true.
|
static int |
MinimumHeight |
|
protected Dimension |
minimumSize |
|
static int |
MinimumWidth |
|
protected JOptionPane |
optionPane |
JOptionPane that the receiver is providing the
look and feel for. |
protected PropertyChangeListener |
propertyChangeListener |
Constructor | Description |
---|---|
BasicOptionPaneUI() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
addButtonComponents(Container container,
Object[] buttons,
int initialIndex) |
Creates the appropriate object to represent each of the objects in
buttons and adds it to container . |
protected void |
addIcon(Container top) |
Creates and adds a JLabel representing the icon returned from
getIcon to top . |
protected void |
addMessageComponents(Container container,
GridBagConstraints cons,
Object msg,
int maxll,
boolean internallyCreated) |
Creates the appropriate object to represent
msg and
places it into container . |
protected void |
burstStringInto(Container c,
String d,
int maxll) |
Recursively creates new JLabel instances to represent
d . |
boolean |
containsCustomComponents(JOptionPane op) |
Returns true if in the last call to validateComponent the message
or buttons contained a subclass of Component.
|
protected ActionListener |
createButtonActionListener(int buttonIndex) |
|
protected Container |
createButtonArea() |
Creates and returns a Container containing the buttons.
|
protected LayoutManager |
createLayoutManager() |
|
protected Container |
createMessageArea() |
Messaged from installComponents to create a Container containing the
body of the message.
|
protected PropertyChangeListener |
createPropertyChangeListener() |
|
protected Container |
createSeparator() |
|
static ComponentUI |
createUI(JComponent x) |
Creates a new BasicOptionPaneUI instance.
|
protected Object[] |
getButtons() |
Returns the buttons to display from the JOptionPane the receiver is
providing the look and feel for.
|
protected Icon |
getIcon() |
Returns the icon from the JOptionPane the receiver is providing
the look and feel for, or the default icon as returned from
getDefaultIcon . |
protected Icon |
getIconForType(int messageType) |
Returns the icon to use for the passed in type.
|
protected int |
getInitialValueIndex() |
Returns the initial index into the buttons to select.
|
protected int |
getMaxCharactersPerLineCount() |
Returns the maximum number of characters to place on a line.
|
protected Object |
getMessage() |
Returns the message to display from the JOptionPane the receiver is
providing the look and feel for.
|
Dimension |
getMinimumOptionPaneSize() |
Returns the minimum size the option pane should be.
|
Dimension |
|