Container

Extends
Component
Methods
17
Fields
1

Getting one

Container.new()
Box.createGlue():getParent()
JFrame.new(…):getContentPane()

Methods

MethodReturnsDescription
add(Component)Component(Container, Component) -> Component: Adds comp last (taking it from any container it was in), and answers it. Invalidates this containe…
add(string, Component)Component
add<T>(Component, T)()
add(Component, any, number)()
remove(Component)()(Container, Component) -> (): Removes comp if it is a child. Requests nothing: the plugin repaints.
remove(number)()
removeAll()()Removes every child, the last first.
getComponent(number)ComponentThe child at index n (from 0).
getComponentCount()numberHow many children.
getComponents(){Component}The children, in index order (array index 1 is child index 0: the top-most).
setComponentZOrder(Component, number)()Moves comp to child index index (from another container, it is moved here). Requests nothing.
getComponentZOrder(Component)numbercomp's child index, or -1.
isAncestorOf(Component)booleanWhether comp is inside this container, at any depth.
getMousePosition(boolean)Point?Where the pointer is, in this container's coordinates, while the container is showing under it, else nil. With allowChildren false, onl…
setLayout(any)()Sets the layout manager: one of the prelude's (BorderLayout.new(), FlowLayout.new(...), DynamicGridLayout.new(...), ...), a Luau `Lay…
getLayout()anyThe layout manager: the very table setLayout was given, else the one the component was built with (a JPanel's FlowLayout, a Box's `…
doLayout()()Lays the children out now with the layout manager (the native member: an override's X.super.doLayout(self) reaches it).
getInsets()InsetsThe insets: the border's, else zero (the native member).
new()ContainerA new container with the null layout.
init(Container)()A new container with the null layout.
isInstance(any)booleanWhether obj is a Container object, a class(Container) subclass's included.

Fields

FieldTypeDescription
superComponentClassComponent's class table: the base class.

Returned by

MethodReturnsDescription
Component.getParentContainer?The container this component is in, or nil: the very object the plugin built, with its fields.
ContainerClass.newContainerA new container with the null layout.
JDialog.getContentPaneContainer?The content pane: what add, remove and setLayout act on.
JFrame.getContentPaneContainer?The content pane: what add, remove and setLayout act on.

Method details

add

add: ((Container, Component) -> Component) & ((Container, string, Component) -> Component) & (<T>(Container, Component, T) -> ()) & ((Container, Component, any, number) -> ())

(Container, Component) -> Component: Adds comp last (taking it from any container it was in), and answers it. Invalidates this container; schedules no layout (call revalidate() for one).

(Container, string, Component) -> Component: Adds comp under the layout's constraint name (BorderLayout.NORTH, a card's name), and answers it.

(Container, Component, number) -> Component: Adds comp at child index index (-1: last), and answers it.

<T>(Container, Component, T) -> (): Adds comp with the layout's constraints: a BorderLayout region, a GridBagConstraints (copied), a card's name, a layer, or nil.

(Container, Component, any, number) -> (): Adds comp with constraints at child index index.

remove

remove: ((Container, Component) -> ()) & ((Container, number) -> ())

(Container, Component) -> (): Removes comp if it is a child. Requests nothing: the plugin repaints.

(Container, number) -> (): Removes the child at index index.

getMousePosition

getMousePosition: (Container, boolean) -> Point?

Where the pointer is, in this container's coordinates, while the container is showing under it, else nil. With allowChildren false, only where none of its children is under the pointer. The pointer is where the last pointer record over the sidebar left it.

setLayout

setLayout: (Container, any) -> ()

Sets the layout manager: one of the prelude's (BorderLayout.new(), FlowLayout.new(...), DynamicGridLayout.new(...), ...), a Luau LayoutManager (any table with layoutContainer), or nil for absolute positions. The constraints of children added under the old layout are lost.

getLayout

getLayout: (Container) -> any

The layout manager: the very table setLayout was given, else the one the component was built with (a JPanel's FlowLayout, a Box's BoxLayout, a PluginPanel's DynamicGridLayout), made the first time it is asked for and the same table after that, its setters changing the container's layout. nil for the null layout, and for a layout the prelude has no class of (a scroll pane's).

doLayout

doLayout: (Container) -> ()

Lays the children out now with the layout manager (the native member: an override's X.super.doLayout(self) reaches it).

new

new: () -> Container

A new container with the null layout.

isInstance

isInstance: (any) -> boolean

Whether obj is a Container object, a class(Container) subclass's included.