org.japura.gui
Class ButtonTextField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.japura.gui.ButtonTextField
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ButtonTextField
extends javax.swing.JPanel

Copyright (C) 2010-2011 Carlos Eduardo Leite de Andrade

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see www.gnu.org/licenses/

For more information, contact: www.japura.org

Author:
Carlos Eduardo Leite de Andrade
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ButtonTextField()
           
ButtonTextField(int columns)
           
ButtonTextField(javax.swing.JTextField field)
           
ButtonTextField(java.lang.String text)
           
ButtonTextField(java.lang.String text, int columns)
           
 
Method Summary
 void addButton(java.lang.String buttonName, java.awt.event.ActionListener listener)
           
 void addButton(java.lang.String buttonName, java.net.URL icon, java.awt.event.ActionListener listener)
           
 void addButtonTextFieldListener(ButtonTextFieldListener listener)
           
 void addCaretListener(javax.swing.event.CaretListener listener)
           
 void addFocusListener(java.awt.event.FocusListener listener)
           
 void addKeyListener(java.awt.event.KeyListener listener)
           
 void fireCurrentButtonActionListeners()
           
 java.lang.String getCurrentButtonName()
           
 javax.swing.text.Document getDocument()
           
 java.awt.Color getDropDownButtonBackground()
           
 javax.swing.JTextField getField()
           
 java.net.URL getFixedIcon()
           
 java.awt.Dimension getPreferredSize()
           
 java.lang.String getText()
           
 boolean isDropDownVisible()
           
 boolean isIconVisible()
           
 boolean isSelectedDropDownIconVisible()
           
 void removeButtonTextFieldListener(ButtonTextFieldListener listener)
           
 void setBackground(java.awt.Color background)
           
 void setCurrentButton(java.lang.String buttonName)
           
 void setDocument(javax.swing.text.Document doc)
           
 void setDropDownButtonBackground(java.awt.Color color)
           
 void setDropDownVisible(boolean visible)
           
 void setEnabled(boolean enabled)
           
 void setFixedIcon(java.net.URL fixedIcon)
           
 void setIconCursor(java.awt.Cursor cursor)
           
 void setIconVisible(boolean visible)
           
 void setSelectedDropDownIconVisible(boolean visible)
           
 void setText(java.lang.String text)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ButtonTextField

public ButtonTextField(java.lang.String text)

ButtonTextField

public ButtonTextField(int columns)

ButtonTextField

public ButtonTextField(java.lang.String text,
                       int columns)

ButtonTextField

public ButtonTextField()

ButtonTextField

public ButtonTextField(javax.swing.JTextField field)
Method Detail

addButtonTextFieldListener

public void addButtonTextFieldListener(ButtonTextFieldListener listener)

removeButtonTextFieldListener

public void removeButtonTextFieldListener(ButtonTextFieldListener listener)

getFixedIcon

public java.net.URL getFixedIcon()

setFixedIcon

public void setFixedIcon(java.net.URL fixedIcon)

isDropDownVisible

public boolean isDropDownVisible()

setDropDownVisible

public void setDropDownVisible(boolean visible)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

fireCurrentButtonActionListeners

public void fireCurrentButtonActionListeners()

addButton

public void addButton(java.lang.String buttonName,
                      java.awt.event.ActionListener listener)

addButton

public void addButton(java.lang.String buttonName,
                      java.net.URL icon,
                      java.awt.event.ActionListener listener)

getField

public javax.swing.JTextField getField()

isIconVisible

public boolean isIconVisible()

setIconVisible

public void setIconVisible(boolean visible)

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class javax.swing.JComponent

setCurrentButton

public void setCurrentButton(java.lang.String buttonName)

getCurrentButtonName

public java.lang.String getCurrentButtonName()

setIconCursor

public void setIconCursor(java.awt.Cursor cursor)

setBackground

public void setBackground(java.awt.Color background)
Overrides:
setBackground in class javax.swing.JComponent

isSelectedDropDownIconVisible

public boolean isSelectedDropDownIconVisible()

setDropDownButtonBackground

public void setDropDownButtonBackground(java.awt.Color color)

getDropDownButtonBackground

public java.awt.Color getDropDownButtonBackground()

setSelectedDropDownIconVisible

public void setSelectedDropDownIconVisible(boolean visible)

setText

public void setText(java.lang.String text)
See Also:
JTextComponent.setText(String)

getText

public java.lang.String getText()
See Also:
JTextComponent.getText()

setDocument

public void setDocument(javax.swing.text.Document doc)
See Also:
JTextField.setDocument(Document)

getDocument

public javax.swing.text.Document getDocument()
See Also:
JTextComponent.getDocument()

addFocusListener

public void addFocusListener(java.awt.event.FocusListener listener)
Overrides:
addFocusListener in class java.awt.Component

addKeyListener

public void addKeyListener(java.awt.event.KeyListener listener)
Overrides:
addKeyListener in class java.awt.Component
See Also:
Component.addKeyListener(KeyListener)

addCaretListener

public void addCaretListener(javax.swing.event.CaretListener listener)
See Also:
JTextComponent.addCaretListener(CaretListener)