## install4j API documentation

## com.install4j.api
Class CustomScreen

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      com.install4j.api.CustomScreen

All Implemented Interfaces:
  InstallerEventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

    public abstract class CustomScreen

extends javax.swing.JPanel
implements InstallerEventListener

All custom screens must be derived from this class. You have to implement all abstract methods and provide a public constructor with no arguments. Instances of derived custom screens have to be registered in the "installer GUI" step of the install4j GUI. Every custom screen is an `InstallerEventListener` and is automatically registered with the `InstallerWizardContext` to receive application events. If you want to react to these events you have to override the `installerEvent` method.

Note: This class is only relevant for install4j Enterprise Edition.

Author:
  ej-technologies GmbH
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.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
`CustomScreen()`

Method Summary
`void` | `activated()` Called by the framework when the screen is activated.
`boolean` | `cancel()` Called when the user clicks the "Cancel" button for this screen.
`void` | `deactivated()` Called by the framework when the screen is deactivated.
`javax.swing.JFrame` | `getFrame()` Returns the frame of the installer wizard.
`InstallerWizardContext` | `getInstallerContext()` Returns the `InstallerWizardContext` that the framework has associated with this custom screen in `setInstallerContext`.
`abstract java.lang.String` | `getSubTitle()` Returns the subtitle of this custom screen which is displayed at the top of the installer wizard just below the title of the screen.
`abstract java.lang.String` | `getTitle()` Returns the title of this custom screen which is displayed at the top of the installer wizard.
`void` | `installerEvent(InstallerEvent event)` Called when an application event is fired.
`boolean` | `isCancelVisible()` Returns whether the "Cancel" button is visible or not for this screen.
`abstract boolean` | `isFillHorizontal()` Returns whether this screen wants to grow in the horizontal direction.
`abstract boolean` | `isFillVertical()` Returns whether this screen wants to grow in the vertical direction.
`boolean` | `isFinishScreen()` Returns whether this is a screen that finished the wizard.
`boolean` | `isNextVisible()` Returns whether the "Next" button is visible or not for this screen.
`boolean` | `isPreviousVisible()` Returns whether the "Back" button is visible or not for this screen.
`boolean` | `next()` Called when the user clicks the "Next" button for this screen.
`boolean` | `previous()` Called when the user clicks the "Back" button for this screen.
`void` | `setInstallerContext(InstallerWizardContext context)` This method is called by the framework to set the `InstallerWizardContext`.
`boolean` | `showOnNext()` Returns whether this screen should be shown when the user traverses screens in the forward direction.
`boolean` | `showOnPrevious()` Returns whether this screen should be shown when the user traverses screens in the backward direction.

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, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, 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, 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

### CustomScreen

    public CustomScreen()

Method Detail

### getInstallerContext

    public InstallerWizardContext getInstallerContext()

  Returns the `InstallerWizardContext` that the framework has associated with this custom screen in `setInstallerContext`.

  Returns:
    the context.

### setInstallerContext

    public void setInstallerContext(InstallerWizardContext context)

  This method is called by the framework to set the `InstallerWizardContext`. This is the context that is returned from `getInstallerContext`. If you have to register an `InstallerEventListener` on the context (note that the screen itself is already registered), you can override this method. Do not forget to call the super implementation in that case.

  Parameters:
    `context` - the context.

### getTitle

    public abstract java.lang.String getTitle()

  Returns the title of this custom screen which is displayed at the top of the installer wizard.

  Returns:
    the title.

### getSubTitle

    public abstract java.lang.String getSubTitle()

  Returns the subtitle of this custom screen which is displayed at the top of the installer wizard just below the title of the screen.

  Returns:
    the title.

### isFillVertical

    public abstract boolean isFillVertical()

  Returns whether this screen wants to grow in the vertical direction. If not, the screen will be aligned at the top of the available space and be sized at its preferred vertical size. If, for example, you have a list in your layout that should use as much vertical space as possible, you should return `true` here. In that case you would also want to return `true` in `isFillHorizontal`. If all your components are fixed-size components, return `false`.

  Returns:
    `true` or `false`.

### isFillHorizontal

    public abstract boolean isFillHorizontal()

  Returns whether this screen wants to grow in the horizontal direction. If not, the screen will be aligned at the left of the available space and be sized at its preferred horizontal size. If, for example, you have text fields in your layout that should use as much horizontal space as possible, you should return `true` here. If all your components are fixed-size components, return `false`.

  Returns:
    `true` or `false`.

### isNextVisible

    public boolean isNextVisible()

  Returns whether the "Next" button is visible or not for this screen. If you just want to disable the button initially, please override `activate` and invoke `setNextButtonEnabled` in the `InstallerWizardContext`.

  Returns:
    `true` or `false`. Default is `true`.

### isPreviousVisible

    public boolean isPreviousVisible()

  Returns whether the "Back" button is visible or not for this screen. If you just want to disable the button initially, please override `activate` and invoke `setPreviousButtonEnabled` in the `InstallerWizardContext`.

  Returns:
    `true` or `false`. Default is `true`.

### isCancelVisible

    public boolean isCancelVisible()

  Returns whether the "Cancel" button is visible or not for this screen. If you just want to disable the button initially, please override `activate` and invoke `setCancelButtonEnabled` in the `InstallerWizardContext`.

  Returns:
    `true` or `false`. Default is `true`.

### isFinishScreen

    public boolean isFinishScreen()

  Returns whether this is a screen that finished the wizard. The "Next" button will have the caption "Finish" in this case and will close the wizard when clicked.

  Returns:
    `true` or `false`. Default is `false`.

### showOnNext

    public boolean showOnNext()

  Returns whether this screen should be shown when the user traverses screens in the forward direction. You can override this method and `showOnPrevious` to conditionally disable the screen.

  Returns:
    `true` or `false`. Default is `true`.

### showOnPrevious

    public boolean showOnPrevious()

  Returns whether this screen should be shown when the user traverses screens in the backward direction. You can override this method and `showOnNext` to conditionally disable the screen.

  Returns:
    `true` or `false`. Default is `true`.

### activated

    public void activated()

  Called by the framework when the screen is activated. Override this method to do any special initialization.

### deactivated

    public void deactivated()

  Called by the framework when the screen is deactivated. Override this method to do any special cleanup.

### installerEvent

    public void installerEvent(InstallerEvent event)

  Description copied from interface: `InstallerEventListener`
  Called when an application event is fired.

  Specified by:
    `installerEvent` in interface `InstallerEventListener`
  Parameters:
    `event` - the event

### next

    public boolean next()

  Called when the user clicks the "Next" button for this screen. You can veto the change to the next screen if you return `false`.

  Returns:
    whether the screen change is accepted or not. Default is `true`.

### previous

    public boolean previous()

  Called when the user clicks the "Back" button for this screen. You can veto the change to the previous screen if you return `false`.

  Returns:
    whether the screen change is accepted or not. Default is `true`.

### cancel

    public boolean cancel()

  Called when the user clicks the "Cancel" button for this screen. You can veto the cancel action if you return `false`.

  Returns:
    whether the cancellation is accepted or not. Default is `true`.

### getFrame

    public javax.swing.JFrame getFrame()

  Returns the frame of the installer wizard.

  Returns:
    the frame.