227 * @param tr - test result
228 * @param currPanel - the panel to not update
229 */
230 private void updateCustomPanels(TestResult tr, TP_Subpanel currPanel) {
231 for (int i = stdPanels.length ; i < panels.length; i++) {
232 TP_CustomSubpanel sp = (TP_CustomSubpanel) panels[i];
233 if (sp != currPanel) {
234 sp.updateSubpanel(tr);
235 }
236 }
237 }
238
239 private void initGUI() {
240 setName("test");
241 descPanel = new TP_DescSubpanel(uif);
242 filesPanel = new TP_FilesSubpanel(uif);
243 resultPanel = new TP_ResultsSubpanel(uif);
244 envPanel = new TP_EnvSubpanel(uif);
245 outputPanel = new TP_OutputSubpanel(uif);
246
247 Vector<TP_Subpanel> vpanels = new Vector();
248 vpanels.add(descPanel);
249
250 FeatureManager fm = contextManager.getFeatureManager();
251 if (fm.isEnabled(fm.SHOW_DOCS_FOR_TEST)) {
252 docPanel = new TP_DocumentationSubpanel(uif);
253 vpanels.add(docPanel);
254 }
255
256 vpanels.add(filesPanel);
257 vpanels.add(resultPanel);
258 vpanels.add(envPanel);
259 vpanels.add(outputPanel);
260
261 stdPanels = new TP_Subpanel[vpanels.size()];
262 stdPanels = vpanels.toArray(stdPanels);
263
264 tabs = uif.createTabbedPane("test", stdPanels);
265
266 panels = stdPanels;
267 if (contextManager != null ) {
268 CustomTestResultViewer[] cv = contextManager.getCustomResultViewers();
269 if (cv != null) {
270 customViewTable = new HashMap();
271 panels = new TP_Subpanel[stdPanels.length + cv.length];
272 System.arraycopy(stdPanels, 0, panels, 0, stdPanels.length);
273 for (int i=0; i < cv.length; i++) {
274 panels[stdPanels.length + i] = new TP_CustomSubpanel(uif, cv[i]);
275 customViewTable.put(cv[i], panels[stdPanels.length + i]);
276 if (cv[i].isViewerVisible()) {
277 tabs.addTab(cv[i].getDescription(), null, cv[i], cv[i].getDescription());
278 }
279 }
280 for (int i=0; i < cv.length; i++) {
281 cv[i].addPropertyChangeListener(CustomTestResultViewer.visibleProperetyName,
282 new ViewerStateListener(cv, i, stdPanels.length));
283 }
284 }
285 }
286
287 tabs.setTabPlacement(SwingConstants.TOP);
288 tabs.setName("testTabs");
289 tabs.setSelectedComponent(outputPanel);
290 tabs.addChangeListener(new ChangeListener() {
353 } else {
354 tabs.remove(cv[pos]);
355 }
356 }
357 }
358
359 static final String lineSeparator = System.getProperty("line.separator");
360
361 // basic GUI objects
362 private UIFactory uif;
363 private TP_Subpanel[] panels;
364 private TP_Subpanel[] stdPanels;
365 private JTabbedPane tabs;
366 private TP_DescSubpanel descPanel;
367 private TP_DocumentationSubpanel docPanel;
368 private TP_FilesSubpanel filesPanel;
369 private TP_ResultsSubpanel resultPanel;
370 private TP_EnvSubpanel envPanel;
371 private TP_OutputSubpanel outputPanel;
372 private JTextField statusField;
373 private HashMap customViewTable;
374
375 //
376 private Harness harness;
377
378 //
379 private ContextManager contextManager;
380
381 // set these values via update
382 private TestResult currTest;
383 private TP_Subpanel currPanel;
384
385 // these values are derived from values given to update
386 private TestDescription currDesc;
387
388 // used to minimize update load
389 private boolean needToUpdateGUIWhenShown = true;
390 private boolean updatePending = false;
391
392 // will be needed for dynamic update
393 private final Observer observer = new Observer();
|
227 * @param tr - test result
228 * @param currPanel - the panel to not update
229 */
230 private void updateCustomPanels(TestResult tr, TP_Subpanel currPanel) {
231 for (int i = stdPanels.length ; i < panels.length; i++) {
232 TP_CustomSubpanel sp = (TP_CustomSubpanel) panels[i];
233 if (sp != currPanel) {
234 sp.updateSubpanel(tr);
235 }
236 }
237 }
238
239 private void initGUI() {
240 setName("test");
241 descPanel = new TP_DescSubpanel(uif);
242 filesPanel = new TP_FilesSubpanel(uif);
243 resultPanel = new TP_ResultsSubpanel(uif);
244 envPanel = new TP_EnvSubpanel(uif);
245 outputPanel = new TP_OutputSubpanel(uif);
246
247 Vector<TP_Subpanel> vpanels = new Vector<>();
248 vpanels.add(descPanel);
249
250 FeatureManager fm = contextManager.getFeatureManager();
251 if (fm.isEnabled(fm.SHOW_DOCS_FOR_TEST)) {
252 docPanel = new TP_DocumentationSubpanel(uif);
253 vpanels.add(docPanel);
254 }
255
256 vpanels.add(filesPanel);
257 vpanels.add(resultPanel);
258 vpanels.add(envPanel);
259 vpanels.add(outputPanel);
260
261 stdPanels = new TP_Subpanel[vpanels.size()];
262 stdPanels = vpanels.toArray(stdPanels);
263
264 tabs = uif.createTabbedPane("test", stdPanels);
265
266 panels = stdPanels;
267 if (contextManager != null ) {
268 CustomTestResultViewer[] cv = contextManager.getCustomResultViewers();
269 if (cv != null) {
270 customViewTable = new HashMap<>();
271 panels = new TP_Subpanel[stdPanels.length + cv.length];
272 System.arraycopy(stdPanels, 0, panels, 0, stdPanels.length);
273 for (int i=0; i < cv.length; i++) {
274 panels[stdPanels.length + i] = new TP_CustomSubpanel(uif, cv[i]);
275 customViewTable.put(cv[i], panels[stdPanels.length + i]);
276 if (cv[i].isViewerVisible()) {
277 tabs.addTab(cv[i].getDescription(), null, cv[i], cv[i].getDescription());
278 }
279 }
280 for (int i=0; i < cv.length; i++) {
281 cv[i].addPropertyChangeListener(CustomTestResultViewer.visibleProperetyName,
282 new ViewerStateListener(cv, i, stdPanels.length));
283 }
284 }
285 }
286
287 tabs.setTabPlacement(SwingConstants.TOP);
288 tabs.setName("testTabs");
289 tabs.setSelectedComponent(outputPanel);
290 tabs.addChangeListener(new ChangeListener() {
353 } else {
354 tabs.remove(cv[pos]);
355 }
356 }
357 }
358
359 static final String lineSeparator = System.getProperty("line.separator");
360
361 // basic GUI objects
362 private UIFactory uif;
363 private TP_Subpanel[] panels;
364 private TP_Subpanel[] stdPanels;
365 private JTabbedPane tabs;
366 private TP_DescSubpanel descPanel;
367 private TP_DocumentationSubpanel docPanel;
368 private TP_FilesSubpanel filesPanel;
369 private TP_ResultsSubpanel resultPanel;
370 private TP_EnvSubpanel envPanel;
371 private TP_OutputSubpanel outputPanel;
372 private JTextField statusField;
373 private HashMap<CustomTestResultViewer, TP_Subpanel> customViewTable;
374
375 //
376 private Harness harness;
377
378 //
379 private ContextManager contextManager;
380
381 // set these values via update
382 private TestResult currTest;
383 private TP_Subpanel currPanel;
384
385 // these values are derived from values given to update
386 private TestDescription currDesc;
387
388 // used to minimize update load
389 private boolean needToUpdateGUIWhenShown = true;
390 private boolean updatePending = false;
391
392 // will be needed for dynamic update
393 private final Observer observer = new Observer();
|