com.togethersoft.openapi.util.ui
Class ExtendedControl

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.togethersoft.openapi.util.ui.ExtendedControl

public class ExtendedControl
extends JPanel

Control which has a rectangular button on the right and a component on the left taking up the rest of the space.

Author:
TogetherSoft
Since: Together 4.0

Inner Class Summary
 private classExtendedControl.ExtendedControlLayoutManager
           

Field Summary
 final static intCHOOSER_BUTTON
          Specify button type as an abstract chooser.
 final static intCOLOR_CHOOSER_BUTTON
          Specify button type as an color chooser.
 final static intFILE_CHOOSER_BUTTON
          Specify button type as an file chooser.
 private static intICONS_COUNT
           
 final static intMULTILINE_TEXT_CHOOSER_BUTTON
          Specify button type as an multiline text chooser.
 protected ActionListenermyActionListener
           
 protected intmyHorizontalButtonPosition
           
 private static Icon[]myIconArray
           
 private static String[]myLocationArray
           
 protected JButtontheButton
           
 protected ComponenttheComponent
           

Fields inherited from class javax.swing.JComponent
ui, listenerList, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, accessibleContext

Fields inherited from class java.awt.Component
TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT

Constructor Summary
 ExtendedControl(int buttonType, Component innerComponent, ActionListener al)
          Constructs new ExtendedControl.
 ExtendedControl(int buttonType, Component innerComponent, ActionListener al, boolean isIconEnabled)
          Constructs new ExtendedControl.
 ExtendedControl(String buttonText, Icon buttonIcon, Component innerComponent, ActionListener al)
          Constructs new extended control.
 protected ExtendedControl()
          Constructs new empty extended control.

Method Summary
 voidaddFocusListener(FocusListener l)
          Adds specified focus listener for this container.
 voiddispose()
          Removes action listener and all components from this container.
 protected KeyStrokegetActionKeyStroke()
           
 protected JButtongetButton(String buttonText, Icon buttonIcon)
           
 protected static JButtongetButton(int buttonType)
           
 static JButtongetChooserButton()
          Returns JButton represents chooser button.
 static IcongetChooserIcon()
          Returns chooser button icon.
 static JButtongetColorChooserButton()
          Returns JButton represents file chooser button.
 static IcongetColorChooserIcon()
          Returns file chooser button icon.
 static JButtongetFileChooserButton()
          Returns JButton represents file chooser button.
 static IcongetFileChooserIcon()
          Returns file chooser button icon.
 static IcongetIcon(int buttonType)
          Returns chooser button icon by buttonType.
 static JButtongetMultilineTextChooserButton()
          Returns JButton represents file chooser button.
 static IcongetMultilineTextChooserIcon()
          Returns file chooser button icon.
 protected voidinit(JButton button, Component innerComponent, ActionListener al)
           
 voidremoveFocusListener(FocusListener l)
          Removes specified focus listener from this container.
 voidrequestFocus()
          Requests that button in this container get the input focus.
 voidsetEnabled(boolean enabled)
          Enables this control.
 voidsetHorizontalButtonPosition(int buttonPosition)
          Sets the horizontal position of the טדוושע, relative to Component.

Methods inherited from class javax.swing.JPanel
updateUI, getUIClassID, paramString, getAccessibleContext

