Changeset 10341


Ignore:
Timestamp:
2005-07-28T15:32:08+12:00 (19 years ago)
Author:
kjdon
Message:

when change the order of the classifiers, now it calls refresh in the format manager to update the CLx format statements

Location:
trunk/gli/src/org/greenstone/gatherer/cdm
Files:
2 edited

Legend:

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

    r10237 r10341  
    204204        addBefore(classifier, first_classifier);
    205205        first_classifier = null;
    206         Gatherer.c_man.configurationChanged();
    207206        }
    208207        else {
     
    228227        remove(classifier);
    229228        add(index, classifier);
    230         Gatherer.c_man.configurationChanged();
    231229        }
    232230        else {
     
    241239        remove(classifier);
    242240        add(index, classifier);
    243         Gatherer.c_man.configurationChanged();
    244         }
    245     }
    246     }
    247 
     241        }
     242    }
     243   
     244    Gatherer.c_man.configurationChanged();
     245    // tell the format manager to update the names of its format statements
     246    Gatherer.c_man.getCollection().cdm.format_manager.refresh();
     247    }
     248   
    248249    /** This method removes an assigned classifier. I was tempted to call it unassign, but remove is more consistant. Note that there is no way to remove a classifier from the library.
    249250     * @param classifier The Classifier to remove
  • trunk/gli/src/org/greenstone/gatherer/cdm/FormatManager.java

    r10237 r10341  
    146146    }
    147147
     148    /** updates the format model */
     149    public synchronized void refresh() {
     150    for(int i = 0; i < getSize(); i++) {
     151        Format format = (Format) getElementAt(i);
     152        format.update();
     153        format = null;
     154    }
     155    super.refresh();
     156    }
    148157    /** Method to remove a format.
    149158     * @param format The <strong>Format</strong> to remove.
     
    430439    public void loseFocus() {
    431440        // Force all of the Formats to update their names with the correct values.
    432         int size = model.getSize();
    433         for(int i = 0; i < size; i++) {
    434         Format format = (Format) model.getElementAt(i);
    435         format.update();
    436         format = null;
    437         }
     441        // do we need to do this on loseFocus???
     442        model.refresh();
    438443    }
    439444
Note: See TracChangeset for help on using the changeset viewer.