Thread: [Ejtools-cvs] applications/jmx.browser/src/main/org/ejtools/jmx/browser AboutDialog.java,1.2,1.3 Bro
Brought to you by:
letiemble
|
From: <let...@us...> - 2003-11-27 01:13:40
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser
In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser
Modified Files:
AboutDialog.java Browser.java Main.java
Log Message:
Address Bug #775745
Address Todo #800902
Address Todo #755528
Remove @created tags
Add support for MXJ4 2.0.0 (still beta)
Add support for JXM Remoting through RMI
Index: AboutDialog.java
===================================================================
RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/AboutDialog.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AboutDialog.java 24 Feb 2003 22:02:45 -0000 1.2
--- AboutDialog.java 27 Nov 2003 01:13:06 -0000 1.3
***************
*** 16,19 ****
--- 16,21 ----
import javax.swing.JLabel;
import javax.swing.JPanel;
+ import javax.swing.SwingConstants;
+ import javax.swing.UIManager;
import org.ejtools.adwt.service.AboutService;
***************
*** 74,80 ****
this.panel = new JPanel(new BorderLayout());
- String display = null;
- JLabel label = null;
-
// North part of the panel
this.panel.add("North", new JLabel(new ImageIcon(getClass().getResource("/images/logo.png"))));
--- 76,79 ----
***************
*** 84,104 ****
// South part of the panel
! JPanel info = new JPanel(new GridLayout(2, 1));
JLabel java = new JLabel(
! resources.getString("about.dialog.text.javaVersion")
! + " : "
! + System.getProperty("java.version"), JLabel.CENTER);
java.setForeground(Color.black);
info.add(java);
JLabel vm = new JLabel(
! resources.getString("about.dialog.text.virtualMachine")
! + " : "
! + System.getProperty("java.vm.name")
! + ", "
! + System.getProperty("java.vm.version"), JLabel.CENTER);
vm.setForeground(Color.black);
info.add(vm);
this.panel.add("South", info);
}
}
-
--- 83,111 ----
// South part of the panel
! JPanel info = new JPanel(new GridLayout(3, 1));
!
JLabel java = new JLabel(
! resources.getString("about.dialog.text.javaVersion")
! + " : "
! + System.getProperty("java.version"), SwingConstants.LEADING);
java.setForeground(Color.black);
info.add(java);
+
JLabel vm = new JLabel(
! resources.getString("about.dialog.text.virtualMachine")
! + " : "
! + System.getProperty("java.vm.name")
! + ", "
! + System.getProperty("java.vm.version"), SwingConstants.LEADING);
vm.setForeground(Color.black);
info.add(vm);
+
+ JLabel laf = new JLabel(
+ resources.getString("about.dialog.text.lookAndFeel")
+ + " : "
+ + UIManager.getLookAndFeel().getName(), SwingConstants.LEADING);
+ vm.setForeground(Color.black);
+ info.add(laf);
this.panel.add("South", info);
}
}
Index: Browser.java
===================================================================
RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/Browser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Browser.java 24 Feb 2003 22:02:45 -0000 1.1
--- Browser.java 27 Nov 2003 01:13:06 -0000 1.2
***************
*** 9,24 ****
--- 9,33 ----
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+ import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.ResourceBundle;
+ import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import org.apache.log4j.Logger;
+ import org.ejtools.adwt.FileUtil;
+ import org.ejtools.adwt.LookAndFeelUtil;
import org.ejtools.adwt.action.Command;
import org.ejtools.adwt.action.file.ExitAction;
import org.ejtools.adwt.action.file.NewAction;
+ import org.ejtools.adwt.action.file.OpenWorkspaceAction;
+ import org.ejtools.adwt.action.file.SaveAsWorkspaceAction;
+ import org.ejtools.adwt.action.file.SaveWorkspaceAction;
import org.ejtools.adwt.service.AboutServiceProvider;
import org.ejtools.adwt.service.ConsoleServiceProvider;
+ import org.ejtools.adwt.service.HistoryService;
+ import org.ejtools.adwt.service.HistoryServiceProvider;
import org.ejtools.adwt.service.MDIFrameServiceProvider;
import org.ejtools.adwt.service.MenuBarServiceProvider;
***************
*** 27,31 ****
--- 36,42 ----
import org.ejtools.graph.service.GraphServiceProvider;
import org.ejtools.jmx.browser.frame.ServerInternalFrame;
+ import org.ejtools.jmx.browser.model.Server;
import org.ejtools.jmx.browser.model.service.ConnectionMetaData;
+ import org.ejtools.jmx.browser.state.WorkbenchState;
import org.ejtools.util.service.Profile;
import org.ejtools.util.service.ProfileServiceProvider;
***************
*** 35,59 ****
*
* @author Laurent Etiemble
- * @created 21 mars 2002
* @version $Revision$
* @todo Javadoc to complete
*/
! public class Browser extends CustomBeanContextServicesSupport
{
- /** Description of the Field */
protected AboutServiceProvider aboutService;
- /** Description of the Field */
protected ConsoleServiceProvider consoleService;
- /** Description of the Field */
protected ProfileServiceProvider factoryProvider;
- /** Description of the Field */
protected MDIFrameServiceProvider frameService;
- /** Description of the Field */
protected GraphServiceProvider graphService;
! /** Description of the Field */
protected MenuBarServiceProvider menuBarService;
! /** Description of the Field */
protected ToolBarServiceProvider toolBarService;
! /** Description of the Field */
private static Logger logger = Logger.getLogger(Browser.class);
/** Bundle for I18N */
--- 46,65 ----
*
* @author Laurent Etiemble
* @version $Revision$
+ * @created 21 mars 2002
* @todo Javadoc to complete
*/
! public class Browser extends CustomBeanContextServicesSupport implements HistoryService.Holder
{
protected AboutServiceProvider aboutService;
protected ConsoleServiceProvider consoleService;
protected ProfileServiceProvider factoryProvider;
protected MDIFrameServiceProvider frameService;
protected GraphServiceProvider graphService;
! protected HistoryServiceProvider historyService;
protected MenuBarServiceProvider menuBarService;
! protected WorkbenchState stateManager;
protected ToolBarServiceProvider toolBarService;
! /** Default logger */
private static Logger logger = Logger.getLogger(Browser.class);
/** Bundle for I18N */
***************
*** 61,69 ****
! /** Constructor for the EJX object */
public Browser()
{
logger.debug("JMX Browser starting...");
this.frameService = new MDIFrameServiceProvider();
this.aboutService = new AboutServiceProvider(new AboutDialog());
--- 67,84 ----
! /**Constructor for the Browser object */
public Browser()
{
logger.debug("JMX Browser starting...");
+ // Search for custom Look and Feel
+ LookAndFeelUtil.setLookAndFeel();
+
+ // Set the hyperlink navigation for ObjectName
+ if (System.getProperty("ejtools.objectname.hyperlink") == null)
+ {
+ System.setProperty("ejtools.objectname.hyperlink", "true");
+ }
+
this.frameService = new MDIFrameServiceProvider();
this.aboutService = new AboutServiceProvider(new AboutDialog());
***************
*** 73,76 ****
--- 88,93 ----
this.consoleService = new ConsoleServiceProvider();
this.graphService = new GraphServiceProvider();
+ this.historyService = new HistoryServiceProvider(this, 4);
+ this.stateManager = new WorkbenchState(this);
try
***************
*** 85,103 ****
{
int idx = -1;
! Profile[] datas =
! Browser.this.factoryProvider.getProfiles();
List factories = Arrays.asList(datas);
if (factories.size() > 1)
{
Object selectedValue =
! JOptionPane.showInputDialog(
! null,
! resources.getString("connection.dialog.text.description"),
! resources.getString("connection.dialog.title"),
! JOptionPane.QUESTION_MESSAGE,
! null,
! factories.toArray(),
! factories.get(0)
! );
if (selectedValue == null)
--- 102,119 ----
{
int idx = -1;
! Profile[] datas = Browser.this.factoryProvider.getProfiles();
List factories = Arrays.asList(datas);
if (factories.size() > 1)
{
Object selectedValue =
! JOptionPane.showInputDialog(
! null,
! resources.getString("connection.dialog.text.description"),
! resources.getString("connection.dialog.title"),
! JOptionPane.QUESTION_MESSAGE,
! null,
! factories.toArray(),
! factories.get(0)
! );
if (selectedValue == null)
***************
*** 115,126 ****
if (idx >= 0)
{
! Browser.this.add(
! new ServerInternalFrame(Browser.this.factoryProvider.getProfile(idx))
! );
}
}
}
! ));
this.add(this.consoleService);
--- 131,219 ----
if (idx >= 0)
{
! Profile profile = Browser.this.factoryProvider.getProfile(idx);
! ServerInternalFrame frame = new ServerInternalFrame();
! frame.setProfile(profile);
! frame.setServer(new Server());
! Browser.this.add(frame);
}
}
}
! ));
!
! this.add(this.stateManager);
!
! this.add(new OpenWorkspaceAction(
! new Command()
! {
! public void execute()
! {
! try
! {
! URL selectedURL = FileUtil.selectWorkspaceFile(resources.getString("file.dialog.title.load"), JFileChooser.OPEN_DIALOG);
! if (selectedURL != null)
! {
! loadResource(selectedURL, null);
! }
! }
! catch (Exception e)
! {
! // JOptionPane.showMessageDialog(null, "Could not load file:" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
! logger.error("Error while loading workspace", e);
! }
! }
! }
! ));
!
! this.add(new SaveWorkspaceAction(
! new Command()
! {
! public void execute()
! {
! try
! {
! if (Browser.this.stateManager.getWorkbenchURL() == null)
! {
! URL selectedURL = FileUtil.selectWorkspaceFile(resources.getString("file.dialog.title.save"), JFileChooser.SAVE_DIALOG);
! if (selectedURL != null)
! {
! Browser.this.stateManager.setWorkbenchURL(selectedURL);
! }
! }
! if (Browser.this.stateManager.getWorkbenchURL() != null)
! {
! Browser.this.stateManager.store();
! }
! }
! catch (Exception e)
! {
! logger.error("Error while saving workspace", e);
! }
! }
! }
! ));
+ this.add(new SaveAsWorkspaceAction(
+ new Command()
+ {
+ public void execute()
+ {
+ try
+ {
+ URL selectedURL = FileUtil.selectWorkspaceFile(resources.getString("file.dialog.title.save"), JFileChooser.SAVE_DIALOG);
+ if (selectedURL != null)
+ {
+ Browser.this.stateManager.setWorkbenchURL(selectedURL);
+ Browser.this.stateManager.store();
+ }
+ }
+ catch (Exception e)
+ {
+ logger.error("Error while saving workspace", e);
+ }
+ }
+ }
+ ));
+
+ this.add(this.historyService);
this.add(this.consoleService);
***************
*** 133,140 ****
}
}
! ));
this.add(this.frameService);
this.add(this.aboutService);
this.add(this.graphService);
--- 226,234 ----
}
}
! ));
this.add(this.frameService);
this.add(this.aboutService);
+
this.add(this.graphService);
***************
*** 157,160 ****
--- 251,268 ----
throw e;
}
+ }
+
+
+ /**
+ * Description of the Method
+ *
+ * @param url Description of the Parameter
+ * @param context Description of the Parameter
+ */
+ public void loadResource(URL url, Object context)
+ {
+ this.stateManager.setWorkbenchURL(url);
+ this.stateManager.load();
+ this.historyService.push(url, context);
}
Index: Main.java
===================================================================
RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/Main.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Main.java 24 Feb 2003 22:02:45 -0000 1.2
--- Main.java 27 Nov 2003 01:13:06 -0000 1.3
***************
*** 3,7 ****
*
* Distributable under LGPL license.
! * See terms of license at www.gnu.org.
*/
package org.ejtools.jmx.browser;
--- 3,7 ----
*
* Distributable under LGPL license.
! * See terms at http://opensource.org/licenses/lgpl-license.php
*/
package org.ejtools.jmx.browser;
***************
*** 21,31 ****
* Description of the Class
*
* @author Laurent Etiemble
* @created 21 mars 2002
- * @version $Revision$
- * @todo Javadoc to complete
*/
! public class Main
! {
/** Description of the Field */
private static Logger logger = Logger.getLogger(Main.class);
--- 21,29 ----
* Description of the Class
*
+ * @version $Revision$
* @author Laurent Etiemble
* @created 21 mars 2002
*/
! public class Main {
/** Description of the Field */
private static Logger logger = Logger.getLogger(Main.class);
***************
*** 39,44 ****
*/
public static void main(String[] args)
! throws Exception
! {
logger.debug("========================================");
logger.debug("JAVA_HOME : " + System.getProperty("java.home"));
--- 37,41 ----
*/
public static void main(String[] args)
! throws Exception {
logger.debug("========================================");
logger.debug("JAVA_HOME : " + System.getProperty("java.home"));
***************
*** 60,67 ****
pluginDir = new File("../lib");
plugins = pluginDir.listFiles();
! if (plugins != null)
! {
! for (int i = 0; i < plugins.length; i++)
! {
logger.debug("Found " + plugins[i].toURL());
list.add(plugins[i].toURL());
--- 57,62 ----
pluginDir = new File("../lib");
plugins = pluginDir.listFiles();
! if (plugins != null) {
! for (int i = 0; i < plugins.length; i++) {
logger.debug("Found " + plugins[i].toURL());
list.add(plugins[i].toURL());
***************
*** 73,80 ****
pluginDir = new File("../lib/ext");
plugins = pluginDir.listFiles();
! if (plugins != null)
! {
! for (int i = 0; i < plugins.length; i++)
! {
logger.debug("Found " + plugins[i].toURL());
list.add(plugins[i].toURL());
--- 68,73 ----
pluginDir = new File("../lib/ext");
plugins = pluginDir.listFiles();
! if (plugins != null) {
! for (int i = 0; i < plugins.length; i++) {
logger.debug("Found " + plugins[i].toURL());
list.add(plugins[i].toURL());
***************
*** 91,96 ****
// Custom security manager
System.setSecurityManager(
! new SecurityManager()
! {
public void checkPermission(Permission p) { }
--- 84,88 ----
// Custom security manager
System.setSecurityManager(
! new SecurityManager() {
public void checkPermission(Permission p) { }
***************
*** 102,110 ****
logger.debug("Launching EJTools JMX Browser");
AccessController.doPrivileged(
! new PrivilegedExceptionAction()
! {
public Object run()
! throws Exception
! {
Beans.instantiate(
Thread.currentThread().getContextClassLoader(),
--- 94,100 ----
logger.debug("Launching EJTools JMX Browser");
AccessController.doPrivileged(
! new PrivilegedExceptionAction() {
public Object run()
! throws Exception {
Beans.instantiate(
Thread.currentThread().getContextClassLoader(),
|