SPT RWT Application API

com.sptci.rwt.webui
Class MainController

java.lang.Object
  extended by com.sptci.echo2.Controller<MainView>
      extended by com.sptci.rwt.webui.MainController
All Implemented Interfaces:
Serializable

public class MainController
extends com.sptci.echo2.Controller<MainView>

The primary ContentPane for the application.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: MainController.java 4123 2008-05-25 21:49:01Z rakesh $
Author:
Rakesh Vidyadharan 2007-09-29
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sptci.echo2.Controller
com.sptci.echo2.Controller.Updater<S>, com.sptci.echo2.Controller.Worker<S>
 
Field Summary
static String CONNECTION_MANAGER
          The property name used to identify the connection manager for the session.
private  Connections connections
          The object that represents saved connections.
static String CONTROLLER
          The property name used to identify the instance of this class stored for the session.
private  Queries queries
          The object that represents saved queries.
 
Fields inherited from class com.sptci.echo2.Controller
application, logger, view
 
Constructor Summary
MainController(MainView view)
          Create a new instance of the controller for the specified view.
 
Method Summary
private  void addBinding(String name, Context environment, Collection<String> collection)
           
 void addPane(FloatingPane pane)
          Convenient method for Application.addPane(nextapp.echo2.app.FloatingPane).
 Collection<Category> getCategories()
          Returns Queries.getCategories().
 ConnectionManager getConnectionManager()
          Get the connection manager in use by the session.
 Connections getConnections()
          Returns connections.
static MainController getController()
          Return the instance stored for the session.
 Collection<String> getDataSources()
          Retrieve all the available datasources configured under the java:/comp/env context.
 DBMSMetaData getDBMSMetaData()
          Retrieve the metadata about the database pointed to by the current active ConnectionManager.
 ConnectionParameters getParameters(ConnectionDialogue dialogue)
          Create a connection parameters bean using the values in the ConnectionDialogue.
 com.sptci.echo2.View getParentView(Component component)
          Convenience method that invokes Application.getParentView(nextapp.echo2.app.Component)
 Queries getQueries()
          Returns queries.
 Map<String,Collection<String>> getSavedConnections()
          Retrieve all the saved database connections configured by the user.
 void resetMenu()
          Rebuild the MainView.menuComponent to reflect modifications made to the application persistent state.
 void setConnectionManager(ConnectionManager manager)
          Set the connection manager to use for the session.
 void setContent(Component component)
          Method used to update the content of MainView.right content area.
 void setFocused(Component component)
          Sets the focussed component for the application.
 
Methods inherited from class com.sptci.echo2.Controller
checkText, getApplication, getDataDirectory, getLogger, getView, processFatalException, processFatalException, setApplication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTION_MANAGER

public static final String CONNECTION_MANAGER
The property name used to identify the connection manager for the session. "connectionManager"

See Also:
Constant Field Values

CONTROLLER

public static final String CONTROLLER
The property name used to identify the instance of this class stored for the session. "controller"

See Also:
Constant Field Values

connections

private Connections connections
The object that represents saved connections.


queries

private Queries queries
The object that represents saved queries.

Constructor Detail

MainController

public MainController(MainView view)
Create a new instance of the controller for the specified view.

Parameters:
view - The view this controller controls.
Method Detail

getController

public static MainController getController()
Return the instance stored for the session.

Note: This method should be invoked only after being instantiated.

Returns:
The controller for the session.

getConnectionManager

public ConnectionManager getConnectionManager()
Get the connection manager in use by the session.

Returns:
The manager in use.

setConnectionManager

public void setConnectionManager(ConnectionManager manager)
Set the connection manager to use for the session.

Parameters:
manager - The manager to use.

getDataSources

public Collection<String> getDataSources()
Retrieve all the available datasources configured under the java:/comp/env context.

Returns:
The collection of configured datasource names.

addBinding

private void addBinding(String name,
                        Context environment,
                        Collection<String> collection)
                 throws NamingException
Throws:
NamingException

getSavedConnections

public Map<String,Collection<String>> getSavedConnections()
Retrieve all the saved database connections configured by the user.

Returns:
A Map containing the database name as the key and a Collection of saved connection names as the value.

getParameters

public ConnectionParameters getParameters(ConnectionDialogue dialogue)
Create a connection parameters bean using the values in the ConnectionDialogue.

Returns:
The new connection parameters bean.

getDBMSMetaData

public DBMSMetaData getDBMSMetaData()
Retrieve the metadata about the database pointed to by the current active ConnectionManager.

Returns:
The meta data value object for the database. Returns null if no active connection manager exists for the application.

setContent

public void setContent(Component component)
Method used to update the content of MainView.right content area.

Parameters:
component - The component that is to be displayed.

addPane

public void addPane(FloatingPane pane)
Convenient method for Application.addPane(nextapp.echo2.app.FloatingPane).

Overrides:
addPane in class com.sptci.echo2.Controller<MainView>

getConnections

public Connections getConnections()
Returns connections.

Returns:
The value/reference of/to connections.

getQueries

public Queries getQueries()
Returns queries.

Returns:
The value/reference of/to queries.

getCategories

public Collection<Category> getCategories()
Returns Queries.getCategories().

Returns:
The value/reference of/to queries.

resetMenu

public void resetMenu()
Rebuild the MainView.menuComponent to reflect modifications made to the application persistent state. Persistent state is modified when new connections/queries are added to the persistent state.


getParentView

public com.sptci.echo2.View getParentView(Component component)
Convenience method that invokes Application.getParentView(nextapp.echo2.app.Component)

Returns:
The parent view of the specified component.

setFocused

public void setFocused(Component component)
Sets the focussed component for the application.

Parameters:
component - The component that is to gain the focus.
See Also:
ApplicationInstance.setFocusedComponent(nextapp.echo2.app.Component)

SPT RWT Application API