Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Stack

Stacks organize their controls into a vertical list. This container does not use hints.

Hierarchy

Index

Constructors

constructor

  • new Stack(...controls: any[]): Stack
  • Creates a new Stack container.

    Parameters

    • Rest ...controls: any[]

      Zero or more controls to be added to the stack.

    Returns Stack

Properties

editorTabScrolling

editorTabScrolling: boolean

This property affects how a container will be added to a component editor when calling addToEditor. If true, then the container will be wrapped in a scroll pane that enables vertical scrolling. If the editor is not tall enough to display all of the controls in a tab, a scroll bar will automatically appear to allow the user to scroll to unreachable controls. If false (the default), then the controls will be clipped to the bottom of their tab.

editorTabWrapping

editorTabWrapping: boolean

This property affects how a container will be added to a component editor when calling addToEditor. If true (the default), then the container will be nested inside of a panel. The panel will be laid out with BorderLayout and the container will be placed in the NORTH position. This produces a more consistent layout by preventing the container from expanding to cover the entire extent of the tab.

realized

realized: boolean

This read-only property is true if this container was previously realized, which means that realizing it again will throw an exception.

title

title: string

This property defines a title for the container. If a title is set, the realized UI panel will be placed in a border titled using this text. Some types of container may ignore this setting.

Methods

_applyTitle

_controlToComponent

  • Converts an object into a corresponding UI component. If the control is already a UI component, it is returned unchanged. If it is an icon, it is wrapped in a label. If it is an image, the image is converted into an icon and treated as above. Other objects are converted into strings and then returned as labels. Subclasses may override this to perform other kinds of conversions.

    Parameters

    • control: any

    Returns JavaObject<"java.awt.Component">

_controlsToArray

  • Converts an array of controls to a Java Object[]. Some container subclasses use this internally as a stage in realizing a container.

    Parameters

    • source: any[]

      the controls to convert, by default the controls in this container are used

    Returns JavaObject<"java.lang.Object[]">

    a Java array of converted controls

add

  • Adds zero or more control objects to this container. The added objects will all be given a default hint value that allows this container to lay the control out as it sees fit.

    Parameters

    • Rest ...controls: any[]

      controls to be added to the container

    Returns AbstractContainer

    this container

addToEditor

  • Realizes this container as a user interface control and adds it to a component editor as a new tab.

    Parameters

    • editor: any

      the editor to add this layout to

    • Optional title: string

      an optional title for the tab that will be added

    • Optional heartbeatListener: CallableFunction

      an optional function that is called every update heartbeat

    • Optional fieldPopulationListener: CallableFunction

      an optional function that is called when the controls should be populated with data from the component

    • Optional tabIndex: number

      an optional index at which to insert the new layout in the list of tabs

    Returns JavaObject<"java.awt.Component">

    the UI container that holds the converted controls

createDialog

  • Realizes this container and places the resulting component in a dialog box. The returned dialog box can be displayed by calling its showDialog() method.

    Parameters

    • Optional title: string

      an optional title for the dialog window

    • Optional okText: string

      optional text to use for the OK button; use null for default text, "" to hide button

    • Optional cancelText: string

      optional text to use for the Cancel button; use null for default text, "" to hide button

    • Optional icon: JavaObject<"swing.Icon">

      an optional icon that will be placed next to the content (null for no icon)

    • Optional modal: boolean

      if true, the script stops running until the dialog is closed

    Returns DialogBox

    the new dialog box

getControl

  • getControl(index: number): any
  • Returns the control added at position index in the list of controls maintained by this container.

    throws

    if the index is invalid

    Parameters

    • index: number

      the index of the control, counting from 0 in the order they were added

    Returns any

    the requested control

getControlCount

  • getControlCount(): number

getHint

  • getHint(index: number): any
  • Returns the hint added at position index in the list of hint maintained by this container.

    throws

    if the index is invalid

    Parameters

    • index: number

      the index of the hint, counting from 0 in the order controls were added

    Returns any

    the requested hint

place

  • Adds zero or more control objects to this container, using hints to control the layout. Not all containers use hints, so these may be ignored. The arguments are declared in pairs: a control followed by its hint: place(control1, "hint1", control2, "hint2", ...).

    Parameters

    • Rest ...controlsAndHints: any[]

      pairs of controls and hints

    Returns AbstractContainer

    this container

realize

  • Convert this container into a user interface component that groups together the controls that have been added to it. Typically the returned object is a swing.JPanel, but this is not required.

    This abstract method is not defined in AbstractContainer and will throw an exception if called. Sublasses must override this method. This method can only be called once. See realized.

    Returns JavaObject<"java.awt.Component">

    the realized container

test

  • test(): void
  • Tests the layout of the container by realizing it and displaying the result in a simple dialog.

    Returns void

Static findEditorTabPane