@ProviderType
public interface StageService
Stage. Components
declaring a dependency on it like this will receive their own Stage
instance:
@Reference(scope = ReferenceScope.PROTOTYPE_REQUIRED) private StageService stageService;
While this was the default way to acquire an application's main stage in the
first release of IoCFX, its use is now discouraged, as the
Fxml.Application and Standalone.Application interfaces
provide a much more convenient way to create a main stage.
While developers of multi-window applications may still find this service useful, simply directly constructing new Stage objects may be the more convenient approach.
| Modifier and Type | Interface and Description |
|---|---|
static class |
StageService.ExitPolicy
Enum to determine the behavior of an application when a Stage is closed.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DO_NOTHING_ON_STAGE_EXIT |
static String |
EXIT_POLICY |
| Modifier and Type | Method and Description |
|---|---|
javafx.stage.Stage |
getStage()
Gets the
Stage instance provided by this service. |
void |
setExitPolicy(StageService.ExitPolicy policy,
Class<?>... bundleClasses)
Specifies what should happen when the
Stage provided by this service
is closed. |
static final String EXIT_POLICY
static final String DO_NOTHING_ON_STAGE_EXIT
javafx.stage.Stage getStage()
Stage instance provided by this service.Stage instance provided by this servicevoid setExitPolicy(StageService.ExitPolicy policy, Class<?>... bundleClasses)
Stage provided by this service
is closed. There are three possibilities:
policy - the policy to be applied when the Stage provided by this
service is closedbundleClasses - classes from all bundles that should be stopped when the stage is
closed. Only required for STOP_BUNDLE_ON_STAGE_EXITCopyright © 2019. All rights reserved.