[Ejtools-cvs] applications/jndi.browser/src/main/org/ejtools/jndi/browser/frame ServerInternalFrame.
Brought to you by:
letiemble
From: <let...@us...> - 2003-12-14 08:40:45
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/frame In directory sc8-pr-cvs1:/tmp/cvs-serv20500/jndi.browser/src/main/org/ejtools/jndi/browser/frame Modified Files: ServerInternalFrame.java Log Message: Add more javadocs. Adjust workspace persistence. Index: ServerInternalFrame.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/frame/ServerInternalFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ServerInternalFrame.java 27 Nov 2003 01:30:28 -0000 1.5 --- ServerInternalFrame.java 13 Dec 2003 22:29:07 -0000 1.6 *************** *** 1,162 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.frame; ! ! import java.awt.BorderLayout; ! import java.beans.PropertyChangeEvent; ! import java.util.ResourceBundle; ! ! import javax.swing.JMenuBar; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.BeanContextTreePanel; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.action.RefreshAction; ! import org.ejtools.adwt.service.BeanContextInternalFrame; ! import org.ejtools.adwt.service.MenuBarServiceProvider; ! import org.ejtools.adwt.service.ToolBarServiceProvider; ! import org.ejtools.jndi.browser.action.SelectFactoryAction; ! import org.ejtools.jndi.browser.model.Server; ! import org.ejtools.jndi.browser.model.service.JMSConnectionService; ! import org.ejtools.jndi.browser.model.service.JMSConnectionServiceProvider; ! import org.ejtools.util.service.Profile; ! import org.ejtools.util.service.ProfileHolder; ! ! /** ! * Description of the Class ! * ! * @author <a href="mailto:let...@us...">Laurent Etiemble</a> ! * @version $Revision$ ! * @created 5 septembre 2002 ! */ ! public class ServerInternalFrame extends BeanContextInternalFrame implements ProfileHolder ! { ! /** Description of the Field */ ! protected JMSConnectionServiceProvider connectionProvider; ! /** Description of the Field */ ! protected MenuBarServiceProvider menubarProvider; ! /** Description of the Field */ ! protected Profile profile = null; ! /** Description of the Field */ ! protected Server server = null; ! /** Description of the Field */ ! protected ToolBarServiceProvider toolbarProvider; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ServerInternalFrame.class); ! /** Bundle for I18N */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.jndi.browser.Resources"); ! ! public void setProfile(Profile profile) ! { ! this.profile = profile; ! } ! ! public Profile getProfile() ! { ! return this.profile; ! } ! ! /** ! * Constructor for ServerInternalFrame. ! * ! * @param profile Description of the Parameter ! */ ! public ServerInternalFrame() ! { ! super(); ! } ! ! public void setServer(Server server) ! { ! this.connectionProvider = new JMSConnectionServiceProvider(); ! this.menubarProvider = new MenuBarServiceProvider(); ! this.toolbarProvider = new ToolBarServiceProvider(); ! ! this.server = server; ! this.server.setProfile(profile); ! ! this.add(this.connectionProvider); ! this.add(this.menubarProvider); ! this.add(this.toolbarProvider); ! ! this.add(this.server); ! this.server.addPropertyChangeListener("name", this); ! ! this.add(new RefreshAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ServerInternalFrame.this.server.refresh(); ! } ! })); ! ! this.add(new SelectFactoryAction("action.options.selectQueueFactory", ! new Command() ! { ! public void execute() ! { ! ServerInternalFrame.this.connectionProvider.selectFactory(JMSConnectionService.QUEUE_CONNECTION_FACTORY); ! } ! } ! )); ! ! this.add(new SelectFactoryAction("action.options.selectTopicFactory", ! new Command() ! { ! public void execute() ! { ! ServerInternalFrame.this.connectionProvider.selectFactory(JMSConnectionService.TOPIC_CONNECTION_FACTORY); ! } ! } ! )); ! ! BeanContextTreePanel panel = new BeanContextTreePanel(this.server); ! panel.selectRoot(); ! ! this.frame.setJMenuBar((JMenuBar) this.menubarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.NORTH, this.toolbarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.CENTER, panel); ! } ! ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void propertyChange(PropertyChangeEvent event) ! { ! if (event.getPropertyName().equals("name")) ! { ! String newName = (String) event.getNewValue(); ! this.setTitle(resources.getString("connection.text.prefix") + " : " + newName); ! } ! } ! ! ! /** */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! // Hack to update the window title ! this.server.setName(""); ! this.server.setName(resources.getString("connection.text.untitled")); ! } ! ! ! /** */ ! protected void releaseBeanContextResources() ! { ! logger.debug("In releaseBeanContextResources..."); ! ! this.server.clear(); ! ! super.releaseBeanContextResources(); ! } ! } --- 1,162 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.frame; ! ! import java.awt.BorderLayout; ! import java.beans.PropertyChangeEvent; ! import java.util.ResourceBundle; ! ! import javax.swing.JMenuBar; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.BeanContextTreePanel; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.action.RefreshAction; ! import org.ejtools.adwt.service.BeanContextInternalFrame; ! import org.ejtools.adwt.service.MenuBarServiceProvider; ! import org.ejtools.adwt.service.ToolBarServiceProvider; ! import org.ejtools.jndi.browser.action.SelectFactoryAction; ! import org.ejtools.jndi.browser.model.Server; ! import org.ejtools.jndi.browser.model.service.JMSConnectionService; ! import org.ejtools.jndi.browser.model.service.JMSConnectionServiceProvider; ! import org.ejtools.util.service.Profile; ! import org.ejtools.util.service.ProfileHolder; ! ! /** ! * Description of the Class ! * ! * @author <a href="mailto:let...@us...">Laurent Etiemble</a> ! * @version $Revision$ ! * @created 5 septembre 2002 ! */ ! public class ServerInternalFrame extends BeanContextInternalFrame implements ProfileHolder ! { ! /** Description of the Field */ ! protected JMSConnectionServiceProvider connectionProvider; ! /** Description of the Field */ ! protected MenuBarServiceProvider menubarProvider; ! /** Description of the Field */ ! protected Profile profile = null; ! /** Description of the Field */ ! protected Server server = null; ! /** Description of the Field */ ! protected ToolBarServiceProvider toolbarProvider; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ServerInternalFrame.class); ! /** Bundle for I18N */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.jndi.browser.Resources"); ! ! public void setProfile(Profile profile) ! { ! this.profile = profile; ! } ! ! public Profile getProfile() ! { ! return this.profile; ! } ! ! /** ! * Constructor for ServerInternalFrame. ! * ! * @param profile Description of the Parameter ! */ ! public ServerInternalFrame() ! { ! super(); ! } ! ! public void setServer(Server server) ! { ! this.connectionProvider = new JMSConnectionServiceProvider(); ! this.menubarProvider = new MenuBarServiceProvider(); ! this.toolbarProvider = new ToolBarServiceProvider(); ! ! this.server = server; ! this.server.setProfile(profile); ! ! this.add(this.connectionProvider); ! this.add(this.menubarProvider); ! this.add(this.toolbarProvider); ! ! this.add(this.server); ! this.server.addPropertyChangeListener("name", this); ! ! this.add(new RefreshAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ServerInternalFrame.this.server.refresh(); ! } ! })); ! ! this.add(new SelectFactoryAction("action.options.selectQueueFactory", ! new Command() ! { ! public void execute() ! { ! ServerInternalFrame.this.connectionProvider.selectFactory(JMSConnectionService.QUEUE_CONNECTION_FACTORY); ! } ! } ! )); ! ! this.add(new SelectFactoryAction("action.options.selectTopicFactory", ! new Command() ! { ! public void execute() ! { ! ServerInternalFrame.this.connectionProvider.selectFactory(JMSConnectionService.TOPIC_CONNECTION_FACTORY); ! } ! } ! )); ! ! BeanContextTreePanel panel = new BeanContextTreePanel(this.server); ! panel.selectRoot(); ! ! this.frame.setJMenuBar((JMenuBar) this.menubarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.NORTH, this.toolbarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.CENTER, panel); ! } ! ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void propertyChange(PropertyChangeEvent event) ! { ! if (event.getPropertyName().equals("name")) ! { ! String newName = (String) event.getNewValue(); ! this.setTitle(resources.getString("connection.text.prefix") + " : " + newName); ! } ! } ! ! ! /** */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! // Hack to update the window title ! this.server.setName(""); ! this.server.setName(resources.getString("connection.text.untitled")); ! } ! ! ! /** */ ! protected void releaseBeanContextResources() ! { ! logger.debug("In releaseBeanContextResources..."); ! ! this.server.clear(); ! ! super.releaseBeanContextResources(); ! } ! } |