Class PrivBotPanel.Builder
java.lang.Object
privbot.ui.PrivBotPanel.Builder
- Enclosing class:
PrivBotPanel
Fluent description of a sidebar;
build() assembles it. Build and use the panel on
the EDT (PluginUi.attach(net.runelite.client.ui.ClientToolbar, java.lang.String, java.util.function.Supplier<privbot.ui.PrivBotPanel>, java.lang.Class<?>, java.lang.String) does this for you).-
Method Summary
Modifier and TypeMethodDescriptionAn extra action button below Settings.build()Creates the panel, polls once, and starts the refresh timer when anything needs polling.refreshEvery(int millis) Refresh interval for pollers and stats; default 1000 ms, minimum 100 ms.A stat row showing the time elapsed sincestartedAt(null start renders "-").The standard Settings button (PrivBotPanel.SETTINGS_LABEL);openStudioruns on the EDT.startStop(Runnable start, Runnable stop, BooleanSupplier running) The Start/Stop button.A stat row whose value is read fromvalueon every refresh (null renders "-").
-
Method Details
-
startStop
The Start/Stop button.runningis polled on every refresh, so the button follows the plugin's real state even when it stops by itself; there is norefresh()to call. All three run on the EDT: keep them quick and never block on the game. -
settings
The standard Settings button (PrivBotPanel.SETTINGS_LABEL);openStudioruns on the EDT. -
action
An extra action button below Settings. -
stat
A stat row whose value is read fromvalueon every refresh (null renders "-"). The supplier runs on the EDT each refresh: return a cached value, never a client read. A supplier that throws renders "-". -
runtime
A stat row showing the time elapsed sincestartedAt(null start renders "-"). -
refreshEvery
Refresh interval for pollers and stats; default 1000 ms, minimum 100 ms. -
build
Creates the panel, polls once, and starts the refresh timer when anything needs polling. Stop the timer on shutdown (PluginUi.detach()does).
-