Commit 76c297d803a1689b24b763427dad94d9ae24b894

Authored by Jean-Michel Glorian
1 parent 63c2a59d
Exists in master

Expose the combobox of the Data product field

src/main/java/eu/omp/irap/vespa/epntapclient/gui/requestpanel/paramfield/DataProductTypeField.java
@@ -52,20 +52,30 @@ public class DataProductTypeField extends ParamField { @@ -52,20 +52,30 @@ public class DataProductTypeField extends ParamField {
52 */ 52 */
53 public DataProductTypeField(ViewListener viewListener, String paramName) { 53 public DataProductTypeField(ViewListener viewListener, String paramName) {
54 super(viewListener, paramName); 54 super(viewListener, paramName);
55 - comboBox = new JComboBox<>(DataProductType.values());  
56 - comboBox.setSelectedItem(DataProductType.ALL);  
57 - comboBox.setPreferredSize(  
58 - new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));  
59 -  
60 - comboBox.addActionListener(new ActionListener() {  
61 -  
62 - @Override  
63 - public void actionPerformed(ActionEvent e) {  
64 - update();  
65 - }  
66 - }); 55 + this.add(getComboBox());
  56 + }
67 57
68 - this.add(comboBox); 58 + /**
  59 + * @return
  60 + *
  61 + */
  62 + public JComboBox<DataProductType> getComboBox() {
  63 + if (comboBox == null) {
  64 + comboBox = new JComboBox<>(DataProductType.values());
  65 + comboBox.setSelectedItem(DataProductType.ALL);
  66 + comboBox.setPreferredSize(
  67 + new Dimension(ParamField.MIN_FIELD_WIDTH, ParamField.FIELD_HEIGHT));
  68 +
  69 + comboBox.addActionListener(new ActionListener() {
  70 +
  71 + @Override
  72 + public void actionPerformed(ActionEvent e) {
  73 + update();
  74 + }
  75 + });
  76 + }
  77 +
  78 + return comboBox;
69 } 79 }
70 80
71 /** 81 /**