public class GuiUtils extends Object
| Constructor and Description |
|---|
GuiUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDebuggingFocusListener(Component comp) |
static void |
bringToFront(Frame comp) |
static void |
copyToClipboard(String s)
Copies the given string to the system clipboard.
|
static ProgressListener |
getGlobalListener() |
static void |
replaceMetaByCtrl(JMenuBar mb)
Replaces the Meta keymask in all menus of this menu bar
by Ctrl.
|
static void |
setGlobalListener(ProgressListener globalListener)
Sets the global ProgressListener.
|
static void |
showError(Component parent,
String error) |
static void |
showError(Throwable error) |
static <E> E |
withConsoleProgressBar(int width,
PrintStream strm,
ProgressBarWorker<E> worker)
Execute some expensive work and track its progress with a
progress bar on the console.
|
static <E> void |
withProgressBar(Frame parent,
String title,
String description,
ProgressBarWorker<E> worker,
ValueAndTimeConsumer<E> andThen)
Execute this on the EDT.
|
public static void copyToClipboard(String s)
s - public static <E> E withConsoleProgressBar(int width,
PrintStream strm,
ProgressBarWorker<E> worker)
throws Exception
withProgressBar(java.awt.Frame, java.lang.String, java.lang.String, de.up.ling.irtg.util.ProgressBarWorker, de.up.ling.irtg.util.ValueAndTimeConsumer),
the work is performed on the same thread from which the
method is called, because this is the typical usecase in a
console setting.E - width - strm - worker - Exceptionpublic static <E> void withProgressBar(Frame parent, String title, String description, ProgressBarWorker<E> worker, ValueAndTimeConsumer<E> andThen)
E - parent - title - description - worker - andThen - public static void bringToFront(Frame comp)
public static void showError(Throwable error)
public static ProgressListener getGlobalListener()
public static void setGlobalListener(ProgressListener globalListener)
public static void addDebuggingFocusListener(Component comp)
public static void replaceMetaByCtrl(JMenuBar mb)
mb - Copyright © 2017. All rights reserved.