summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/MainProxy.java
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2013-08-29 22:39:04 +0200
committerJose <jose@zeroc.com>2013-08-29 22:39:04 +0200
commit553a111bdcae53ef9dfe4b7953c4a2b19063629c (patch)
tree499ce5b4fbc40ccebbcc7f9e9eca69187d372e0d /java/src/IceGridGUI/MainProxy.java
parentImprovements to Metrics Table Layout - related to ICE-5408 (diff)
downloadice-553a111bdcae53ef9dfe4b7953c4a2b19063629c.tar.bz2
ice-553a111bdcae53ef9dfe4b7953c4a2b19063629c.tar.xz
ice-553a111bdcae53ef9dfe4b7953c4a2b19063629c.zip
Improvements to IceGridGUI javafx fallback mechanism
Diffstat (limited to 'java/src/IceGridGUI/MainProxy.java')
-rw-r--r--java/src/IceGridGUI/MainProxy.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/java/src/IceGridGUI/MainProxy.java b/java/src/IceGridGUI/MainProxy.java
new file mode 100644
index 00000000000..8b572633a00
--- /dev/null
+++ b/java/src/IceGridGUI/MainProxy.java
@@ -0,0 +1,65 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+package IceGridGUI;
+
+import javax.swing.JOptionPane;
+
+public class MainProxy
+{
+ public static void main(final String[] args)
+ {
+ //
+ // Save main arguments for later usage.
+ //
+ _args = java.util.Arrays.copyOf(args, args.length);
+
+ Class<?> cls = IceInternal.Util.findClass("com.javafx.main.Main", null);
+ if(cls == null)
+ {
+ JOptionPane.showMessageDialog(null,
+ "Unable to find class `com.javafx.main.Main'",
+ "IceGrid Admin Error",
+ JOptionPane.ERROR_MESSAGE);
+ return;
+ }
+
+ try
+ {
+ java.lang.reflect.Method main = cls.getMethod("main", new Class[]{String[].class});
+ main.invoke(null, new Object[]{args});
+ }
+ catch(NoSuchMethodException ex)
+ {
+ ex.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ "Unable to find method `main(String[] args)' in class `com.javafx.main.Main'",
+ "IceGrid Admin Error",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ catch(IllegalAccessException ex)
+ {
+ ex.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ "IllegalAccessException invoking method `main(String[] args)' in class `com.javafx.main.Main'",
+ "IceGrid Admin Error",
+ JOptionPane.ERROR_MESSAGE);
+ }
+ catch(java.lang.reflect.InvocationTargetException ex)
+ {
+ }
+ }
+
+ public static String[] args()
+ {
+ return _args;
+ }
+
+ private static String[] _args;
+} \ No newline at end of file