1   /*
2    *  Copyright (c) 1998-2001, The University of Sheffield.
3    *
4    *  This file is part of GATE (see http://gate.ac.uk/), and is free
5    *  software, licenced under the GNU Library General Public License,
6    *  Version 2, June 1991 (in the distribution as file licence.html,
7    *  and also available at http://gate.ac.uk/gate/licence.html).
8    *
9    *  Valentin Tablan 03/10/2001
10   *
11   *  $Id: ResourceParametersEditor.java,v 1.27 2002/03/04 18:32:33 valyt Exp $
12   *
13   */
14  
15  package gate.gui;
16  
17  import java.awt.Frame;
18  import java.awt.BorderLayout;
19  import java.awt.Component;
20  import java.awt.Dimension;
21  import java.awt.Insets;
22  import java.awt.Graphics;
23  import java.awt.event.*;
24  import javax.swing.*;
25  import javax.swing.table.*;
26  import javax.swing.tree.*;
27  import javax.swing.event.*;
28  import javax.swing.border.*;
29  
30  import java.util.*;
31  import java.net.URL;
32  import java.io.IOException;
33  import java.text.*;
34  
35  import gate.*;
36  import gate.util.*;
37  import gate.swing.*;
38  import gate.creole.*;
39  import gate.event.*;
40  
41  /**
42   * Allows the editing of a set of parameters for a resource. It needs a pointer
43   * to the resource and a list of the parameter names for the parameters that
44   * should be displayed. The list of the parameters is actually a list of lists
45   * of strings representing parameter disjunctions.
46   */
47  public class ResourceParametersEditor extends XJTable implements CreoleListener{
48  
49    public ResourceParametersEditor(){
50      initLocalData();
51      initGuiComponents();
52      initListeners();
53    }
54  
55    /**
56     * Initialises this GUI component.
57     * @param resource the resource for which the parameters need to be set.
58     * @param paramaters a list of lists of {@link Parameter} representing
59     * parameter disjunctions.
60     */
61    public void init(Resource resource, List parameters){
62      this.resource = resource;
63      if(parameters != null){
64        parameterDisjunctions = new ArrayList(parameters.size());
65        for(int i = 0; i < parameters.size(); i++){
66          parameterDisjunctions.add(
67                              new ParameterDisjunction(resource,
68                                                       (List)parameters.get(i)));
69        }
70      }else{
71        parameterDisjunctions = null;
72      }
73      tableModel.fireTableDataChanged();
74      adjustSizes();
75    }
76  
77    protected void initLocalData(){
78      resource = null;
79      parameterDisjunctions = null;
80    }// protected void initLocalData()
81  
82    protected void initGuiComponents(){
83      setModel(tableModel = new ParametersTableModel());
84  
85      getColumnModel().getColumn(0).
86                       setCellRenderer(new ParameterDisjunctionRenderer());
87  
88      getColumnModel().getColumn(1).
89                       setCellRenderer(new DefaultTableCellRenderer());
90  
91      getColumnModel().getColumn(2).
92                       setCellRenderer(new BooleanRenderer());
93  
94      getColumnModel().getColumn(3).
95                       setCellRenderer(new ParameterValueRenderer());
96  
97  
98      getColumnModel().getColumn(0).
99                       setCellEditor(new ParameterDisjunctionEditor());
100 
101     getColumnModel().getColumn(3).
102                      setCellEditor(new ParameterValueEditor());
103 
104     setIntercellSpacing(new Dimension(5, 5));
105   }// protected void initGuiComponents()
106 
107 
108   protected void initListeners(){
109     Gate.getCreoleRegister().addCreoleListener(this);
110     addKeyListener(new KeyAdapter() {
111       public void keyTyped(KeyEvent e) {
112         if(e.getKeyCode() == e.VK_ENTER){
113           if(getEditingColumn() == -1 && getEditingRow() == -1){
114             getParent().dispatchEvent(e);
115           }
116         }
117       }
118 
119       public void keyPressed(KeyEvent e) {
120       }
121 
122       public void keyReleased(KeyEvent e) {
123       }
124     });
125   }
126 
127   /**
128    * Cleans the internal data and prepares this object to be collected
129    */
130   public void cleanup(){
131     Gate.getCreoleRegister().removeCreoleListener(this);
132   }
133 
134   /**
135    * Disable key handling for most keys by JTable when not editing.
136    */
137   protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
138                                       int condition, boolean pressed) {
139     int keyCode = e.getKeyCode();
140     if(isEditing() ||
141        keyCode == KeyEvent.VK_UP ||
142        keyCode == KeyEvent.VK_DOWN ||
143        keyCode == KeyEvent.VK_LEFT ||
144        keyCode == KeyEvent.VK_RIGHT ||
145        keyCode == KeyEvent.VK_TAB) return super.processKeyBinding(ks, e,
146                                                                   condition,
147                                                                   pressed);
148     return false;
149   }
150 
151   /**
152    * Should this GUI comonent allow editing?
153    */
154 
155   /**
156    * Sets the parameters for the resource to their new values as resulted
157    * from the user's edits.
158    */
159   public void setParameters() throws ResourceInstantiationException{
160     if(resource == null || parameterDisjunctions == null) return;
161     //stop current edits
162     if(getEditingColumn() != -1 && getEditingRow() != -1){
163       editingStopped(new ChangeEvent(getCellEditor(getEditingRow(),
164                                                    getEditingColumn())));
165     }
166     //set the parameters
167     for(int i = 0; i < parameterDisjunctions.size(); i++){
168       ParameterDisjunction pDisj = (ParameterDisjunction)
169                                    parameterDisjunctions.get(i);
170       resource.setParameterValue(pDisj.getName(), pDisj.getValue());
171     }
172   }
173 
174   /**
175    * Does this GUI component allow editing?
176    */
177 
178   public Resource getResource() {
179     return resource;
180   }
181 
182   /**
183    * Gets the current values for the parameters.
184    * @return a {@link FeatureMap} conatining the curent values for the curently
185    * selected parameters in each disjunction.
186    */
187   public FeatureMap getParameterValues(){
188     //stop current edits
189     if(getEditingColumn() != -1 && getEditingRow() != -1){
190       editingStopped(new ChangeEvent(getCellEditor(getEditingRow(),
191                                                    getEditingColumn())));
192     }
193     //get the parameters
194     FeatureMap values = Factory.newFeatureMap();
195     if(parameterDisjunctions != null){
196       for(int i = 0; i < parameterDisjunctions.size(); i++){
197         ParameterDisjunction pDisj = (ParameterDisjunction)
198                                      parameterDisjunctions.get(i);
199         values.put(pDisj.getName(), pDisj.getValue());
200       }
201     }
202     return values;
203   }
204 
205   public void resourceLoaded(CreoleEvent e) {
206     repaint();
207   }
208   public void resourceUnloaded(CreoleEvent e) {
209     repaint();
210   }
211 
212   public void resourceRenamed(Resource resource, String oldName,
213                               String newName){
214     repaint();
215   }
216   public void datastoreOpened(CreoleEvent e) {
217   }
218   public void datastoreCreated(CreoleEvent e) {
219   }
220   public void datastoreClosed(CreoleEvent e) {
221   }
222   public void setEditable(boolean editable) {
223     this.editable = editable;
224   }
225   public boolean isEditable() {
226     return editable;
227   }
228 
229   ParametersTableModel tableModel;
230   Resource resource;
231 
232 
233 
234   /**
235    * A list of {@link ParameterDisjunction}
236    */
237   protected List parameterDisjunctions;
238   protected boolean editable = true;
239 
240   //inner classes
241   protected class ParametersTableModel extends AbstractTableModel{
242 
243     public int getColumnCount(){return 4;}
244 
245     public Class getColumnClass(int columnIndex){
246       switch(columnIndex){
247         case 0: return ParameterDisjunction.class;
248         case 1: return String.class;
249         case 2: return Boolean.class;
250         case 3: return Object.class;
251         default: return Object.class;
252       }
253     }// public Class getColumnClass(int columnIndex)
254 
255     public String getColumnName(int columnIndex){
256       switch(columnIndex){
257         case 0: return "Name";
258         case 1: return "Type";
259         case 2: return "Required";
260         case 3: return "Value";
261         default: return "?";
262       }
263     }//public String getColumnName(int columnIndex)
264 
265     public boolean isCellEditable(int rowIndex,
266                               int columnIndex) {
267       switch(columnIndex){
268         case 0: return editable &&
269                       ((ParameterDisjunction)
270                         parameterDisjunctions.get(rowIndex)).size() > 1;
271         case 1: return false;
272         case 2: return false;
273         case 3: return editable;
274         default: return false;
275       }
276     }// public boolean isCellEditable
277 
278     public int getRowCount(){
279       return (parameterDisjunctions == null) ? 0 : parameterDisjunctions.size();
280     }
281 
282     public Object getValueAt(int rowIndex,
283                          int columnIndex) {
284       ParameterDisjunction pDisj = (ParameterDisjunction)
285                                    parameterDisjunctions.get(rowIndex);
286       switch(columnIndex){
287         case 0: return pDisj;
288         case 1: return pDisj.getType();
289         case 2: return pDisj.isRequired();
290         case 3: return pDisj.getValue();
291         default: return "?";
292       }
293     }// public Object getValueAt
294 
295     public void setValueAt(Object aValue, int rowIndex, int columnIndex){
296       ParameterDisjunction pDisj = (ParameterDisjunction)
297                                    parameterDisjunctions.get(rowIndex);
298       switch(columnIndex){
299         case 0:{
300           pDisj.setSelectedIndex(((Integer)aValue).intValue());
301           break;
302         }
303         case 1:{
304           break;
305         }
306         case 2:{
307           break;
308         }
309         case 3:{
310           pDisj.setValue(aValue);
311           break;
312         }
313         default:{}
314       }
315     }// public void setValueAt
316   }///class FeaturesTableModel extends DefaultTableModel
317 
318   class ParameterDisjunctionRenderer extends DefaultTableCellRenderer {
319     public ParameterDisjunctionRenderer(){
320       combo = new JComboBox();
321       class CustomRenderer extends JLabel implements ListCellRenderer {
322         public Component getListCellRendererComponent(JList list,
323                                                       Object value,
324                                                       int index,
325                                                       boolean isSelected,
326                                                       boolean cellHasFocus){
327 
328           setText(text);
329           setIcon(MainFrame.getIcon(iconName));
330           return this;
331         }
332       };
333       combo.setRenderer(new CustomRenderer());
334     }
335 
336     public Component getTableCellRendererComponent(JTable table,
337                                                    Object value,
338                                                    boolean isSelected,
339                                                    boolean hasFocus,
340                                                    int row,
341                                                    int column) {
342       ParameterDisjunction pDisj = (ParameterDisjunction)value;
343       text = pDisj.getName();
344       String type = pDisj.getType();
345       iconName = "param.gif";
346       if(Gate.isGateType(type)){
347         ResourceData rData = (ResourceData)Gate.getCreoleRegister().get(type);
348         if(rData != null) iconName = rData.getIcon();
349       }
350       if(pDisj.size() > 1){
351         combo.setModel(new DefaultComboBoxModel(new Object[]{text}));
352         return combo;
353       }
354       //prepare the renderer
355       Component comp = super.getTableCellRendererComponent(table,
356                                                            text,
357                                                            isSelected, hasFocus,
358                                                            row, column);
359       setIcon(MainFrame.getIcon(iconName));
360       return this;
361     }// public Component getTableCellRendererComponent
362 
363     //combobox used for OR parameters
364     JComboBox combo;
365     String iconName;
366     String text;
367   }//class ParameterDisjunctionRenderer
368 
369 
370   /**
371    * A renderer that displays a File Open button next to a text field.
372    * Used for setting URLs from files.
373    */
374   class ParameterValueRenderer extends ObjectRenderer {
375     ParameterValueRenderer() {
376       fileButton = new JButton(MainFrame.getIcon("loadFile.gif"));
377       fileButton.setToolTipText("Set from file...");
378       listButton = new JButton(MainFrame.getIcon("editList.gif"));
379       listButton.setToolTipText("Edit the list");
380       textButtonBox = new JPanel();
381       textButtonBox.setLayout(new BoxLayout(textButtonBox, BoxLayout.X_AXIS));
382       textButtonBox.setOpaque(false);
383 
384       combo = new JComboBox();
385       combo.setRenderer(new ResourceRenderer());
386     }// CustomObjectRenderer()
387 
388     public Component getTableCellRendererComponent(JTable table,
389                                                    Object value,
390                                                    boolean isSelected,
391                                                    boolean hasFocus,
392                                                    int row,
393                                                    int column) {
394 
395       String type = ((ParameterDisjunction)table.getValueAt(row, 0)).getType();
396 
397       if(Gate.isGateType(type)){
398         //Gate type
399         if(ResourceParametersEditor.this.isEditable()){
400           combo.setModel(new DefaultComboBoxModel(new Object[]{value == null ?
401                                                                "<none>" :
402                                                                value }));
403           return combo;
404         }else{
405           //not editable; we'll just use the text field
406           //prepare the renderer
407           String text = value == null ? "<none>" : value.toString();
408           super.getTableCellRendererComponent(table, text, isSelected,
409                                                 hasFocus, row, column);
410           return this;
411         }
412       }else{
413         Class typeClass = null;
414         try{
415           typeClass = Class.forName(type);
416         }catch(ClassNotFoundException cnfe){
417         }
418         //non Gate type -> we'll use the text field
419         String text = (value == null) ?
420                       "                                        " +
421                       "                                        " :
422                       value.toString();
423         //prepare the renderer
424         super.getTableCellRendererComponent(table, text, isSelected,
425                                               hasFocus, row, column);
426 
427         if(type.equals("java.net.URL")){
428           if(ResourceParametersEditor.this.isEditable()){
429             textButtonBox.removeAll();
430             textButtonBox.add(this);
431             this.setMaximumSize(new Dimension(Integer.MAX_VALUE,
432                                               getPreferredSize().height));
433             textButtonBox.add(Box.createHorizontalStrut(5));
434             textButtonBox.add(fileButton);
435             return textButtonBox;
436           }else{
437             return this;
438           }
439         }else if(typeClass != null &&
440                  List.class.isAssignableFrom(typeClass)){
441           //List value
442           setText(textForList((List)value));
443           if(ResourceParametersEditor.this.isEditable()){
444           textButtonBox.removeAll();
445           textButtonBox.add(this);
446           this.setMaximumSize(new Dimension(Integer.MAX_VALUE,
447                                             getPreferredSize().height));
448           textButtonBox.add(Box.createHorizontalStrut(5));
449           textButtonBox.add(listButton);
450           return textButtonBox;
451           }else{
452             return this;
453           }
454         }else return this;
455       }
456     }// public Component getTableCellRendererComponent
457 
458     /**
459      * Gets a string representation for a list value
460      */
461     protected String textForList(List list){
462       if(list == null || list.isEmpty()) return "[]";
463       StringBuffer res = new StringBuffer("[");
464       Iterator elemIter = list.iterator();
465       while(elemIter.hasNext()){
466         Object elem = elemIter.next();
467         res.append( ((elem instanceof NameBearer) ?
468                     ((NameBearer)elem).getName() :
469                     elem.toString()) + ", ");
470       }
471       res.delete(res.length() - 2, res.length() - 1);
472       res.append("]");
473       return res.toString();
474     }
475 
476     JButton fileButton;
477     JButton listButton;
478     JComboBox combo;
479     JPanel textButtonBox;
480   }//class ObjectRenderer extends DefaultTableCellRenderer
481 
482   class ParameterDisjunctionEditor extends DefaultCellEditor{
483     public ParameterDisjunctionEditor(){
484       super(new JComboBox());
485       combo = (JComboBox)super.getComponent();
486       class CustomRenderer extends JLabel implements ListCellRenderer {
487         public CustomRenderer(){
488           setOpaque(true);
489         }
490         public Component getListCellRendererComponent(JList list,
491                                                       Object value,
492                                                       int index,
493                                                       boolean isSelected,
494                                                       boolean cellHasFocus){
495           if (isSelected) {
496               setBackground(list.getSelectionBackground());
497               setForeground(list.getSelectionForeground());
498           }
499           else {
500               setBackground(list.getBackground());
501               setForeground(list.getForeground());
502           }
503 
504           setFont(list.getFont());
505 
506           setText((String)value);
507 
508           String iconName = "param.gif";
509           Parameter[] params = pDisj.getParameters();
510           for(int i = 0; i < params.length; i++){
511             Parameter param = (Parameter)params[i];
512             if(param.getName().equals(value)){
513               String type = param.getTypeName();
514               if(Gate.getCreoleRegister().containsKey(type)){
515                 ResourceData rData = (ResourceData)
516                                      Gate.getCreoleRegister().get(type);
517                 if(rData != null) iconName = rData.getIcon();
518               }
519               break;
520             }//if(params[i].getName().equals(value))
521           }//for(int i = 0; params.length; i++)
522 
523           setIcon(MainFrame.getIcon(iconName));
524           return this;
525         }
526       };//class CustomRenderer extends JLabel implements ListCellRenderer
527       combo.setRenderer(new CustomRenderer());
528       combo.addActionListener(new ActionListener() {
529         public void actionPerformed(ActionEvent e) {
530           stopCellEditing();
531         }
532       });
533     }// public ParameterDisjunctionEditor()
534 
535     public Component getTableCellEditorComponent(JTable table,
536                                              Object value,
537                                              boolean isSelected,
538                                              int row,
539                                              int column){
540      pDisj = (ParameterDisjunction)value;
541      combo.setModel(new DefaultComboBoxModel(pDisj.getNames()));
542      return combo;
543     }// public Component getTableCellEditorComponent
544 
545     public Object getCellEditorValue(){
546       return new Integer(combo.getSelectedIndex());
547     }
548 
549     public boolean stopCellEditing(){
550       combo.hidePopup();
551       return super.stopCellEditing();
552     }
553 
554     JComboBox combo;
555     ParameterDisjunction pDisj;
556   }// class ParameterDisjunctionEditor extends DefaultCellEditor
557 
558   class ParameterValueEditor extends AbstractCellEditor
559                              implements TableCellEditor{
560     ParameterValueEditor(){
561       combo = new JComboBox();
562       combo.setRenderer(new ResourceRenderer());
563       combo.setEditable(false);
564 
565       textField = new JTextField();
566 
567       fileChooser = MainFrame.getFileChooser();
568       fileButton = new JButton(MainFrame.getIcon("loadFile.gif"));
569       fileButton.setToolTipText("Set from file...");
570       fileButton.addActionListener(new ActionListener() {
571         public void actionPerformed(ActionEvent e) {
572           fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
573           fileChooser.setDialogTitle("Select a file");
574           int res = fileChooser.showOpenDialog(ResourceParametersEditor.this);
575           if(res == fileChooser.APPROVE_OPTION){
576             try {
577               textField.setText(fileChooser.getSelectedFile().
578                                 toURL().toExternalForm());
579             } catch(IOException ioe){}
580             fireEditingStopped();
581           }else{
582             fireEditingCanceled();
583           }
584         }
585       });
586 
587       listButton = new JButton(MainFrame.getIcon("editList.gif"));
588       listButton.setToolTipText("Edit the list");
589       listButton.addActionListener(new ActionListener() {
590         public void actionPerformed(ActionEvent e) {
591           List returnedList = listEditor.showDialog();
592           if(returnedList != null){
593             listValue = returnedList;
594             fireEditingStopped();
595           }else{
596             fireEditingCanceled();
597           }
598         }
599       });
600 
601       textButtonBox = new JPanel();
602       textButtonBox.setLayout(new BoxLayout(textButtonBox, BoxLayout.X_AXIS));
603       textButtonBox.setOpaque(false);
604       label = new JLabel(){
605         public boolean isFocusTraversable(){
606           return true;
607         }
608       };
609       label.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
610       label.addMouseListener(new MouseAdapter() {
611         public void mouseClicked(MouseEvent e) {
612           Boolean value = new Boolean(label.getText());
613           value = new Boolean(!value.booleanValue());
614           label.setText(value.toString());
615         }
616       });
617       label.addKeyListener(new KeyAdapter() {
618         public void keyTyped(KeyEvent e) {
619           Boolean value = new Boolean(label.getText());
620           value = new Boolean(!value.booleanValue());
621           label.setText(value.toString());
622         }
623       });
624     }//ParameterValueEditor()
625 
626     public Component getTableCellEditorComponent(JTable table,
627                                                  Object value,
628                                                  boolean isSelected,
629                                                  int row,
630                                                  int column){
631       comboUsed = false;
632       listUsed = false;
633       ParameterDisjunction pDisj = (ParameterDisjunction)
634                                    table.getValueAt(row, 0);
635       type = pDisj.getType();
636 //      ResourceData rData = (ResourceData)Gate.getCreoleRegister().get(type);
637 
638       if(Gate.isGateType(type)){
639         //Gate type
640         comboUsed = true;
641         ArrayList values = new ArrayList();
642         try{
643           values.addAll(Gate.getCreoleRegister().
644                         getAllInstances(type));
645         }catch(GateException ge){
646           ge.printStackTrace(Err.getPrintWriter());
647         }
648         values.add(0, "<none>");
649         combo.setModel(new DefaultComboBoxModel(values.toArray()));
650         combo.setSelectedItem(value == null ? "<none>" : value);
651         return combo;
652       }else{
653         //non Gate type
654         Class typeClass = null;
655         try{
656           typeClass = Class.forName(type);
657         }catch(ClassNotFoundException cnfe){
658         }
659 
660         textField.setText((value == null) ? "" : value.toString());
661         if(type.equals("java.net.URL")){
662           //clean up all filters
663           fileChooser.resetChoosableFileFilters();
664           fileChooser.setAcceptAllFileFilterUsed(true);
665           fileChooser.setFileFilter(fileChooser.getAcceptAllFileFilter());
666           Parameter param = pDisj.getParameter();
667           Set sufixes = param.getSuffixes();
668           if(sufixes != null){
669             ExtensionFileFilter fileFilter = new ExtensionFileFilter();
670             Iterator sufIter = sufixes.iterator();
671             while(sufIter.hasNext()){
672               fileFilter.addExtension((String)sufIter.next());
673             }
674             fileFilter.setDescription("Known file types " + sufixes.toString());
675             fileChooser.addChoosableFileFilter(fileFilter);
676             fileChooser.setFileFilter(fileFilter);
677           }
678 
679           textField.setEditable(true);
680           textButtonBox.removeAll();
681           textButtonBox.add(textField);
682           textButtonBox.add(Box.createHorizontalStrut(5));
683           textButtonBox.add(fileButton);
684           return textButtonBox;
685         }else if(type.equals("java.lang.Boolean")){
686           label.setText(value == null ? "false" : value.toString());
687           return label;
688         }else if(typeClass != null &&
689                       List.class.isAssignableFrom(typeClass)){
690           //List value
691           listUsed = true;
692           Parameter param = pDisj.getParameter();
693           Set sufixes = param.getSuffixes();
694 
695           listValue = (List)value;
696           listEditor = new ListEditorDialog(ResourceParametersEditor.this,
697                                             (List)value,
698                                             param.getItemClassName());
699 
700           textField.setEditable(false);
701           textField.setText(textForList((List)value));
702           textButtonBox.removeAll();
703           textButtonBox.add(textField);
704           textButtonBox.add(Box.createHorizontalStrut(5));
705           textButtonBox.add(listButton);
706           return textButtonBox;
707         }else{
708           textField.setEditable(true);
709           return textField;
710         }
711       }
712     }//getTableCellEditorComponent
713 
714     /**
715      * Gets a string representation for a list value
716      */
717     protected String textForList(List list){
718       if(list == null) return "[]";
719       StringBuffer res = new StringBuffer("[");
720       Iterator elemIter = list.iterator();
721       while(elemIter.hasNext()){
722         Object elem = elemIter.next();
723         res.append( ((elem instanceof NameBearer) ?
724                     ((NameBearer)elem).getName() :
725                     elem.toString()) + ", ");
726       }
727       res.delete(res.length() - 2, res.length() - 1);
728       res.append("]");
729       return res.toString();
730     }
731 
732     public Object getCellEditorValue(){
733       if(comboUsed){
734         Object value = combo.getSelectedItem();
735          return value == "<none>" ? null : value;
736       }
737       else if(listUsed){
738         return listValue;
739       }else{
740         if(type.equals("java.lang.Boolean")){
741           //get the value from the label
742           return new Boolean(label.getText());
743         }else{
744           //get the value from the text field
745           return textField.getText();
746 //          return ((textField.getText().equals("")) ? null :
747 //                                                     textField.getText());
748         }
749       }
750     }//public Object getCellEditorValue()
751 
752     /**
753      * The type of the value currently being edited
754      */
755     String type;
756 
757     /**
758      * Combobox use as editor for Gate objects (chooses between instances)
759      */
760     JComboBox combo;
761 
762     /**
763      * Editor used for boolean values
764      */
765     JLabel label;
766 
767     /**
768      * Generic editor for all types that are not treated special
769      */
770     JTextField textField;
771 
772     /**
773      * A pointer to the filechooser from MainFrame;
774      */
775     JFileChooser fileChooser;
776 
777     ListEditorDialog listEditor = null;
778     List listValue;
779 
780     boolean comboUsed;
781     boolean listUsed;
782     JButton fileButton;
783     JButton listButton;
784     JPanel textButtonBox;
785   }///class ParameterValueEditor
786 
787 
788 
789 }//class NewResourceDialog