### Eclipse Workspace Patch 1.0
#P sophie
|
|
|
398 | 398 | protected void setup(JPanel res) { |
399 | 399 | LinksHud hud = findParentElement(LinksHud.class); |
400 | 400 | if (hud == null || hud.currentRule().get() == null |
401 | | || hud.currentRule().get().getAction() == null |
402 | | ) { |
| 401 | || hud.currentRule().get().getAction() == null) { |
| 402 | this.currentPanel = null; |
| 403 | res.removeAll(); |
403 | 404 | return; |
404 | 405 | } |
405 | 406 | |
406 | 407 | LinkAction action = hud.currentRule().get().getAction(); |
407 | | |
| 408 | ActionConfigurationPanel panelToAdd = null; |
408 | 409 | for (ActionConfigurationPanel panel : configPanels().get()) { |
409 | 410 | if (panel.getActionClass() == action.getClass() |
410 | 411 | && panel.swingComponent() != null) { |
… |
… |
|
412 | 413 | if (this.currentPanel == panel) { |
413 | 414 | return; |
414 | 415 | } |
415 | | |
416 | | this.currentPanel = panel; |
417 | | |
418 | | res.removeAll(); |
419 | | res.setBorder(new TitledBorder("Action Settings")); |
420 | | res.add(panel.swingComponent().get()); |
| 416 | |
| 417 | panelToAdd = panel; |
421 | 418 | break; |
422 | 419 | } |
423 | 420 | } |
| 421 | |
| 422 | res.removeAll(); |
| 423 | res.setBorder(new TitledBorder("Action Settings")); |
| 424 | this.currentPanel = panelToAdd; |
| 425 | if (this.currentPanel != null) { |
| 426 | res.add(this.currentPanel.swingComponent().get()); |
| 427 | } |
424 | 428 | } |
425 | 429 | } |
426 | 430 | return getBean().makeProp(swingComponent.class); |