- Timestamp:
- 2003-06-11T16:38:56+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java
r4579 r4583 124 124 } 125 125 /** A method to add a new subcollection, by specifying its name, metadata element if applicable and Perl expression to filter pages into or out of this collection. 126 127 128 129 130 131 132 133 126 * @param name A <>>String</>> which is a unique identifier of a subcollection. 127 * @param include A <i>boolean</i> indicating whether this is an inclusion filter (<i>true</i>) or an exclusion one (<i>false</i>). 128 * @param element An <>>Element</>> which is either the metadata whose value should be matched against the given expression, or <i>null</i> if you wish to match against the file name. 129 * @param exp A <>>String</>> containing a Perl expression which is used as the filter for this subcollection. 130 * @param flags A <strong>String<strong> listing any special flags to be applied when matching the expression. 131 * @return A <i>boolean</i> with a value of <i>true</i> if the addition was successful. 132 * @see org.greenstone.gatherer.cdm.Subcollection 133 */ 134 134 public boolean addSubcollection(String name, boolean include, String element, String exp, String flags) { 135 135 Subcollection sub = null; … … 143 143 } 144 144 /** Refresh all derived components using this manager as a model. 145 145 */ 146 146 public void changed() { 147 147 fireContentsChanged(this, 0, getSize() - 1); 148 148 } 149 149 /** Method to retrieve the controls for this manager. 150 151 150 * @return A <Strong>Control</strong> object which contains the controls used to edit the subcollection data. 151 */ 152 152 public Control getControls() { 153 153 if(controls == null) { … … 163 163 } 164 164 /** Method to retrieve a certain subcollection by its name. 165 166 167 165 * @param name A <strong>String</strong> which is used as the key for finding the matching subcollection. 166 * @return The requested <strong>Subcollection</strong> or <i>null</i> if no such subcollection exists. 167 */ 168 168 public Subcollection getSubcollection(String name) { 169 169 return (Subcollection) subcollections.get(name); … … 185 185 186 186 /** Method to get all of the subindexes set. 187 188 187 * @return A <strong>SubIndexes</strong> object containing all the defined indexes. 188 */ 189 189 public SubIndexes getSubIndexes() { 190 190 return subindexes; 191 191 } 192 192 /** Method to get all of the subcollections defined. 193 194 193 * @return A <strong>Vector</strong> of subcollections. 194 */ 195 195 public Vector getSubcollections() { 196 196 Vector subcollections = new Vector(); … … 201 201 } 202 202 /** Mark the current controls, if any, as invalid and deallocate them. Any further use of the controls will requires them being rebuilt. 203 204 203 * @see org.greenstone.gatherer.cdm.SubcollectionManager.Control 204 */ 205 205 public void invalidateControls() { 206 206 if(controls != null) { … … 210 210 } 211 211 /** This method attempts to parse a subcollection related command from the given command string. If such a string is successfully parsed, it is immediately added to the data within this collection. 212 213 214 215 216 217 218 219 212 * @param command The <strong>String</strong> to be parsed. 213 * @param finished This <i>boolean</i> is usually <i>false</i> when called, unless this parse call is being made -after- the entire collection configuration file has been read in in which case it is <i>true</i>. 214 * @return A <i>boolean</i> which is <i>true</i> if a command was parsed, <i>false</i> otherwise. 215 * @see org.greenstone.gatherer.cdm.CommandTokenizer 216 * @see org.greenstone.gatherer.cdm.DefaultSubIndex 217 * @see org.greenstone.gatherer.cdm.Subcollection 218 * @see org.greenstone.gatherer.cdm.SubIndex 219 */ 220 220 public boolean parse(String command, boolean finished) { 221 221 String temp = command.toLowerCase(); … … 683 683 684 684 /** Method to unregister any listeners to avoid memory leaks. 685 685 */ 686 686 public void destroy() { 687 687 } … … 726 726 private class AddListener 727 727 implements ActionListener { 728 729 730 731 732 728 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we wish to retrieve information from the various edit controls, and if we have sufficient data to build a new subcollection do so. 729 * @param event An <strong>ActionEvent</strong> containing information about the event. 730 * @see org.greenstone.gatherer.cdm.Subcollection 731 * @see org.greenstone.gatherer.msm.ElementWrapper 732 */ 733 733 public void actionPerformed(ActionEvent event) { 734 734 String n = name.getText(); // not allowed spaces! … … 778 778 extends KeyAdapter 779 779 implements ActionListener { 780 781 782 780 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to record that somethings changed, then validate the controls. 781 * @param event An <strong>ActionEvent</strong> containing information about the event. 782 */ 783 783 public void actionPerformed(ActionEvent event) { 784 784 changed = true; 785 785 validate(); 786 786 } 787 788 789 787 /** Any inheritor of KeyAdapter can override this method so we can be informed when an key has been type in one of our target controls. In this case we want to record that somethings changed, then validate the controls. 788 * @param event An <strong>KeyEvent</strong> containing information about the event. 789 */ 790 790 public void keyPressed(KeyEvent event) { 791 791 changed = true; 792 792 validate(); 793 793 } 794 794 /** Method to validate the current editor values, and enable or disable controls based on said values. */ 795 795 private void validate() { 796 796 if(changed && name.getText().length() > 0 && match.getText().length() > 0) { … … 805 805 private class ClearDefaultListener 806 806 implements ActionListener { 807 808 809 807 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to clear the default subindex. 808 * @param event An <strong>ActionEvent</strong> containing information about the event. 809 */ 810 810 public void actionPerformed(ActionEvent event) { 811 811 setDefaultSubIndex(null); … … 817 817 private class ListListener 818 818 implements ListSelectionListener { 819 820 821 822 823 819 /** Any implementation of ListSelectionListener must include this method so we can be informed when the selection changes. In this case we want to execute any changes the users made to the entry, then update the controls with details of the new selection. 820 * @param event A <strong>ListSelectionEvent</strong> containing information related to this event. 821 * @see org.greenstone.gatherer.cdm.Subcollection 822 * @see org.greenstone.gatherer.msm.ElementWrapper 823 */ 824 824 public void valueChanged(ListSelectionEvent event) { 825 825 // If we have a previous collection and the users changed something, but not added, then update subcollection. … … 896 896 private class RemoveListener 897 897 implements ActionListener { 898 899 900 901 898 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to check if they have a subcolleciton selected, and if so remove both it and any subindexes based on it. 899 * @param event An <strong>ActionEvent</strong> containing information about the event. 900 * @see org.greenstone.gatherer.cdm.Subcollection 901 */ 902 902 public void actionPerformed(ActionEvent event) { 903 903 if(!subcollection_list.isSelectionEmpty()) { … … 911 911 private class RemoveSubIndexListener 912 912 implements ActionListener { 913 914 915 916 913 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to check if they have a subindex selected, and if so remove it. 914 * @param event An <strong>ActionEvent</strong> containing information about the event. 915 * @see org.greenstone.gatherer.cdm.SubIndex 916 */ 917 917 public void actionPerformed(ActionEvent event) { 918 918 if(!subindexes_list.isSelectionEmpty()) { … … 924 924 private class SetDefaultListener 925 925 implements ActionListener { 926 927 928 929 930 926 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to check if they have a subindex selected, and if so set it as default. 927 * @param event An <strong>ActionEvent</strong> containing information about the event. 928 * @see org.greenstone.gatherer.cdm.DefaultSubIndex 929 * @see org.greenstone.gatherer.cdm.SubIndex 930 */ 931 931 public void actionPerformed(ActionEvent event) { 932 932 if(!subindexes_list.isSelectionEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.