Methods inherited from class javax.swing.JComponent
setUI, getComponentGraphics, paintComponent, paintChildren, paintBorder, update, paint, printAll, print, printComponent, printChildren, printBorder, isPaintingTile, isFocusCycleRoot, isManagingFocus, setNextFocusableComponent, getNextFocusableComponent, setRequestFocusEnabled, isRequestFocusEnabled, grabFocus, setVerifyInputWhenFocusTarget, getVerifyInputWhenFocusTarget, setPreferredSize, getPreferredSize, setMaximumSize, getMaximumSize, setMinimumSize, getMinimumSize, isMinimumSizeSet, isPreferredSizeSet, isMaximumSizeSet, contains, setBorder, getBorder, getInsets, getInsets, getAlignmentY, setAlignmentY, getAlignmentX, setAlignmentX, setInputVerifier, getInputVerifier, getGraphics, setDebugGraphicsOptions, getDebugGraphicsOptions, registerKeyboardAction, registerKeyboardAction, unregisterKeyboardAction, getRegisteredKeyStrokes, getConditionForKeyStroke, getActionForKeyStroke, resetKeyboardActions, setInputMap, getInputMap, getInputMap, setActionMap, getActionMap, requestDefaultFocus, setVisible, hide, setForeground, setBackground, setFont, isFocusTraversable, processFocusEvent, processComponentKeyEvent, processKeyEvent, processKeyBinding, setToolTipText, getToolTipText, getToolTipText, getToolTipLocation, createToolTip, scrollRectToVisible, setAutoscrolls, getAutoscrolls, processMouseMotionEvent, enable, disable, getClientProperty, putClientProperty, isLightweightComponent, reshape, getBounds, getSize, getLocation, getX, getY, getWidth, getHeight, hasFocus, isOpaque, setOpaque, computeVisibleRect, getVisibleRect, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener, fireVetoableChange, addVetoableChangeListener, removeVetoableChangeListener, getTopLevelAncestor, addAncestorListener, removeAncestorListener, getListeners, addNotify, removeNotify, repaint, repaint, revalidate, isValidateRoot, isOptimizedDrawingEnabled, paintImmediately, paintImmediately, setDoubleBuffered, isDoubleBuffered, getRootPane

Methods inherited from class java.awt.Container
getComponentCount, countComponents, getComponent, getComponents, insets, add, add, add, add, add, addImpl, remove, remove, removeAll, getLayout, setLayout, doLayout, layout, invalidate, validate, validateTree, preferredSize, minimumSize, paintComponents, printComponents, addContainerListener, removeContainerListener, processEvent, processContainerEvent, deliverEvent, getComponentAt, locate, getComponentAt, findComponentAt, findComponentAt, isAncestorOf, list, list

Methods inherited from class java.awt.Component
getName, setName, getParent, getPeer, setDropTarget, getDropTarget, getGraphicsConfiguration, getTreeLock, getToolkit, isValid, isDisplayable, isVisible, isShowing, isEnabled, enable, enableInputMethods, show, show, getForeground, getBackground, getFont, getLocale, setLocale, getColorModel, getLocation, getLocationOnScreen, location, setLocation, move, setLocation, getSize, size, setSize, resize, setSize, resize, getBounds, bounds, setBounds, setBounds, isLightweight, getFontMetrics, setCursor, getCursor, paintAll, repaint, repaint, repaint, imageUpdate, createImage, createImage, prepareImage, prepareImage, checkImage, checkImage, inside, contains, dispatchEvent, postEvent, addComponentListener, removeComponentListener, addHierarchyListener, removeHierarchyListener, addHierarchyBoundsListener, removeHierarchyBoundsListener, addKeyListener, removeKeyListener, addMouseListener, removeMouseListener, addMouseMotionListener, removeMouseMotionListener, addInputMethodListener, removeInputMethodListener, getInputMethodRequests, getInputContext, enableEvents, disableEvents, coalesceEvents, processComponentEvent, processMouseEvent, processInputMethodEvent, processHierarchyEvent, processHierarchyBoundsEvent, handleEvent, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, action, gotFocus, lostFocus, transferFocus, nextFocus, add, remove, toString, list, list, list, setComponentOrientation, getComponentOrientation

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize

Field Detail

CHOOSER_BUTTON

public final static int CHOOSER_BUTTON
Specify button type as an abstract chooser.

COLOR_CHOOSER_BUTTON

public final static int COLOR_CHOOSER_BUTTON
Specify button type as an color chooser.
Since:
Together 4.1

FILE_CHOOSER_BUTTON

public final static int FILE_CHOOSER_BUTTON
Specify button type as an file chooser.

ICONS_COUNT

private static int ICONS_COUNT

MULTILINE_TEXT_CHOOSER_BUTTON

public final static int MULTILINE_TEXT_CHOOSER_BUTTON
Specify button type as an multiline text chooser.
Since:
Together 5.0

