Class IAChoiceGroup

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

    public class IAChoiceGroup
    extends IAControl

    The IAChoiceGroup class exposes the InstallAnywhere internal choice components, used by some install panels and by the Advanced Designer.

    You can set the choice to be done by: check boxes, radio buttons, a combo box or a list.

    Example of use:

    IAChoiceGroup choiceGroup = new IAChoiceGroup(IAChoiceGroup.RADIO_BUTTONS,
        IAChoiceGroup.STATE_ENABLED_DISABLED, IAChoiceGroup.ORIENTATION_VERTICAL);
    choiceGroup.addItem("Use current path", false, null);
    choiceGroup.addItem("Use old path", true, null);
    choiceGroup.addItem("Use custom path", false, new IAFileChooser());
    choiceGroup.prepare();

    See Also:
    Serialized Form
    • Nested Class Summary

      • 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 
      Modifier and Type Field Description
      static int CHECKBOXES
      The choice will be done by check boxes.
      static int COMBOBOX
      The choice will be done by a combo box.
      static int LIST
      The choice will be done by a list.
      static int ORIENTATION_HORIZONTAL
      If the components are check boxes or radio buttons, they'll be aligned horizontally.
      static int ORIENTATION_VERTICAL
      If the components are check boxes or radio buttons, they'll be aligned vertically.
      static int RADIO_BUTTONS
      The choice will be done by radio buttons.
      static int STATE_ENABLED_DISABLED
      Sub-component of the items should be enabled if the item is checked and disabled if unchecked.
      static int STATE_SHOWN_HIDDEN
      Sub-component of the items should be shown if the item is checked and hidden if unchecked.
      • Fields inherited from class javax.swing.JComponent

        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

        accessibleContext, 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

      Constructors 
      Constructor Description
      IAChoiceGroup()
      Main constructor of the IAChoiceGroup class.
      IAChoiceGroup​(int fieldType)
      Overloaded constructor that initializes the field type.
      IAChoiceGroup​(int fieldType, int state)
      Overloaded constructor that initializes the field type and the state.
      IAChoiceGroup​(int fieldType, int state, int orientation)
      Overloaded constructor that initializes the field type, the state and the orientation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addItem​(java.lang.String name, boolean selected, java.awt.Component subComponent)
      Used to add Items to the choice component.
      void addItem​(java.lang.String name, java.lang.String component_id, boolean selected, java.awt.Component subComponent)
      Used to add Items to the choice component.
      void addItemListener​(java.awt.event.ItemListener l)
      Adds an ItemListener to the choice component.
      java.awt.Color getBackground()
      Gets the background color of the choice component.
      java.lang.String getComponentID()
      Get the component ID.
      java.awt.Font getFont()
      Gets the font of the choice component.
      java.awt.Color getForeground()
      Gets the foreground color of the choice component.
      boolean isItemSelected​(java.lang.String name)
      Returns whether the item with the specific name is selected.
      int itemsCount()
      Returns the number of items added to the choice component.
      void prepare()
      The prepare() method should always be called after all the items are configured.
      void removeItem​(java.lang.String name)
      Removes an item from the choice component.
      void removeItemListener​(java.awt.event.ItemListener l)
      Removes an ItemListener from the choice component.
      void setBackground​(java.awt.Color color)
      Changes the background color of the choice component.
      void setComponentID​(java.lang.String component_id)
      Set the component ID
      void setFont​(java.awt.Font font)
      Changes the font of the choice component.
      void setForeground​(java.awt.Color color)
      Changes the foreground color of the choice component.
      void setToolTipText​(java.lang.String toolTipText)
      Set ToolTipText
      • 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
      • 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, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • CHECKBOXES

        public static final int CHECKBOXES
        The choice will be done by check boxes.
        See Also:
        Constant Field Values
      • RADIO_BUTTONS

        public static final int RADIO_BUTTONS
        The choice will be done by radio buttons.
        See Also:
        Constant Field Values
      • COMBOBOX

        public static final int COMBOBOX
        The choice will be done by a combo box.
        See Also:
        Constant Field Values
      • ORIENTATION_HORIZONTAL

        public static final int ORIENTATION_HORIZONTAL
        If the components are check boxes or radio buttons, they'll be aligned horizontally.
        See Also:
        Constant Field Values
      • ORIENTATION_VERTICAL

        public static final int ORIENTATION_VERTICAL
        If the components are check boxes or radio buttons, they'll be aligned vertically.
        See Also:
        Constant Field Values
      • STATE_ENABLED_DISABLED

        public static final int STATE_ENABLED_DISABLED
        Sub-component of the items should be enabled if the item is checked and disabled if unchecked.
        See Also:
        Constant Field Values
      • STATE_SHOWN_HIDDEN

        public static final int STATE_SHOWN_HIDDEN
        Sub-component of the items should be shown if the item is checked and hidden if unchecked.
        See Also:
        Constant Field Values
    • Constructor Detail

      • IAChoiceGroup

        public IAChoiceGroup()
        Main constructor of the IAChoiceGroup class. The field type is set to CHECKBOXES, the orientation is set to ORIENTATION_HORIZONTAL and the state to STATE_ENABLED_DISABLED.
      • IAChoiceGroup

        public IAChoiceGroup​(int fieldType)
        Overloaded constructor that initializes the field type. The orientation is set to ORIENTATION_HORIZONTAL and the state to STATE_ENABLED_DISABLED.
        Parameters:
        fieldType - The field type of the choice component. Can be set to CHECKBOXES, RADIO_BUTTONS, COMBOBOX or LIST.
        See Also:
        CHECKBOXES, RADIO_BUTTONS, COMBOBOX, LIST
      • IAChoiceGroup

        public IAChoiceGroup​(int fieldType,
                             int state)
        Overloaded constructor that initializes the field type and the state. The orientation is set to ORIENTATION_HORIZONTAL.
        Parameters:
        fieldType - The field type of the choice component. Can be set to CHECKBOXES, RADIO_BUTTONS, COMBOBOX or LIST.
        state - The state of the choice component. Can be set to STATE_ENABLED_DISABLED or STATE_SHOWN_HIDDEN.
        See Also:
        CHECKBOXES, RADIO_BUTTONS, COMBOBOX, LIST, STATE_ENABLED_DISABLED, STATE_SHOWN_HIDDEN
      • IAChoiceGroup

        public IAChoiceGroup​(int fieldType,
                             int state,
                             int orientation)
        Overloaded constructor that initializes the field type, the state and the orientation. Indicated to check boxes and radio buttons.
        Parameters:
        fieldType - The field type of the choice component. Can be set to CHECKBOXES, RADIO_BUTTONS, COMBOBOX or LIST.
        state - The state of the choice component. Can be set to STATE_ENABLED_DISABLED or STATE_SHOWN_HIDDEN.
        orientation - The orientation of the choice component (only applicable for check boxes and radio buttons). Can be set to ORIENTATION_HORIZONTAL or ORIENTATION_VERTICAL.
        See Also:
        CHECKBOXES, RADIO_BUTTONS, COMBOBOX, LIST, STATE_ENABLED_DISABLED, STATE_SHOWN_HIDDEN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL
    • Method Detail

      • addItem

        public void addItem​(java.lang.String name,
                            boolean selected,
                            java.awt.Component subComponent)
        Used to add Items to the choice component.
        Parameters:
        name - The item's name, that will appear in the control. This name must be unique for each item.
        selected - Whether the item should be checked or selected by default.
        subComponent - A subcomponent that will be managed by the item.
      • addItem

        public void addItem​(java.lang.String name,
                            java.lang.String component_id,
                            boolean selected,
                            java.awt.Component subComponent)
        Used to add Items to the choice component.
        Parameters:
        name - The item's name, that will appear in the control. This name must be unique for each item.
        component_id - Identifire for the component (Only applicable to CheckBox & Radio Button)
        selected - Whether the item should be checked or selected by default.
        subComponent - A subcomponent that will be managed by the item.
      • isItemSelected

        public boolean isItemSelected​(java.lang.String name)
        Returns whether the item with the specific name is selected.
        Parameters:
        name - The item's name, that will be used as a key for finding the item.
        Returns:
        Whether the item with the specific name is selected.
      • itemsCount

        public int itemsCount()
        Returns the number of items added to the choice component.
        Returns:
        The number of items added to the choice component.
      • removeItem

        public void removeItem​(java.lang.String name)
        Removes an item from the choice component.
        Parameters:
        name - The item's name, that will be used as a key for finding the item.
      • addItemListener

        public void addItemListener​(java.awt.event.ItemListener l)
        Adds an ItemListener to the choice component. The itemStateChanged() method will be called whenever the selection changes in the choice component.
        Parameters:
        l - The ItemListener that will handle events generated by the choice component.
      • removeItemListener

        public void removeItemListener​(java.awt.event.ItemListener l)
        Removes an ItemListener from the choice component.
        Parameters:
        l - The ItemListener that will be removed from the choice component.
      • setBackground

        public void setBackground​(java.awt.Color color)
        Changes the background color of the choice component. Only applicable when field type is either COMBOBOX or LIST.
        Overrides:
        setBackground in class javax.swing.JComponent
        Parameters:
        color - The new color for the background of the choice component.
        See Also:
        COMBOBOX, LIST
      • getBackground

        public java.awt.Color getBackground()
        Gets the background color of the choice component. Only applicable when field type is either COMBOBOX or LIST.
        Overrides:
        getBackground in class java.awt.Component
        Returns:
        The color of the background of the choice component.
        See Also:
        COMBOBOX, LIST
      • setForeground

        public void setForeground​(java.awt.Color color)
        Changes the foreground color of the choice component.
        Overrides:
        setForeground in class javax.swing.JComponent
        Parameters:
        color - The new foreground color for the choice component.
      • getForeground

        public java.awt.Color getForeground()
        Gets the foreground color of the choice component.
        Overrides:
        getForeground in class java.awt.Component
        Returns:
        The foreground color of the choice component.
      • setFont

        public void setFont​(java.awt.Font font)
        Changes the font of the choice component.
        Overrides:
        setFont in class javax.swing.JComponent
        Parameters:
        font - The new font for the choice component.
      • getFont

        public java.awt.Font getFont()
        Gets the font of the choice component.
        Specified by:
        getFont in interface java.awt.MenuContainer
        Overrides:
        getFont in class java.awt.Component
        Returns:
        The font of the choice component.
      • prepare

        public void prepare()
        The prepare() method should always be called after all the items are configured. It refreshes all the subcomponents's state and handles the layout of the internal components to look better on the parent component.
      • getComponentID

        public java.lang.String getComponentID()
        Get the component ID.
        Returns:
        The ID of the component
      • setComponentID

        public void setComponentID​(java.lang.String component_id)
        Set the component ID
        Parameters:
        component_id - The ID of the component
      • setToolTipText

        public void setToolTipText​(java.lang.String toolTipText)
        Set ToolTipText
        Overrides:
        setToolTipText in class javax.swing.JComponent