List of usage examples for com.vaadin.ui Window addActionHandler
@Override public void addActionHandler(Handler actionHandler)
From source file:org.aksw.autosparql.tbsl.gui.vaadin.TBSLApplication.java
License:Apache License
@Override public void init() { // Create the application data instance UserSession sessionData = new UserSession(this); // Register it as a listener in the application context getContext().addTransactionListener(sessionData); setTheme("custom"); ViewHandler.initialize(this); SessionHandler.initialize(this); Permissions.initialize(this, new JPAPermissionManager()); Window mainWindow = new Window("AutoSPARQL TBSL"); mainWindow.addParameterHandler(this); setMainWindow(mainWindow);//from w w w .j a v a 2 s . co m mainView = new MainView(); mainWindow.setContent(mainView); mainWindow.setSizeFull(); setLogoutURL("http://aksw.org"); mainWindow.addActionHandler(new Action.Handler() { @Override public void handleAction(Action action, Object sender, Object target) { if (action == action_query) { onShowLearnedQuery(); } } @Override public Action[] getActions(Object target, Object sender) { return new Action[] { action_query }; } }); }
From source file:org.opencms.ui.components.CmsBasicDialog.java
License:Open Source License
/** * Initializes action handler.<p>//from w w w. j av a 2s .co m * * @param window the parent window */ public void initActionHandler(final Window window) { if (m_actionHandler != null) { window.addActionHandler(m_actionHandler); window.addCloseListener(new CloseListener() { private static final long serialVersionUID = 1L; public void windowClose(CloseEvent e) { clearActionHandler(window); } }); } }