myActionListener

protected ActionListener myActionListener

myHorizontalButtonPosition

protected int myHorizontalButtonPosition

myIconArray

private static Icon[] myIconArray

myLocationArray

private static String[] myLocationArray

theButton

protected JButton theButton

theComponent

protected Component theComponent
Constructor Detail

ExtendedControl

public ExtendedControl(int buttonType, Component innerComponent, ActionListener al)
Constructs new ExtendedControl.
Parameters:
buttonType Type of button; can be CHOOSER_BUTTON or FILE_CHOOSER_BUTTON
innerComponent AWT component to be placed on the left side of this ExtendedControl
al ActionListener for this ExtendedControl

ExtendedControl

public ExtendedControl(int buttonType, Component innerComponent, ActionListener al, boolean isIconEnabled)
Constructs new ExtendedControl.
Parameters:
buttonType Type of button; can be CHOOSER_BUTTON or FILE_CHOOSER_BUTTON
innerComponent AWT component to be placed on the left side of this ExtendedControl
al ActionListener for this ExtendedControl
isIconEnabled idicates which icon should be loaded
Since:
Together 5.0

ExtendedControl

public ExtendedControl(String buttonText, Icon buttonIcon, Component innerComponent, ActionListener al)
Constructs new extended control.
Parameters:
buttonText The text to be placed in the button
buttonIcon The icon to be placed in the button
innerComponent The inner component placed on the left
al The action listener to be executed when the button is pressed

ExtendedControl

protected ExtendedControl()
Constructs new empty extended control.
Since:
Together 5.0
Method Detail

addFocusListener

public void addFocusListener(FocusListener l)
Adds specified focus listener for this container.

dispose

public void dispose()
Removes action listener and all components from this container.

getActionKeyStroke

protected KeyStroke getActionKeyStroke()
Since:
Together 5.0

getButton

protected JButton getButton(String buttonText, Icon buttonIcon)
Since:
Together 5.0

getButton

protected static JButton getButton(int buttonType)
Since:
Together 5.0

getChooserButton

public static JButton getChooserButton()
Returns JButton represents chooser button.

getChooserIcon

public static Icon getChooserIcon()
Returns chooser button icon. Icon is in the gif format.

getColorChooserButton

public static JButton getColorChooserButton()
Returns JButton represents file chooser button.
Since:
Together 4.1

getColorChooserIcon

public static Icon getColorChooserIcon()
Returns file chooser button icon. Icon is in the gif format.
Since:
Together 4.1

getFileChooserButton

public static JButton getFileChooserButton()
Returns JButton represents file chooser button.

getFileChooserIcon

public static Icon getFileChooserIcon()
Returns file chooser button icon. Icon is in the gif format.

getIcon

public static Icon getIcon(int buttonType)
Returns chooser button icon by buttonType. Icon is in the gif format.
Since:
Together 5.0

getMultilineTextChooserButton

public static JButton getMultilineTextChooserButton()
Returns JButton represents file chooser button.
Since:
Together 5.0

getMultilineTextChooserIcon

public static Icon getMultilineTextChooserIcon()
Returns file chooser button icon. Icon is in the gif format.
Since:
Together 5.0

init

protected void init(JButton button, Component innerComponent, ActionListener al)

removeFocusListener

public void removeFocusListener(FocusListener l)
Removes specified focus listener from this container.

requestFocus

public void requestFocus()
Requests that button in this container get the input focus.
The button must be visible on the screen for this request to be granted.

setEnabled

public void setEnabled(boolean enabled)
Enables this control.

setHorizontalButtonPosition

public void setHorizontalButtonPosition(int buttonPosition)
Sets the horizontal position of the טדוושע, relative to Component.
Parameters:
buttonPosition - One of the following constants defined in SwingConstants: LEFT or RIGHT (the default).
Since:
Together 5.0
See Also:
SwingConstants

Association Links

to Class java.awt.Component

to Class javax.swing.JButton

to Class java.awt.event.ActionListener

to Class javax.swing.Icon

to Class java.lang.String