public class AbstractWindow extends AbstractFrame implements Window, Component.HasXmlDescriptor, Window.Wrapper, Component.SecuredActionsHolder
Window.BeforeCloseEvent, Window.BeforeCloseWithCloseButtonEvent, Window.BeforeCloseWithCloseButtonListener, Window.BeforeCloseWithShortcutEvent, Window.BeforeCloseWithShortcutListener, Window.CloseListener, Window.CloseWithCommitListener, Window.Committable, Window.ContentSwitchMode, Window.Editor, Window.HasFoldersPane, Window.HasUserIndicator, Window.HasWorkArea, Window.Lookup, Window.MainWindow, Window.TopLevelWindow, Window.Wrapper
Frame.MessageMode, Frame.MessageType, Frame.NotificationType
ExpandingLayout.ExpandDirection
Component.ActionOwner, Component.ActionsHolder, Component.Alignment, Component.BelongToFrame, Component.Buffered, Component.ChildEditableController, Component.Collapsable, Component.Container, Component.Disposable, Component.Editable, Component.EditableChangeEvent, Component.EditableChangeListener, Component.EditableChangeNotifier, Component.ExpandedStateChangeEvent, Component.ExpandedStateChangeListener, Component.Focusable, Component.HasBorder, Component.HasButtonsPanel, Component.HasCaption, Component.HasFormatter, Component.HasIcon, Component.HasInputPrompt, Component.HasNamedComponents, Component.HasPresentations, Component.HasRowsCount, Component.HasSettings, Component.HasValue, Component.HasXmlDescriptor, Component.LayoutClickEvent, Component.LayoutClickListener, Component.LayoutClickNotifier, Component.Margin, Component.MouseEventDetails, Component.OrderedContainer, Component.OuterMargin, Component.SecuredActionsHolder, Component.ShortcutAction, Component.ShortcutNotifier, Component.ShortcutTriggeredEvent, Component.Spacing, Component.UiPermissionAware, Component.Validatable, Component.ValueChangeEvent, Component.ValueChangeListener
BROWSE_WINDOW_SUFFIX, CLOSE_ACTION_ID, COMMIT_ACTION_ID, CREATE_WINDOW_SUFFIX, EDITOR_WINDOW_SUFFIX, LOOKUP_WINDOW_SUFFIX, NAME, SELECT_ACTION_ID
AUTO_SIZE, AUTO_SIZE_PX, UNITS_PERCENTAGE, UNITS_PIXELS
Constructor and Description |
---|
AbstractWindow() |
Modifier and Type | Method and Description |
---|---|
void |
addBeforeCloseWithCloseButtonListener(Window.BeforeCloseWithCloseButtonListener listener)
Register a new before close with close button listener.
|
void |
addBeforeCloseWithShortcutListener(Window.BeforeCloseWithShortcutListener listener)
Register a new before close with shortcut listener.
|
void |
addCloseListener(Window.CloseListener listener)
Add a listener that will be notified when this screen is closed.
|
void |
addCloseWithCommitListener(Window.CloseWithCommitListener listener)
Add a listener that will be notified when this screen is closed with actionId
Window.COMMIT_ACTION_ID . |
void |
addListener(Window.CloseListener listener)
Deprecated.
|
void |
addTimer(Timer timer)
Add a
Timer component to this screen. |
void |
applySettings(Settings settings)
This method is called when the screen is opened to restore settings saved in the database for the current user.
|
boolean |
close(java.lang.String actionId)
Close the screen.
|
boolean |
close(java.lang.String actionId,
boolean force)
Close the screen.
|
void |
closeAndRun(java.lang.String actionId,
java.lang.Runnable runnable)
INTERNAL.
|
void |
deleteSettings()
This method is called by the framework on reset to defaults action
|
ActionsPermissions |
getActionsPermissions() |
java.lang.String |
getCaption() |
Window.ContentSwitchMode |
getContentSwitchMode()
Returns how the managed main TabSheet switches a tab with this window: hides or unloads its content.
|
WindowContext |
getContext() |
java.lang.String |
getDescription()
Screen description is used by the framework to show some specified information, e.g.
|
DialogOptions |
getDialogOptions() |
DsContext |
getDsContext() |
java.lang.String |
getFocusComponent() |
java.lang.String |
getIcon() |
Settings |
getSettings() |
Timer |
getTimer(java.lang.String id)
Returns a
Timer added to this screen. |
WindowManager |
getWindowManager() |
Window |
getWrappedWindow()
INTERNAL.
|
org.dom4j.Element |
getXmlDescriptor() |
boolean |
isAttributeAccessControlEnabled()
Whether automatic applying of attribute access rules enabled.
|
void |
ready()
Hook to be implemented in subclasses.
|
void |
removeBeforeCloseWithCloseButtonListener(Window.BeforeCloseWithCloseButtonListener listener)
Removes a previously registered before close with close button listener.
|
void |
removeBeforeCloseWithShortcutListener(Window.BeforeCloseWithShortcutListener listener)
Removes a previously registered before close with shortcut listener.
|
void |
removeCloseListener(Window.CloseListener listener) |
void |
removeCloseWithCommitListener(Window.CloseWithCommitListener listener) |
void |
removeListener(Window.CloseListener listener)
Deprecated.
|
void |
saveSettings()
This method is called when the screen is closed to save the screen settings to the database.
|
void |
setCaption(java.lang.String caption)
Set the screen caption.
|
void |
setContentSwitchMode(Window.ContentSwitchMode mode)
Sets how the managed main TabSheet switches a tab with this window: hides or unloads its content.
|
void |
setDescription(java.lang.String description)
Screen description is used by the framework to show some specified information, e.g.
|
void |
setDsContext(DsContext dsContext)
INTERNAL.
|
void |
setFocusComponent(java.lang.String componentId)
Set a component to be focused after the screen is opened.
|
void |
setIcon(java.lang.String icon) |
void |
setWindowManager(WindowManager windowManager)
INTERNAL.
|
void |
setXmlDescriptor(org.dom4j.Element element) |
boolean |
validate(java.util.List<Component.Validatable> fields)
Check validity by invoking validators on specified components which support them
and show validation result notification.
|
boolean |
validateAll()
Check validity by invoking validators on all components which support them
and show validation result notification.
|
add, add, addAction, addAction, addStyleName, expand, expand, getAction, getActions, getAlignment, getCompanion, getComponent, getComponent, getComponent, getComponents, getComposition, getDebugId, getDialogParams, getExpandDirection, getFrame, getHeight, getHeightUnits, getId, getMargin, getMessagesPack, getOwnComponent, getOwnComponents, getParent, getRegisteredComponent, getSpacing, getStyleName, getUiEventListeners, getWidth, getWidthUnits, getWrappedFrame, indexOf, init, isEnabled, isEnabledItself, isExpanded, isResponsive, isValid, isVisible, isVisibleItself, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, registerComponent, remove, removeAction, removeAction, removeAll, removeAllActions, removeStyleName, requestFocus, resetExpanded, setAlignment, setCompanion, setContext, setDebugId, setEnabled, setFrame, setHeight, setId, setMargin, setMessagesPack, setParent, setResponsive, setSpacing, setStyleName, setUiEventListeners, setVisible, setWidth, setWrappedFrame, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showValidationErrors, showWebPage, unregisterComponent, unwrap, unwrapComposition, validate
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDialogParams, getMessagesPack, getRegisteredComponent, isValid, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, registerComponent, setContext, setMessagesPack, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage, unregisterComponent, validate
expand, expand, getExpandDirection, isExpanded, resetExpanded
add, getComponent, getComponentNN, indexOf
add, getComponent, getComponentNN, getComponents, getOwnComponent, getOwnComponents, remove, removeAll
addStyleName, getAlignment, getDebugId, getHeight, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthUnits, isEnabled, isEnabledItself, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setDebugId, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition
getFrame, setFrame
getSpacing, setSpacing
getMargin, setMargin, setMargin, setMargin
addAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActions
public org.dom4j.Element getXmlDescriptor()
getXmlDescriptor
in interface Component.HasXmlDescriptor
public void setXmlDescriptor(org.dom4j.Element element)
setXmlDescriptor
in interface Component.HasXmlDescriptor
public WindowContext getContext()
getContext
in interface Frame
getContext
in interface Window
getContext
in class AbstractFrame
public DsContext getDsContext()
getDsContext
in interface Frame
getDsContext
in class AbstractFrame
DsContext
of the current frame or windowpublic void setDsContext(DsContext dsContext)
Frame
setDsContext
in interface Frame
setDsContext
in class AbstractFrame
@Deprecated public void addListener(Window.CloseListener listener)
Window.addCloseListener(CloseListener)
Window
addListener
in interface Window
listener
- listener instance@Deprecated public void removeListener(Window.CloseListener listener)
Window.removeCloseListener(CloseListener)
removeListener
in interface Window
public void addCloseListener(Window.CloseListener listener)
Window
addCloseListener
in interface Window
listener
- listener instancepublic void removeCloseListener(Window.CloseListener listener)
removeCloseListener
in interface Window
public void addCloseWithCommitListener(Window.CloseWithCommitListener listener)
Window
Window.COMMIT_ACTION_ID
.addCloseWithCommitListener
in interface Window
listener
- listener instancepublic void removeCloseWithCommitListener(Window.CloseWithCommitListener listener)
removeCloseWithCommitListener
in interface Window
public java.lang.String getCaption()
getCaption
in interface Component.HasCaption
getCaption
in class AbstractFrame
setCaption(String)
public void setCaption(java.lang.String caption)
AbstractFrame.init(java.util.Map)
, overrides the value from XML.setCaption
in interface Component.HasCaption
setCaption
in class AbstractFrame
caption
- captionpublic java.lang.String getDescription()
getDescription
in interface Component.HasCaption
getDescription
in class AbstractFrame
public void setDescription(java.lang.String description)
setDescription
in interface Component.HasCaption
setDescription
in class AbstractFrame
public Window getWrappedWindow()
getWrappedWindow
in interface Window.Wrapper
public void applySettings(Settings settings)
You can override it to restore custom settings.
For example:
public void applySettings(Settings settings) { super.applySettings(settings); String visible = settings.get(hintBox.getId()).attributeValue("visible"); if (visible != null) hintBox.setVisible(Boolean.valueOf(visible)); }
applySettings
in interface Window
settings
- settings object loaded from the database for the current userpublic void saveSettings()
saveSettings
in interface Window
public void deleteSettings()
Window
deleteSettings
in interface Window
public void setFocusComponent(java.lang.String componentId)
Window
setFocusComponent
in interface Window
componentId
- component's ID in XML. If null, then first focusable component will be focusedpublic java.lang.String getFocusComponent()
getFocusComponent
in interface Window
public Settings getSettings()
getSettings
in interface Window
public void addTimer(Timer timer)
Window
Timer
component to this screen.
ComponentsFactory.createTimer()
method.
public Timer getTimer(java.lang.String id)
Window
Timer
added to this screen.public boolean validate(java.util.List<Component.Validatable> fields)
Frame
public boolean validateAll()
postValidate(ValidationErrors)
hook to
support additional validation.
You should override this method in subclasses ONLY if you want to completely replace the validation process,
otherwise use postValidate(ValidationErrors)
.
validateAll
in interface Frame
validateAll
in interface Window
validateAll
in class AbstractFrame
public WindowManager getWindowManager()
getWindowManager
in interface Window
public void setWindowManager(WindowManager windowManager)
Window
setWindowManager
in interface Window
public DialogOptions getDialogOptions()
getDialogOptions
in interface Window
WindowManager.OpenMode.DIALOG
.public boolean isAttributeAccessControlEnabled()
public void ready()
public boolean close(java.lang.String actionId)
DsContext
,
the confirmation dialog will be shown.
preClose(String)
close
in interface Window
actionId
- action ID that will be propagated to attached CloseListener
s.
Use Window.COMMIT_ACTION_ID
if some changes have just been committed, or
Window.CLOSE_ACTION_ID
otherwise. These constants are recognized by various mechanisms of the
framework.public boolean close(java.lang.String actionId, boolean force)
DsContext
,
and force=false, the confirmation dialog will be shown.
preClose(String)
close
in interface Window
actionId
- action ID that will be propagated to attached CloseListener
s.
Use Window.COMMIT_ACTION_ID
if some changes have just been committed, or
Window.CLOSE_ACTION_ID
otherwise. These constants are recognized by various mechanisms of the
framework.force
- if true, no confirmation dialog will be shown even if the screen has uncommitted changespublic void closeAndRun(java.lang.String actionId, java.lang.Runnable runnable)
closeAndRun
in interface Window
public ActionsPermissions getActionsPermissions()
getActionsPermissions
in interface Component.SecuredActionsHolder
public java.lang.String getIcon()
getIcon
in interface Component.HasIcon
getIcon
in class AbstractFrame
public void setIcon(java.lang.String icon)
setIcon
in interface Component.HasIcon
setIcon
in class AbstractFrame
public Window.ContentSwitchMode getContentSwitchMode()
Window
getContentSwitchMode
in interface Window
Window.ContentSwitchMode
enum valuespublic void setContentSwitchMode(Window.ContentSwitchMode mode)
Window
setContentSwitchMode
in interface Window
mode
- one of the Window.ContentSwitchMode
enum valuespublic void addBeforeCloseWithShortcutListener(Window.BeforeCloseWithShortcutListener listener)
Window
addBeforeCloseWithShortcutListener
in interface Window
listener
- the listener to registerpublic void removeBeforeCloseWithShortcutListener(Window.BeforeCloseWithShortcutListener listener)
Window
removeBeforeCloseWithShortcutListener
in interface Window
listener
- the listener to removepublic void addBeforeCloseWithCloseButtonListener(Window.BeforeCloseWithCloseButtonListener listener)
Window
addBeforeCloseWithCloseButtonListener
in interface Window
listener
- the listener to registerpublic void removeBeforeCloseWithCloseButtonListener(Window.BeforeCloseWithCloseButtonListener listener)
Window
removeBeforeCloseWithCloseButtonListener
in interface Window
listener
- the listener to remove