Ignore:
Timestamp:
2003-07-15T13:55:22+12:00 (21 years ago)
Author:
jmt12
Message:

Major CDM rewrite so it uses DOM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/IndexManager.java

    r4675 r4932  
    66 * University of Waikato, New Zealand.
    77 *
    8  * <BR><BR>
    9  *
    108 * Author: John Thompson, Greenstone Digital Library, University of Waikato
    119 *
    12  * <BR><BR>
    13  *
    1410 * Copyright (C) 1999 New Zealand Digital Library Project
    15  *
    16  * <BR><BR>
    1711 *
    1812 * This program is free software; you can redistribute it and/or modify
     
    2115 * (at your option) any later version.
    2216 *
    23  * <BR><BR>
    24  *
    2517 * This program is distributed in the hope that it will be useful,
    2618 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2719 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2820 * GNU General Public License for more details.
    29  *
    30  * <BR><BR>
    3121 *
    3222 * You should have received a copy of the GNU General Public License
     
    3525 *########################################################################
    3626 */
    37 
    38  
    39 
    40 
    41 
    42 
    4327package org.greenstone.gatherer.cdm;
    44 /**************************************************************************************
    45  * Title:        Gatherer
    46  * Description:  The Gatherer: a tool for gathering and enriching a digital collection.
    47  * Copyright:    Copyright (c) 2001
    48  * Company:      The University of Waikato
    49  * Written:      03/05/02
    50  * Revised:      17/11/02 - Commented
    51  **************************************************************************************/
    52 import java.awt.BorderLayout;
    53 import java.awt.Color;
    54 import java.awt.Component;
    55 import java.awt.Dimension;
    56 import java.awt.GridLayout;
    57 import java.awt.event.ActionEvent;
    58 import java.awt.event.ActionListener;
    59 import java.awt.event.KeyAdapter;
    60 import java.awt.event.KeyEvent;
    61 import java.util.Collections;
    62 import java.util.StringTokenizer;
    63 import java.util.Vector;
    64 import javax.swing.BorderFactory;
    65 import javax.swing.DefaultListCellRenderer;
    66 import javax.swing.DefaultListModel;
    67 import javax.swing.JButton;
    68 import javax.swing.JComboBox;
    69 import javax.swing.JLabel;
    70 import javax.swing.JList;
    71 import javax.swing.JOptionPane;
    72 import javax.swing.JPanel;
    73 import javax.swing.JScrollPane;
    74 import javax.swing.JTextArea;
    75 import javax.swing.JTextField;
    76 import javax.swing.event.ListDataEvent;
    77 import javax.swing.event.ListDataListener;
    78 import javax.swing.event.ListSelectionEvent;
    79 import javax.swing.event.ListSelectionListener;
     28import java.awt.*;
     29import java.awt.event.*;
     30import java.util.*;
     31import javax.swing.*;
     32import javax.swing.event.*;
    8033import org.greenstone.gatherer.Gatherer;
     34import org.greenstone.gatherer.cdm.CollectionMeta;
    8135import org.greenstone.gatherer.cdm.CommandTokenizer;
     36import org.greenstone.gatherer.cdm.Control;
     37import org.greenstone.gatherer.cdm.DOMProxyListModel;
    8238import org.greenstone.gatherer.cdm.Index;
    8339import org.greenstone.gatherer.msm.ElementWrapper;
    8440import org.greenstone.gatherer.msm.MSMUtils;
    8541import org.greenstone.gatherer.util.ExclusiveListSelectionListener;
    86 import org.w3c.dom.Element;
     42import org.greenstone.gatherer.util.StaticStrings;
     43import org.w3c.dom.*;
    8744/** This class is resposible for storing the indexes which have been assigned to this collection and the default index, and providing methods for interacting with both these data pools. It also knows how to turn itself into a String as it would be displayed in the collection configuration file.
    8845 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    9047 */
    9148public class IndexManager
    92     extends DefaultListModel {
    93     /** A reference to our creator, the collection design manager. */
    94     private CollectionDesignManager manager = null;
     49    extends DOMProxyListModel {
    9550    /** The controls for editing the indexes. */
    9651    private Control controls = null;
    9752    /** A reference to ourselves so our inner methods have access. */
    98     private DefaultListModel model = null;
    99     /** A reference to the Gatherer, for access to the Dictionary and messaging purposes. */
    100     private Gatherer gatherer = null;
     53    private DOMProxyListModel model = null;
    10154    /** The default index. */
    10255    private Index default_index = null;
    103     /** Constructor.
    104      * @param gatherer A reference to the <strong>Gatherer</strong>.
    105      * @param manager A reference to the <strong>CollectionDesignManager</strong>.
    106      */
    107     public IndexManager(Gatherer gatherer, CollectionDesignManager manager) {
    108     super();
    109     this.gatherer = gatherer;
    110     this.manager = manager;
    111     this.model = this;
     56    /** Constructor. */
     57    public IndexManager(Element indexes) {
     58    super(indexes, CollectionConfiguration.INDEX_ELEMENT, new Index());
     59    Gatherer.println("IndexManager: " + getSize() + " indexes parsed.");
     60    model = this;
     61    // Parse and retrieve the default index
     62    NodeList default_index_elements = CollectionDesignManager.collect_config.getDocumentElement().getElementsByTagName(CollectionConfiguration.INDEX_DEFAULT_ELEMENT);
     63    if(default_index_elements.getLength() > 0) {
     64        default_index = new Index((Element)default_index_elements.item(0));
     65    }
    11266    }
    11367    /** Method to add a new index.
    114       * @param index The <strong>Index</strong> to add.
    115       * @see org.greenstone.gatherer.Gatherer
    116       * @see org.greenstone.gatherer.collection.CollectionManager
    117       */
    118     public void addIndex(Index index) {
     68     * @param index The <strong>Index</strong> to add.
     69     * @see org.greenstone.gatherer.Gatherer
     70     * @see org.greenstone.gatherer.collection.CollectionManager
     71     */
     72    public void addIndex(Index index, CollectionMeta metadatum) {
     73    ///ystem.err.println("Adding an index: " + index.toString());
    11974    if(!contains(index)) {
    120         String index_str = index.toString(false).toLowerCase();
    121                 // Add alphabetically.
    122         for(int i = 0; i < size(); i++) {
    123         Index sibling = (Index) get(i);
    124         String sibling_str = sibling.toString(false).toLowerCase();
    125         int position = index_str.compareTo(sibling_str);
    126         // Sibling is before index.
    127         if(position > 0) {
    128             // Carry on.
    129         }
    130         // Index is equal to, or before sibling. Insert it.
    131         else if(position == 0 || position < 0) {
    132             add(i, index);
    133             gatherer.c_man.configurationChanged();
    134             return;
    135         }
    136         }
    137                 // If we got this far, we haven't inserted index, and we are out of model so.
    138         addElement(index);
    139         gatherer.c_man.configurationChanged();
     75        CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum);
     76        // Retrieve the currently last index
     77        Index last_index = (Index)getElementAt(getSize() - 1);
     78        addAfter(index, last_index);
     79        Gatherer.c_man.configurationChanged();
    14080    }
    14181    else {
    142         JOptionPane.showMessageDialog(manager.gui, get("CDM.IndexManager.Index_Exists"), get("General.Warning"), JOptionPane.WARNING_MESSAGE);
    143     }
    144     }
    145     /** Method to acquire the controls for editing the indexes.
    146       * @return A <strong>JPanel</strong> containing the controls.
    147       * @see org.greenstone.gatherer.cdm.IndexManager.Control
    148       */
    149     public JPanel getControls() {
    150     if(controls == null) {
    151         controls = new Control();
    152     }
    153     return controls;
    154     }
    155     /** Method to get the default index.
    156       * @return The default <strong>Index</strong>.
    157       */
    158     public Index getDefault() {
    159     return default_index;
    160     }
    161     /** Method to retrieve a certain index, as referenced by an index number.
    162       * @param index An <i>int</i> which indicates the position of the desired index.
    163       * @return The <strong>Index</strong> at the given index, or <i>null</i> if no such index exists.
    164       */
    165     public Index getIndex(int index) {
    166     if(0 <= index && index < size()) {
    167         return (Index)get(index);
    168     }
    169     return null;
    170     }
    171     /** Method to retrieve a certain index, given its name.
    172       * @param name The name of the index as a <Strong>String</strong>.
    173       * @return The <strong>Index</strong> that matches name, or <i>null</i> if no such index exists.
    174       */
    175     public Index getIndex(String name) {
    176     ///ystem.err.println("Searching for index " + name);
    177     for(int i = 0; i < size(); i++) {
    178         Index index = (Index) get(i);
    179         if(index.toString(false).equals(name)) {
    180         ///ystem.err.println("Found.");
    181         return (Index)get(i);
    182         }
    183     }
    184     ///ystem.err.println("No such index.");
    185     return null;
    186     }
    187     /** A method to retrieve all of the indexes associated with this manager.
    188       * @return A <strong>Vector</strong> of <strong>Index</strong>es.
    189       */
    190     public Vector getIndexes() {
    191     Vector indexes = new Vector();
    192     for(int i = 0; i < size(); i++) {
    193         indexes.add(get(i));
    194     }
    195     Collections.sort(indexes);
    196     return indexes;
    197     }
    198     /** Mark the current set of controls, if any, as obsolete and deallocate them. If further need of the controls will cause new controls to be created.
    199     * @see org.greenstone.gatherer.cdm.IndexManager.Control
    200     */
    201     public void invalidateControls() {
     82        JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.IndexManager.Index_Exists"), get("General.Warning"), JOptionPane.WARNING_MESSAGE);
     83    }
     84    }
     85
     86    public void destroy() {
    20287    if(controls != null) {
    20388        controls.destroy();
    204     }
    205     controls = null;
    206     }
    207     /** Method that attempts to parse an index related command from the given command. If such a command is parsed, it is immediately registered with this manager.
    208       * @param command The <strong>String</strong> to parse.
    209       * @return A <i>boolean</i> which is <i>true</i> if a command was parsed, <i>false</i> otherwise.
    210       * @see org.greenstone.gatherer.cdm.CommandTokenizer
    211       * @see org.greenstone.gatherer.cdm.Index
    212       */
    213     public boolean parse(String command) {
    214     String temp = command.toLowerCase();
    215     if(temp.startsWith("indexes")) {
    216         CommandTokenizer ct = new CommandTokenizer(command);
    217         ct.nextToken(); // Throw away indexes.
    218         while(ct.hasMoreTokens()) {
    219         String entry = ct.nextToken();
    220         Index index = Index.parseIndexConfig(entry, manager);
    221         if (index != null) {
    222             addIndex(index);
    223            
    224         } else { // return false if there is one error??
    225             return false;
    226         }
    227         }
    228        
    229         return true;
    230     }
    231     else if(temp.startsWith("defaultindex")) {
    232         CommandTokenizer ct = new CommandTokenizer(command);
    233         ct.nextToken();
    234         String entry = ct.nextToken();
    235         Index index = Index.parseIndexConfig(entry, manager);
    236         if (index != null) {
    237         setDefault(index);
    238         return true;
    239         }
    240         return false;
    241     }
    242    
    243     return false;
    244     }
    245 
    246     public void removeAll() {
    247     removeAllElements();
     89        controls = null;
     90    }
    24891    default_index = null;
    249     gatherer.c_man.configurationChanged();
     92    model = null;
     93    }
     94
     95    /** Method to acquire the controls for editing the indexes.
     96     * @return the Control
     97     */
     98    public Control getControls() {
     99    if(controls == null) {
     100        // Build controls
     101        controls = new IndexControl();
     102    }
     103    return controls;
     104    }
     105
     106    /** Method to get the default index.
     107     * @return The default <strong>Index</strong>.
     108     */
     109    public Index getDefault() {
     110    if(default_index != null && default_index.isAssigned()) {
     111        return default_index;
     112    }
     113    else {
     114        return null;
     115    }
     116    }
     117
     118    /** Method to retrieve a certain index, as referenced by an index number.
     119     * @param index An <i>int</i> which indicates the position of the desired index.
     120     * @return The <strong>Index</strong> at the given index, or <i>null</i> if no such index exists.
     121     */
     122    public Index getIndex(int index) {
     123    if(0 <= index && index < getSize()) {
     124        return (Index)getElementAt(index);
     125    }
     126    return null;
     127    }
     128
     129    /** Method to retrieve a certain index, given its id.
     130     * @param id the id of the index as a String
     131     * @return the Index that matches id, or null if no such index exists
     132     */
     133    public Index getIndex(String id) {
     134    int size = getSize();
     135    for(int i = 0; i < size; i++) {
     136        Index index = (Index) getElementAt(i);
     137        if(index.getID().equals(id)) {
     138        return index;
     139        }
     140    }
     141    return null;
     142    }
     143
     144    public ArrayList getIndexes() {
     145    return children();
    250146    }
    251147
    252148    /** Method to remove a certain index.
    253       * @param index The <Strong>Index</strong> to remove.
    254       * @see org.greenstone.gatherer.Gatherer
    255       * @see org.greenstone.gatherer.cdm.CollectionDesignManager
    256       * @see org.greenstone.gatherer.cdm.CollectionMetaManager
    257       * @see org.greenstone.gatherer.collection.CollectionManager
    258       */
     149     * @param index the Index to remove.
     150     * @see org.greenstone.gatherer.Gatherer
     151     * @see org.greenstone.gatherer.cdm.CollectionDesignManager
     152     * @see org.greenstone.gatherer.cdm.CollectionMetaManager
     153     * @see org.greenstone.gatherer.collection.CollectionManager
     154     */
    259155    public void removeIndex(Index index) {
    260156    if(index != null) {
    261         String name = index.getName();
    262         if(name != null) {
    263         Language default_language = manager.languages.getDefaultLanguage();
    264         CollectionMeta metadata = new CollectionMeta(manager, index, default_language, name);
    265         manager.collectionmetadatum.removeMetadata(metadata);
    266         }
    267         removeElement(index);
     157        // Remove any current metadata from this index
     158        CollectionDesignManager.collectionmeta_manager.removeMetadata(StaticStrings.STOP_CHARACTER + index.getID());
     159        // Check if the index removed happens to be the default index
    268160        if(default_index != null && default_index.equals(index)) {
    269         default_index = null;
    270         }
    271         gatherer.c_man.configurationChanged();
    272     }
    273     }
     161        default_index.setAssigned(false);
     162        }
     163        // Remove the index
     164        remove(index);
     165        Gatherer.c_man.configurationChanged();
     166    }
     167    }
     168
    274169    /** Method to set the default index.
    275       * @param index The new default <strong>Index</strong>.
    276       * @see org.greenstone.gatherer.Gatherer
    277       * @see org.greenstone.gatherer.collection.CollectionManager
    278       */
     170     * @param index the new default Index
     171     * @see org.greenstone.gatherer.Gatherer
     172     * @see org.greenstone.gatherer.collection.CollectionManager
     173     */
    279174    public void setDefault(Index index) {
    280     default_index = index;
    281     if(index != null && !contains(index)) {
    282         addElement(index);
    283     }
    284     gatherer.c_man.configurationChanged();
    285     }
    286     /** Method to print out the contents of this class as a string.
    287       * @return A <strong>String</strong> just as it would appear in the colleciton configuration file.
    288       */
    289     public String toString() {
    290     String text = "";
    291     // First the indexes.
    292     if(size() > 0) {
    293         text = "indexes      ";
    294         for(int i = 0; i < size(); i++) {
    295         Index index = (Index) get(i);
    296         text = text + index.toStringConfig();
    297         if(i < size() - 1) {
    298             text = text + " ";
    299         }
    300         }
    301         // Now the default index if there is one, or just the first index
    302         // if there isn't
     175    if(index != null) {
     176        if(default_index == null) {
     177        // Create the default index element, and place immediately after indexes element.
     178        Element default_index_element = root.getOwnerDocument().createElement(CollectionConfiguration.INDEX_DEFAULT_ELEMENT);
     179        default_index = new Index(default_index_element);
     180        Node target_node = CollectionConfiguration.findInsertionPoint(default_index_element);
     181        if(target_node != null) {
     182            root.getOwnerDocument().getDocumentElement().insertBefore(default_index_element, target_node);
     183        }
     184        else {
     185            root.getOwnerDocument().getDocumentElement().appendChild(default_index_element);
     186        }
     187        }
     188        default_index.setAssigned(true);
     189        default_index.setLevel(index.getLevel());
     190        default_index.setSources(index.getSources());
     191    }
     192    else {
    303193        if(default_index != null) {
    304         text = text + "\ndefaultindex " + default_index.toStringConfig() + "\n";
    305         }
    306         text = text + "\n";
    307     }
    308     return text;
    309     }
    310 
    311 
    312 
    313 
     194        default_index.setAssigned(false);
     195        }
     196    }
     197    Gatherer.c_man.configurationChanged();
     198    }
    314199   
    315200    /** Overloaded to call get with both a key and an empty argument array.
    316       * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    317       * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    318       */
     201     * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
     202     * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
     203     */
    319204    private String get(String key) {
    320205    return get(key, null);
    321206    }
     207
    322208    /** Used to retrieve a property value from the Locale specific ResourceBundle, based upon the key and arguments supplied. If the key cannot be found or if some other part of the call fails a default (English) error message is returned. <BR>
    323       * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned. Note that argument numbers greater than or equal to 32 are automatically mapped to the formatting String named Farg<I>n</I>.
    324       * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
    325       * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.
    326       * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.
    327       * @see org.greenstone.gatherer.Gatherer
    328       * @see org.greenstone.gatherer.Dictionary
    329       */
     209     * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned. Note that argument numbers greater than or equal to 32 are automatically mapped to the formatting String named Farg<I>n</I>.
     210     * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.
     211     * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.
     212     * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatically populated with formatting Strings of with argument String provided in the get call.
     213     * @see org.greenstone.gatherer.Gatherer
     214     * @see org.greenstone.gatherer.Dictionary
     215     */
    330216    private String get(String key, String args[]) {
    331217    if(key.indexOf('.') == -1) {
    332218        key = "CDM.IndexManager." + key;
    333219    }
    334     return gatherer.dictionary.get(key, args);
    335     }
     220    return Gatherer.dictionary.get(key, args);
     221    }
     222
    336223    /** This class creates a set of controls for editing the indexes. */
    337     private class Control
    338     extends JPanel {
     224    private class IndexControl
     225    extends JPanel
     226    implements Control {
    339227    /** The default size of a label on this control. */
    340228    private Dimension LABEL_SIZE = new Dimension(120,25);
     
    406294     * @see org.greenstone.gatherer.util.ExclusiveListSelectionListener
    407295     */
    408     public Control() {
     296    public IndexControl() {
    409297        super();
    410298        source_model = new Vector();
    411299        source_model.add("text");
    412         source_model.addAll(gatherer.c_man.msm.getAssignedElements());
    413         //source_model.addAll(gatherer.c_man.msm.getElements());
     300        source_model.addAll(Gatherer.c_man.getCollection().msm.getAssignedElements());
    414301        // Creation
    415302        add = new JButton(get("Add"));
     
    428315        default_pane = new JPanel();
    429316        if(default_index != null) {
    430         default_value = new JTextField(default_index.toString(true));
     317        default_value = new JTextField(default_index.toString());
    431318        default_value.setCaretPosition(0);
    432319        }
     
    440327        index_label = new JLabel(get("Indexes"));
    441328        index_list = new JList(model);
    442         index_list.setCellRenderer(new IndexListCellRenderer());
    443329        instructions = new JTextArea(get("Instructions"));
    444330        instructions.setEditable(false);
     
    550436    }
    551437    /* Destructor, removes persistant listeners from the Dictionary.
    552             */
     438     */
    553439    public void destroy() {
    554440    }
    555     /** We override the updateUI method so that we can ensure we are scrolled to the top of the instructions box first.
    556           * @see org.greenstone.gatherer.Gatherer
    557           * @see org.greenstone.gatherer.collection.CollectionManager
    558           * @see org.greenstone.gatherer.msm.MetadataSetManager
    559             */
    560     public void updateUI() {
     441
     442    public void gainFocus() {
    561443        if(instructions != null) {
    562444        instructions.setCaretPosition(0);
     
    566448        source_model.clear();
    567449        source_model.add("text");
    568         source_model.addAll(gatherer.c_man.msm.getAssignedElements());
     450        source_model.addAll(Gatherer.c_man.getCollection().msm.getAssignedElements());
    569451        // reset the model in the list - needed if the model is larger than when it was first created, the list doesn't display
    570452        source_list.setListData(source_model);
    571453       
    572454        }
    573         // Faster than a NPE its the - 'Super class'.
    574         super.updateUI();
    575     }
     455    }
     456
     457    public void loseFocus() {
     458    }
     459
    576460    /** Listens for actions apon the 'add' button in the IndexManager controls, and if detected calls the add method of the manager with a newly created index. */
    577461    private class AddListener
     
    589473        if(!source_list.isSelectionEmpty() && name.getText().length() != 0) {
    590474            Object object[] = source_list.getSelectedValues();
    591             Vector sources = new Vector();
     475            ArrayList sources = new ArrayList();
    592476            for(int i = 0; i < object.length; i++) {
    593477            sources.add(object[i]);
    594478            }
    595             Index index = new Index(level.getSelectedIndex(), sources, manager);
     479            object = null;
     480            Index index = new Index(level.getSelectedIndex(), sources);
     481            sources = null;
    596482            // Before we add the index to the model, we have to add the collection metadata for this.
    597             Language language = manager.languages.getDefaultLanguage();
    598             CollectionMeta metadata = new CollectionMeta(manager, index, language, name.getText());
    599             manager.collectionmetadatum.addMetadata(metadata);
     483            CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + index.getID());
     484            metadatum.setValue(name.getText());
    600485            // Finally add index.
    601             addIndex(index);
     486            addIndex(index, metadatum);
     487            metadatum = null;
     488            index = null;
    602489        }
    603490        }
     
    606493    private class ClearDefaultListener
    607494        implements ActionListener {
    608                 /** If called when an action occurs on a registered component, we clear the default index.
    609                 * @param event An <strong>ActionEvent</strong> containing extra information about the action that occured.
    610                 */
     495        /** If called when an action occurs on a registered component, we clear the default index.
     496        * @param event An <strong>ActionEvent</strong> containing extra information about the action that occured.
     497         */
    611498        public void actionPerformed(ActionEvent event) {
    612499        setDefault(null);
     
    643530        if(default_index != null) {
    644531            clear_default.setEnabled(true);
    645             default_value.setText(default_index.toString(true));
     532            default_value.setText(default_index.toString());
    646533            default_value.setCaretPosition(0);
    647534        }
     
    698585        }
    699586    }
    700 
    701 
    702     private class IndexListCellRenderer
    703         extends DefaultListCellRenderer {
    704        
    705         public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    706         StringBuffer text = new StringBuffer(value.toString());
    707         // Retrieve the indexes name if any.
    708         CollectionMeta metadata = manager.collectionmetadatum.getMetadata(value, manager.languages.getDefaultLanguage(), true);
    709         if(metadata != null) {
    710             text.append(" \"");
    711             text.append(metadata.getValue());
    712             text.append("\"");
    713         }
    714         return super.getListCellRendererComponent(list, text.toString(), index, isSelected, cellHasFocus);
    715         }
    716 
    717     }
    718 
    719587    }
    720588}
Note: See TracChangeset for help on using the changeset viewer.