public interface UIContext extends AutoCloseable
UIContext
holds information about the environment the UICommand
is being run, such as the initial
selection and attributes that could be shared among several UIWizardStep
of a single UIWizard
instance.Modifier and Type | Method and Description |
---|---|
org.jboss.forge.furnace.spi.ListenerRegistration<CommandExecutionListener> |
addCommandExecutionListener(CommandExecutionListener listener)
Add a
CommandExecutionListener , returning the ListenerRegistration with which it may subsequently
be removed. |
Map<Object,Object> |
getAttributeMap()
Returns a modifiable map for this
UIContext |
<SELECTIONTYPE> |
getInitialSelection()
Get the user's
UISelection at the time this command was initialized/selected. |
Set<CommandExecutionListener> |
getListeners()
Returns the registered
CommandExecutionListener objects for this UIContext . |
UIProvider |
getProvider()
Returns the
UIProvider that created this UIContext object. |
<SELECTIONTYPE> |
getSelection()
Returns the selection set by
setSelection(Object) or setSelection(UISelection)
, or if no selection was set for this interaction, the value of getInitialSelection() . |
<SELECTIONTYPE> |
setSelection(SELECTIONTYPE resource)
Sets a new selection.
|
<SELECTIONTYPE> |
setSelection(UISelection<SELECTIONTYPE> selection)
Sets a new selection.
|
close
<SELECTIONTYPE> UISelection<SELECTIONTYPE> getInitialSelection()
UISelection
at the time this command was initialized/selected. (Never null
.)<SELECTIONTYPE> void setSelection(SELECTIONTYPE resource)
UISelection
- behavior varies
somewhat depending on the UIProvider
implementation.) The user's selection will be not be changed until
after UICommand.execute(UIExecutionContext)
has completed.UISelection
<SELECTIONTYPE> void setSelection(UISelection<SELECTIONTYPE> selection)
UISelection
- behavior varies
somewhat depending on the UIProvider
implementation.) The user's selection will be not be changed until
after UICommand.execute(UIExecutionContext)
has completed.UISelection
<SELECTIONTYPE> UISelection<SELECTIONTYPE> getSelection()
setSelection(Object)
or setSelection(UISelection)
, or if no selection was set for this interaction, the value of getInitialSelection()
.
(***WARNING*** - This is NOT the same as getInitialSelection()
. It will NOT return
the user's initial selection if a new selection has previously been set via setSelection(Object)
or
setSelection(UISelection)
.)UISelection
,
getInitialSelection()
UIProvider getProvider()
org.jboss.forge.furnace.spi.ListenerRegistration<CommandExecutionListener> addCommandExecutionListener(CommandExecutionListener listener)
CommandExecutionListener
, returning the ListenerRegistration
with which it may subsequently
be removed.Set<CommandExecutionListener> getListeners()
Copyright © 2014 JBoss by Red Hat. All rights reserved.