|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractSingleComponentContainer
com.vaadin.ui.Panel
com.vaadin.ui.Window
org.vostok.vaadin.addon.dialog.ActionWindow
public class ActionWindow
ActionWindow - which extend Dialog - is made of two parts, the inner, where you add your content, and the button bar.
It uses a central listener for managing all actions at once (including close/cancel), no need for a listen on each button. To do so, It expects an unique "id" for each button (action).
ActionWindow already provides several modal window for most basic cases. You can alter look and feel with simple css rules. Content is a simple string, with html allowed.
You can still set your own content by passing null value and calling getInnerContent after.
Html structure :
<div class="v-window dialog-window [YOUR CSS CLASS HERE] "> <div> <div> <div class="v-window-contents"> <div> <div> <div class="v-slot-inner"> <div class="inner">WINDOW CONTENT</div> </div> <div class="v-slot-bp-box"> <div class="bp-box">BUTTON CONTAINER</div> </div> </div> </div> </div> </div> </div> </div>See sample at http://vaadin.vostoksystem.eu
Nested Class Summary | |
---|---|
static class |
ActionWindow.Action
declare a new action group. |
static interface |
ActionWindow.DialogClickListener
a clickListener to handle button click events. |
Nested classes/interfaces inherited from class com.vaadin.ui.Window |
---|
com.vaadin.ui.Window.CloseEvent, com.vaadin.ui.Window.CloseListener, com.vaadin.ui.Window.CloseShortcut, com.vaadin.ui.Window.ResizeEvent, com.vaadin.ui.Window.ResizeListener, com.vaadin.ui.Window.WindowModeChangeEvent, com.vaadin.ui.Window.WindowModeChangeListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
com.vaadin.server.Sizeable.Unit |
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents |
---|
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener |
Field Summary | |
---|---|
protected com.vaadin.ui.HorizontalLayout |
bpComponent
|
static int |
CANCEL
|
protected ActionWindow.DialogClickListener |
clickListener
|
static int |
CLOSE
|
protected boolean |
closed
|
protected com.vaadin.ui.CssLayout |
innerComponent
|
protected java.util.List<ActionWindow.Action> |
items
|
static java.lang.String |
MODAL
|
static int |
OK
|
Fields inherited from class com.vaadin.ui.Panel |
---|
actionManager |
Fields inherited from class com.vaadin.ui.AbstractComponent |
---|
DESIGN_ATTR_PLAIN_TEXT |
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
ActionWindow()
|
|
ActionWindow(java.lang.String caption)
create a new window. with empty action box and content |
|
ActionWindow(java.lang.String caption,
ActionWindow.Action[] items)
create an new dialog with enpy content. |
|
ActionWindow(java.lang.String caption,
com.vaadin.ui.Component content)
create a new window. with empty action box |
|
ActionWindow(java.lang.String caption,
com.vaadin.ui.Component content,
ActionWindow.Action[] items)
create a new window. |
Method Summary | |
---|---|
com.vaadin.ui.Button |
addAction(ActionWindow.Action item)
Add a new action at the tail of the buttons bar |
com.vaadin.ui.Button |
addAction(ActionWindow.Action item,
int index)
Add a new action to the button bar at index index |
ActionWindow |
addStyle(java.lang.String name)
a convenience method to allow code like new ActionWindow(...).addstyle(...).show(); sementically identical to super.addStyleName but return "this". method |
static ActionWindow |
createBan(java.lang.String title,
java.lang.String message)
create a modal dialog window for simple denied message, same as message, just css class different, no action needed, just one button (ok) and close on click |
static ActionWindow |
createMessage(java.lang.String title,
java.lang.String message)
create a modal dialog window for simple message, no action needed, just one button (ok) and close on click |
static ActionWindow |
createOkCancel(java.lang.String title,
java.lang.String message,
ActionWindow.DialogClickListener listener)
Create a simple modal Ok - cancel window, with 3 actions : action ActionWindow.OK and ActionWindow.CANCEL and ActionWindow.CLOSE By default, display a message (message). |
static ActionWindow |
createSaveCancel(java.lang.String title,
java.lang.String message,
ActionWindow.DialogClickListener listener)
Same as createOkCancel, but with save/cancel button style |
static ActionWindow |
createWarning(java.lang.String title,
java.lang.String message)
create a modal dialog window for simple warning message, same as message, just css class different, no action needed, just one button (ok) and close on click |
static ActionWindow |
createYesNo(java.lang.String title,
java.lang.String message,
ActionWindow.DialogClickListener listener)
Same as createOkCancel, but with yes/no button style. |
protected void |
doAction(com.vaadin.ui.Component.Event event,
int action)
handle response to button response to a button events. |
ActionWindow.Action |
getAction(int action)
return Action data from action id |
com.vaadin.ui.Button |
getButton(int action)
return Button from action id |
ActionWindow.DialogClickListener |
getDialogClickListener()
return the current button clickListener (default to none : null) |
com.vaadin.ui.AbstractLayout |
getInnerContent()
the inner content, where to add message (Label), etc... current instance is a cssLayout with fullSize |
ActionWindow |
noIcon()
Helper method. |
void |
removeAction(int action)
remove button from button bar |
void |
setDialogClickListener(ActionWindow.DialogClickListener listener)
attach a button clickListener. |
void |
setStyleName(java.lang.String style)
|
void |
show()
show the window on UI if window already on screen does nothing more. |
Methods inherited from class com.vaadin.ui.Window |
---|
addBlurListener, addCloseListener, addCloseShortcut, addFocusListener, addListener, addListener, addListener, addListener, addResizeListener, addWindowModeChangeListener, bringToFront, center, changeVariables, close, fireClose, fireResize, fireWindowWindowModeChange, focus, getAssistiveDescription, getAssistivePostfix, getAssistivePrefix, getAssistiveRole, getCloseShortcuts, getCustomAttributes, getPositionX, getPositionY, getState, getState, getTabStopBottomAssistiveText, getTabStopTopAssistiveText, getWindowMode, hasCloseShortcut, isClosable, isDraggable, isModal, isResizable, isResizeLazy, isTabStopEnabled, paintContent, readDesign, readDesignChildren, removeAllCloseShortcuts, removeBlurListener, removeCloseListener, removeCloseShortcut, removeCloseShortcut, removeFocusListener, removeListener, removeListener, removeListener, removeListener, removeResizeListener, removeWindowModeChangeListener, setAssistiveDescription, setAssistivePostfix, setAssistivePrefix, setAssistiveRole, setClosable, setCloseShortcut, setDraggable, setModal, setParent, setPosition, setPositionX, setPositionY, setResizable, setResizeLazy, setTabStopBottomAssistiveText, setTabStopEnabled, setTabStopTopAssistiveText, setWindowMode, writeDesign |
Methods inherited from class com.vaadin.ui.Panel |
---|
addAction, addActionHandler, addClickListener, addListener, getActionManager, getScrollLeft, getScrollTop, getTabIndex, removeAction, removeActionHandler, removeAllActionHandlers, removeClickListener, removeListener, setCaption, setScrollLeft, setScrollTop, setTabIndex |
Methods inherited from class com.vaadin.ui.AbstractSingleComponentContainer |
---|
addComponentAttachListener, addComponentDetachListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentCount, getContent, iterator, removeComponentAttachListener, removeComponentDetachListener, removeFromParent, setContent, setHeight, setWidth |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthUndefined |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.LegacyComponent |
---|
markAsDirty |
Methods inherited from interface com.vaadin.server.VariableOwner |
---|
isEnabled, isImmediate |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setPrimaryStyleName, setReadOnly, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined |
Field Detail |
---|
public static final java.lang.String MODAL
public static final int OK
public static final int CANCEL
public static final int CLOSE
protected final com.vaadin.ui.CssLayout innerComponent
protected final com.vaadin.ui.HorizontalLayout bpComponent
protected final java.util.List<ActionWindow.Action> items
protected ActionWindow.DialogClickListener clickListener
protected boolean closed
Constructor Detail |
---|
public ActionWindow(java.lang.String caption, com.vaadin.ui.Component content, ActionWindow.Action[] items)
caption
- items
- list of buttoncontent
- content for window ; can be nullpublic ActionWindow(java.lang.String caption, ActionWindow.Action[] items)
caption
- items
- public ActionWindow()
java.lang.UnsupportedOperationException
- ; alwayspublic ActionWindow(java.lang.String caption)
caption
- public ActionWindow(java.lang.String caption, com.vaadin.ui.Component content)
caption
- content
- Method Detail |
---|
public void setStyleName(java.lang.String style)
setStyleName
in interface com.vaadin.ui.Component
setStyleName
in class com.vaadin.ui.AbstractComponent
public void show()
public ActionWindow addStyle(java.lang.String name)
name
-
this
instancepublic ActionWindow.DialogClickListener getDialogClickListener()
public void setDialogClickListener(ActionWindow.DialogClickListener listener)
listener
- public final com.vaadin.ui.AbstractLayout getInnerContent()
public ActionWindow noIcon()
public com.vaadin.ui.Button getButton(int action)
Button
from action id
action
- action
action code for button
Button
or nullpublic ActionWindow.Action getAction(int action)
Action
data from action id
action
- action
action code for button
Action
or nullpublic com.vaadin.ui.Button addAction(ActionWindow.Action item)
item
-
item.getButton(à
public com.vaadin.ui.Button addAction(ActionWindow.Action item, int index)
index
item
- index
- button index.
item.getButton(à
public void removeAction(int action)
action
- action
for button to removeprotected void doAction(com.vaadin.ui.Component.Event event, int action)
event
- action
- public static ActionWindow createOkCancel(java.lang.String title, java.lang.String message, ActionWindow.DialogClickListener listener)
title
- title for the windowmessage
- message to display. To set your own content, set message = null and then access inner content with this.getInnerContent()listener
- clickListener fir action. default(null) just close window
public static ActionWindow createYesNo(java.lang.String title, java.lang.String message, ActionWindow.DialogClickListener listener)
title
- title for the windowmessage
- message to display. To set your own content, set message = null and then access inner content with this.getInnerContent()listener
- clickListener fir action. default(null) just close window
public static ActionWindow createSaveCancel(java.lang.String title, java.lang.String message, ActionWindow.DialogClickListener listener)
title
- title for the windowmessage
- message to display. To set your own content, set message = null and then access inner content with this.getInnerContent()listener
- clickListener fir action. default(null) just close window
public static ActionWindow createMessage(java.lang.String title, java.lang.String message)
title
- title of the dialog boxmessage
- message to display. To set your own content, set message = null and then access inner content with this.getInnerContent()
public static ActionWindow createWarning(java.lang.String title, java.lang.String message)
title
- title of the dialog boxmessage
- message to display. To set your own content, set message = null and then access inner content with this.getInnerContent()
public static ActionWindow createBan(java.lang.String title, java.lang.String message)
title
- title of the dialog boxmessage
- message to display. To set your own content, set message = null and then access inner content with this.getInnerContent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |