1 | JMeterGUIComponent comp;↵ | | 1 | JMeterGUIComponent comp;↵
|
2 | Class c;↵ | | 2 | Class c;↵
|
3 | try {↵ | | 3 | try {↵
|
4 | c = Class.forName(objClass);↵ | | 4 | c = Class.forName(objClass);↵
|
5 | if (TestBean.class.isAssignableFrom(c)) {↵ | | 5 | if (TestBean.class.isAssignableFrom(c)) {↵
|
6 | comp = getGuiFromCache(TestBeanGUI.class, c);↵ | | 6 | comp = getGuiFromCache(TestBeanGUI.class, c);↵
|
7 | } else {↵ | | 7 | } else {↵
|
8 | comp = getGuiFromCache(c, null);↵ | | 8 | comp = getGuiFromCache(c, null);↵
|
9 | }↵ | | 9 | }↵
|
10 | comp.clearGui();↵ | | 10 | comp.clearGui();↵
|
11 | TestElement node = comp.createTestElement();↵ | | 11 | TestElement node = comp.createTestElement();↵
|
12 | nodesToGui.put(node, comp);↵ | | 12 | nodesToGui.put(node, comp);↵
|
13 | return node;↵ | | 13 | return node;↵
|
14 | } catch (NoClassDefFoundError e) {↵ | | 14 | } catch (NoClassDefFoundError e) {↵
|
15 | log.error("Problem retrieving gui for " + objClass, e);↵ | | 15 | log.error("Problem retrieving gui for " + objClass, e);↵
|
16 | String msg="Cannot find class: "+e.getMessage();↵ | | |
|
17 | JOptionPane.showMessageDialog(null,↵ | | |
|
18 | msg,↵ | | |
|
19 | "Missing jar? See log file." , ↵ | | |
|
20 | JOptionPane.ERROR_MESSAGE);↵ | | |
|
21 | throw new RuntimeException(e.toString()); // Probably a missing↵ | | 16 | throw new RuntimeException(e.toString()); // Probably a missing↵
|
22 | // jar↵ | | 17 | // jar↵
|
23 | } catch (ClassNotFoundException e) {↵ | | 18 | } catch (ClassNotFoundException e) {↵
|
24 | log.error("Problem retrieving gui for " + objClass, e);↵ | | 19 | log.error("Problem retrieving gui for " + objClass, e);↵
|
25 | throw new RuntimeException(e.toString()); // Programming error:↵ | | 20 | throw new RuntimeException(e.toString()); // Programming error:↵
|
26 | // bail out.↵ | | 21 | // bail out.↵
|
27 | } catch (InstantiationException e) {↵ | | 22 | } catch (InstantiationException e) {↵
|
28 | log.error("Problem retrieving gui for " + objClass, e);↵ | | 23 | log.error("Problem retrieving gui for " + objClass, e);↵
|
29 | throw new RuntimeException(e.toString()); // Programming error:↵ | | 24 | throw new RuntimeException(e.toString()); // Programming error:↵
|
30 | // bail out.↵ | | 25 | // bail out.↵
|
31 | } catch (IllegalAccessException e) {↵ | | 26 | } catch (IllegalAccessException e) {↵
|
32 | log.error("Problem retrieving gui for " + objClass, e);↵ | | 27 | log.error("Problem retrieving gui for " + objClass, e);↵
|
33 | throw new RuntimeException(e.toString()); // Programming error:↵ | | 28 | throw new RuntimeException(e.toString()); // Programming error:↵
|
34 | // bail out.↵ | | 29 | // bail out.↵
|
35 | } | | 30 | }
|