javax.swing.plaf.basic
Class BasicOptionPaneUI
This class is the UI delegate for JOptionPane in the Basic Look and Feel.
contains , createUI , getAccessibleChild , getAccessibleChildrenCount , getMaximumSize , getMinimumSize , getPreferredSize , installUI , paint , uninstallUI , update |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
MinimumHeight
public static final int MinimumHeight
The minimum height for JOptionPanes.
MinimumWidth
public static final int MinimumWidth
The minimum width for JOptionPanes.
hasCustomComponents
protected boolean hasCustomComponents
Whether the JOptionPane contains custom components.
initialFocusComponent
protected Component initialFocusComponent
The button that will receive focus based on initialValue when no input
component is present. If an input component is present, then the input
component will receive focus instead.
addButtonComponents
protected void addButtonComponents(Container container,
Object[] buttons,
int initialIndex)
This method is messaged to add the buttons to the given container.
container
- The container to add components to.buttons
- The buttons to add. (If it is an instance of component,
the Object is added directly. If it is an instance of Icon, it is
packed into a label and added. For all other cases, the string
representation of the Object is retreived and packed into a
label.)initialIndex
- The index of the component that is the initialValue.
addIcon
protected void addIcon(Container top)
This method adds the appropriate icon the given container.
top
- The container to add an icon to.
addMessageComponents
protected void addMessageComponents(Container container,
GridBagConstraints cons,
Object msg,
int maxll,
boolean internallyCreated)
This method creates the proper object (if necessary) to represent msg.
(If msg is an instance of Component, it will add it directly. If it is
an icon, then it will pack it in a label and add it. Otherwise, it gets
treated as a string. If the string is longer than maxll, a box is
created and the burstStringInto is called with the box as the container.
The box is then added to the given container. Otherwise, the string is
packed in a label and placed in the given container.) This method is
also used for adding the inputComponent to the container.
container
- The container to add to.cons
- The constraints when adding.msg
- The message to add.maxll
- The max line length.internallyCreated
- Whether the msg is internally created.
burstStringInto
protected void burstStringInto(Container c,
String d,
int maxll)
This method creates instances of d (recursively if necessary based on
maxll) and adds to c.
c
- The container to add to.d
- The string to burst.maxll
- The max line length.
createButtonActionListener
protected ActionListener createButtonActionListener(int buttonIndex)
This method creates a button action listener for the given button index.
buttonIndex
- The index of the button in components.
- A new ButtonActionListener.
createLayoutManager
protected LayoutManager createLayoutManager()
This method creates a new LayoutManager for the button area.
- A new LayoutManager for the button area.
createSeparator
protected Container createSeparator()
This method creates a Container that will separate the message and button
areas.
- A Container that will separate the message and button areas.
getButtons
protected Object[] getButtons()
This method returns the buttons for the JOptionPane. If no options are
set, a set of options will be created based upon the optionType.
- The buttons that will be added.
getIcon
protected Icon getIcon()
This method will return the icon the user has set or the icon that will
be used based on message type.
- The icon to use in the JOptionPane.
getIconForType
protected Icon getIconForType(int messageType)
This method returns the icon for the given messageType.
messageType
- The type of message.
- The icon for the given messageType.
getInitialValueIndex
protected int getInitialValueIndex()
This method returns the index of the initialValue in the options array.
- The index of the initalValue.
getMaxCharactersPerLineCount
protected int getMaxCharactersPerLineCount()
This method returns the maximum number of characters that should be
placed on a line.
- The maximum number of characteres that should be placed on a
line.
getMessage
protected Object getMessage()
This method returns the message of the JOptionPane.
getSizeButtonsToSameWidth
protected boolean getSizeButtonsToSameWidth()
This method returns whether all buttons should have the same width.
- Whether all buttons should have the same width.
installComponents
protected void installComponents()
This method installs components for the JOptionPane.
installDefaults
protected void installDefaults()
This method installs defaults for the JOptionPane.
installKeyboardActions
protected void installKeyboardActions()
This method installs keyboard actions for the JOptionpane.
installListeners
protected void installListeners()
This method installs listeners for the JOptionPane.
resetInputValue
protected void resetInputValue()
Changes the inputValue property in the JOptionPane based on the current
value of the inputComponent.
uninstallComponents
protected void uninstallComponents()
This method uninstalls all the components in the JOptionPane.
uninstallDefaults
protected void uninstallDefaults()
This method uninstalls the defaults for the JOptionPane.
uninstallKeyboardActions
protected void uninstallKeyboardActions()
This method uninstalls keyboard actions for the JOptionPane.
uninstallListeners
protected void uninstallListeners()
This method uninstalls listeners for the JOptionPane.
BasicOptionPaneUI.java --
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.