Interface DesignerRoot
-
- All Known Implementing Classes:
DesignerRootImpl
public interface DesignerRoot
Provides access to the globals of the app.- Author:
- Clément Fournier
-
-
Field Summary
Fields Modifier and Type Field Description static AppServiceDescriptor<org.reactfx.value.Val<net.sourceforge.pmd.lang.Language>>
APP_GLOBAL_LANGUAGE
static AppServiceDescriptor<ASTManager>
AST_MANAGER
AST manager of the current code.static AppServiceDescriptor<GlobalDiskManager>
DISK_MANAGER
static AppServiceDescriptor<javafx.application.HostServices>
HOST_SERVICES
JavaFX host services.static AppServiceDescriptor<org.reactfx.value.Var<java.lang.Boolean>>
IS_NODE_BEING_DRAGGED
static AppServiceDescriptor<MessageChannel<VersionedXPathQuery>>
LATEST_XPATH
static AppServiceDescriptor<EventLogger>
LOGGER
Logger of the app.static AppServiceDescriptor<MessageChannel<NodeSelectionSource.NodeSelectionEvent>>
NODE_SELECTION_CHANNEL
Channel used to transmit node selection events to all interested components.static AppServiceDescriptor<PersistenceManager>
PERSISTENCE_MANAGER
Manages settings persistence.static AppServiceDescriptor<RichTextMapper>
RICH_TEXT_MAPPER
Maps a node to its rich text representation.static AppServiceDescriptor<TestCreatorService>
TEST_CREATOR
Requests to create a test case for the currently open rule.static AppServiceDescriptor<MessageChannel<@Nullable LiveTestCase>>
TEST_LOADER
Requests to load a test case in the editor.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description javafx.stage.Stage
getMainStage()
Gets the main stage of the application.<T> T
getService(AppServiceDescriptor<T> descriptor)
Gets the instance of a service shared by the app.org.reactfx.value.Val<java.lang.Boolean>
isCtrlDownProperty()
Returns true if the ctrl key is being pressed.boolean
isDeveloperMode()
If true, some more events are pushed to the event log, and console streams are open.<T> void
registerService(AppServiceDescriptor<T> descriptor, T component)
Register a service for the given descriptor.void
shutdownServices()
Shutdown all registered service components that implementCloseableService
.default DesignerRoot
spawnScope()
Returns a new designer root that can delegates to this one, can register services independently to override them.
-
-
-
Field Detail
-
HOST_SERVICES
static final AppServiceDescriptor<javafx.application.HostServices> HOST_SERVICES
JavaFX host services.
-
PERSISTENCE_MANAGER
static final AppServiceDescriptor<PersistenceManager> PERSISTENCE_MANAGER
Manages settings persistence.
-
LOGGER
static final AppServiceDescriptor<EventLogger> LOGGER
Logger of the app.
-
DISK_MANAGER
static final AppServiceDescriptor<GlobalDiskManager> DISK_MANAGER
-
RICH_TEXT_MAPPER
static final AppServiceDescriptor<RichTextMapper> RICH_TEXT_MAPPER
Maps a node to its rich text representation.
-
NODE_SELECTION_CHANNEL
static final AppServiceDescriptor<MessageChannel<NodeSelectionSource.NodeSelectionEvent>> NODE_SELECTION_CHANNEL
Channel used to transmit node selection events to all interested components.
-
AST_MANAGER
static final AppServiceDescriptor<ASTManager> AST_MANAGER
AST manager of the current code.
-
TEST_LOADER
static final AppServiceDescriptor<MessageChannel<@Nullable LiveTestCase>> TEST_LOADER
Requests to load a test case in the editor.
-
APP_GLOBAL_LANGUAGE
static final AppServiceDescriptor<org.reactfx.value.Val<net.sourceforge.pmd.lang.Language>> APP_GLOBAL_LANGUAGE
-
TEST_CREATOR
static final AppServiceDescriptor<TestCreatorService> TEST_CREATOR
Requests to create a test case for the currently open rule. The test case should be deep copied first *by the sender*.
-
LATEST_XPATH
static final AppServiceDescriptor<MessageChannel<VersionedXPathQuery>> LATEST_XPATH
-
IS_NODE_BEING_DRAGGED
static final AppServiceDescriptor<org.reactfx.value.Var<java.lang.Boolean>> IS_NODE_BEING_DRAGGED
-
-
Method Detail
-
getService
<T> T getService(AppServiceDescriptor<T> descriptor)
Gets the instance of a service shared by the app.- Parameters:
descriptor
- Service descriptor
-
registerService
<T> void registerService(AppServiceDescriptor<T> descriptor, T component)
Register a service for the given descriptor.- Throws:
java.lang.IllegalStateException
- if the service was already registered to some other component
-
getMainStage
javafx.stage.Stage getMainStage()
Gets the main stage of the application.- Returns:
- The main stage
-
isDeveloperMode
boolean isDeveloperMode()
If true, some more events are pushed to the event log, and console streams are open. This is enabled by the -v or --verbose option on command line for now.
-
isCtrlDownProperty
org.reactfx.value.Val<java.lang.Boolean> isCtrlDownProperty()
Returns true if the ctrl key is being pressed. Vetoed by any other key press.
-
shutdownServices
void shutdownServices()
Shutdown all registered service components that implementCloseableService
. Called when the app exits.
-
spawnScope
default DesignerRoot spawnScope()
Returns a new designer root that can delegates to this one, can register services independently to override them.
-
-