Commit 8077947bb2db87c78590e55d8d35a6110af32eae
1 parent
8b66e087
Exists in
master
Add a buttons panel and expose it in order to change buttons in the UI.
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/gui/resultpanel/ResultPanelView.java
... | ... | @@ -44,6 +44,9 @@ public class ResultPanelView extends VOTableView { |
44 | 44 | /** The listener of the result panel. */ |
45 | 45 | ResultPanelListener listener; |
46 | 46 | |
47 | + /** The JPanel containing the buttons. */ | |
48 | + private JPanel buttonsPanel; | |
49 | + | |
47 | 50 | |
48 | 51 | /** |
49 | 52 | * Method constructor which customize the result panel, but don't build it from scratch since |
... | ... | @@ -64,7 +67,7 @@ public class ResultPanelView extends VOTableView { |
64 | 67 | JPanel bottomBar = new JPanel(); |
65 | 68 | bottomBar.setLayout(new BorderLayout()); |
66 | 69 | bottomBar.add(getStatusBar(), BorderLayout.CENTER); |
67 | - bottomBar.add(getFileButton(), BorderLayout.EAST); | |
70 | + bottomBar.add(getButtonsPanel(), BorderLayout.EAST); | |
68 | 71 | |
69 | 72 | add(bottomBar, BorderLayout.SOUTH); |
70 | 73 | } |
... | ... | @@ -109,4 +112,16 @@ public class ResultPanelView extends VOTableView { |
109 | 112 | getStatusBar().setText(infoText); |
110 | 113 | } |
111 | 114 | |
115 | + /** | |
116 | + * Create if necessary the buttons panel, then return it. | |
117 | + * | |
118 | + * @return the buttons panel. | |
119 | + */ | |
120 | + public JPanel getButtonsPanel() { | |
121 | + if (buttonsPanel == null) { | |
122 | + buttonsPanel = new JPanel(); | |
123 | + buttonsPanel.add(getFileButton()); | |
124 | + } | |
125 | + return buttonsPanel; | |
126 | + } | |
112 | 127 | } | ... | ... |