Modifier and Type | Method and Description |
---|---|
static Shell |
active()
Returns the active shell using the following logic:
- the active shell needs to be visible, and it can't be a temporary pop-up (it needs to have a toolbar)
- if it's invisible or temporary, we trust its top-left position as the "user position"
- if there's no shell at all, we use the mouse cursor as the "user position"
- we iterate over every shell, and find the ones that are underneath the "user position"
- of the candidate shells, we return the one which is nested the deepest
on Windows and OS X, the active shell is the one that currently has user focus
on Linux, the last created shell (even if it is invisible) will count as the active shell
This is a problem because some things create a fake hidden shell to act as a parent for other
operations (specifically our right-click infrastructure).
|
static Shells |
builder(int style,
Coat coat)
Creates a new Shells for this Coat.
|
static Disposable |
confirmClose(Shell shell,
String title,
String question,
Runnable runOnClose)
Prevents the given shell from closing without prompting.
|
Shells |
dontSetPositionOrSize()
Prevents setting any size or position.
|
Shell |
openOn(Shell parent)
Opens the shell on this parent shell.
|
Shell |
openOnActive()
Opens the shell on the currently active shell.
|
void |
openOnActiveBlocking()
Opens the shell on the currently active shell and blocks.
|
void |
openOnAndBlock(Shell parent)
Deprecated.
for
openOnBlocking(Shell) - same behavior, but name is consistent with the others. |
void |
openOnBlocking(Shell parent)
Opens the shell on this parent and blocks.
|
Shell |
openOnDisplay()
Opens the shell as a root shell.
|
void |
openOnDisplayBlocking()
Opens the shell as a root shell and blocks.
|
Shells |
setAlpha(int alpha)
Sets the alpha for this Shell.
|
Shells |
setBounds(Control control)
Calls
setBounds(Rectangle) to match this control. |
Shells |
setBounds(ControlWrapper wrapper)
Calls
setBounds(Rectangle) to match this control. |
Shells |
setBounds(Rectangle bounds)
Sets the full bounds for this shell.
|
Shells |
setCloseOnEscape(boolean closeOnEscape)
Determines whether the shell will close on escape, defaults to false.
|
Shells |
setDontOpen(boolean dontOpen)
If true, the "openOn" methods will create the shell but not actually open them.
|
Shells |
setImage(Image image)
Sets the title image for this Shell.
|
Shells |
setLocation(Corner corner,
Point position)
Sets the absolute location of the the given corner of this shell.
|
Shells |
setLocation(Point openPosition)
Sets the absolute location of the top-left of this shell.
|
Shells |
setPositionIncludesTrim(boolean positionIncludesTrim)
If true, size and location will set the the "outside" of the Shell - including the trim.
|
Shells |
setRectangle(Rectangle rect)
Calls
setLocation(Point) and setSize(Point) in one line. |
Shells |
setSize(int x,
int y) |
Shells |
setSize(Point size)
Sets the size for this Shell.
|
Shells |
setTitle(String title)
Sets the title for this Shell.
|
public Shells setAlpha(int alpha)
public Shells setBounds(Rectangle bounds)
setRectangle(Rectangle)
and #setPositionIncludesTrim(true)
.public Shells setBounds(Control control)
setBounds(Rectangle)
to match this control.public Shells setBounds(ControlWrapper wrapper)
setBounds(Rectangle)
to match this control.public Shells setRectangle(Rectangle rect)
setLocation(Point)
and setSize(Point)
in one line.public Shells setSize(@Nullable Point size)
IllegalArgumentException
- if size is non-null and both components are negativepublic Shells setSize(int x, int y)
setSize(Point)
public Shells setLocation(Point openPosition)
public Shells setLocation(Corner corner, Point position)
public Shells setPositionIncludesTrim(boolean positionIncludesTrim)
public Shells setDontOpen(boolean dontOpen)
public Shells setCloseOnEscape(boolean closeOnEscape)
@Deprecated public void openOnAndBlock(Shell parent)
openOnBlocking(Shell)
- same behavior, but name is consistent with the others.public void openOnBlocking(Shell parent)
public static Shell active()
public Shell openOnActive()
public Shells dontSetPositionOrSize()
public void openOnActiveBlocking()
public Shell openOnDisplay()
public void openOnDisplayBlocking()
public static Disposable confirmClose(Shell shell, String title, String question, Runnable runOnClose)