001 package com.sptci.rwt.webui;
002
003 import com.sptci.echo2.Configuration;
004 import com.sptci.echo2.ErrorPane;
005 import com.sptci.echo2.Listener;
006
007 /**
008 * An abstract {@link nextapp.echo2.app.event.ActionListener} used to
009 * listen to events triggered to open {@link ExecutorView} components.
010 *
011 * <p>© Copyright 2007 <a href='http://sptci.com/' target='_new'>Sans Pareil Technologies, Inc.</a></p>
012 * @author Rakesh Vidyadharan 2007-10-12
013 * @version $Id: ExecutorListener.java 4123 2008-05-25 21:49:01Z rakesh $
014 */
015 public abstract class ExecutorListener extends Listener<MainController>
016 {
017 /**
018 * Create a new instance of the listener using the specified {@link
019 * com.sptci.echo2.Controller} to interact with the application.
020 *
021 * @param controller The controller to use.
022 */
023 public ExecutorListener( MainController controller )
024 {
025 super( controller );
026 }
027
028 /**
029 * Display an error messages notifying user of lack of a {@link
030 * com.sptci.rwt.ConnectionManager} for the session.
031 */
032 protected boolean checkConnection()
033 {
034 boolean result = true;
035
036 if ( controller.getConnectionManager() == null )
037 {
038 ErrorPane pane = new ErrorPane(
039 Configuration.getString( ExecutorListener.class,
040 "noConnectionManager.title" ),
041 Configuration.getString( ExecutorListener.class,
042 "noConnectionManager.message" ) );
043 controller.addPane( pane );
044 result = false;
045 }
046
047 return result;
048 }
049 }