Changeset 14359
- Timestamp:
- 2007-08-09T16:32:13+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/cdm/Format4gs3.java
r14042 r14359 44 44 /** We keep a copy of the feature name */ 45 45 private String feature_name = null; 46 /** The format statement for this feature . */46 /** The format statement for this feature (also contains classifier options if its a classifier), used by the format list on the top in GLI. */ 47 47 private String feature_format = null; 48 49 /** The format statement for this feature (does not contain options in the front), displayed in the format editor at the bottom in GLI. 50 * If this format is not a classifier, feature_format==pure_format*/ 51 private String pure_format = null; 48 52 49 53 /** Wether this feature is about a classifier. The other way to check this is to see if feature_name starts with "CL" */ … … 71 75 classifier_options = classifier.toString(); 72 76 73 feature_format = toOneLineFormat(XMLTools.getNodeText(element)); 74 feature_format = classifier_options + " " + feature_format; 77 78 pure_format = toOneLineFormat(XMLTools.getNodeText(element)); 79 feature_format = classifier_options + " " + pure_format; 75 80 } else { 76 81 feature_name = element.getAttribute(StaticStrings.NAME_ATTRIBUTE); 77 82 feature_format = toOneLineFormat(XMLTools.getNodeText(element)); 83 pure_format = feature_format; 78 84 } 79 85 … … 83 89 this.feature_name = feature_name; 84 90 this.feature_format = feature_format; 91 this.pure_format = feature_format; 92 85 93 is_classifier = feature_name.startsWith (Classifier.CLASSIFIER_PREFIX); 86 94 87 95 element = CollectionConfiguration.createElement (StaticStrings.FORMAT_STR); 88 if( feature_name.startsWith(Classifier.CLASSIFIER_PREFIX)) {96 if(is_classifier) { 89 97 90 98 //Now get the options of the classifier … … 92 100 //set the classifier_options string 93 101 classifier_options = classifier.toString(); 94 102 95 103 feature_format = classifier_options + " " + feature_format; 96 104 } else { … … 98 106 } 99 107 100 XMLTools.setNodeText(element, toOneLineFormat( feature_format));108 XMLTools.setNodeText(element, toOneLineFormat(pure_format)); 101 109 102 110 } … … 138 146 } 139 147 140 /** Method to translate this class esinformation into a line of text as you would expect on the format list panel148 /** Method to translate this class information into a line of text as you would expect on the format list panel 141 149 * @return A <strong>String</strong> containing the format command. 142 150 */ … … 152 160 //update the classifier_options string 153 161 classifier_options = classifier.toString(); 154 155 feature_format = classifier_options + " " + toOneLineFormat(XMLTools.getNodeText(element));162 pure_format = toOneLineFormat(XMLTools.getNodeText(element)); 163 feature_format = classifier_options + " " + pure_format; 156 164 } 157 165 } … … 159 167 return toFormatedFormat(feature_format); 160 168 } 169 public String getPureFormat() { 170 return toFormatedFormat(pure_format); 171 } 172 161 173 public Classifier getClassifier() { 162 174 if(!isClassifier()) { … … 176 188 */ 177 189 public void setFeatureFormat (String value) { 178 feature_format = value; 179 XMLTools.setNodeText(element, feature_format); 190 if(is_classifier) { 191 feature_format = classifier_options + " " + value; 192 } else { 193 feature_format = value; 194 } 195 } 196 public void setPureFormat (String value) { 197 pure_format = value; 198 setFeatureFormat (value); 199 XMLTools.setNodeText(element, pure_format); 180 200 } 181 201 public static String toOneLineFormat(String str) {
Note:
See TracChangeset
for help on using the changeset viewer.