1 19 20 21 package org.netbeans.modules.i18n.wizard; 22 23 24 import java.util.Comparator ; 25 import java.util.Map ; 26 import java.util.Set ; 27 import org.netbeans.modules.i18n.*; 28 29 import org.netbeans.modules.i18n.I18nSupport; 30 31 import org.openide.loaders.DataObject; 32 33 34 46 final class SourceData { 47 48 49 private DataObject resource; 50 51 52 private I18nSupport support; 53 54 55 private Map stringMap = new java.util.TreeMap (new HardStringComparator()); 56 57 private static class HardStringComparator implements java.util.Comparator { 58 public int compare(Object obj, Object obj1) { 59 HardCodedString hcs1 = (HardCodedString)obj; 60 HardCodedString hcs2 = (HardCodedString)obj1; 61 return hcs1.getStartPosition().getOffset() - 62 hcs2.getStartPosition().getOffset(); 63 } 64 } 65 66 67 private Set removedStrings; 68 69 70 71 public SourceData(DataObject resource) { 72 this.resource = resource; 73 } 74 75 76 public SourceData(DataObject resource, I18nSupport support) { 77 this.resource = resource; 78 this.support = support; 79 80 support.getResourceHolder().setResource(resource); 81 } 82 83 84 85 public DataObject getResource() { 86 return resource; 87 } 88 89 90 public I18nSupport getSupport() { 91 return support; 92 } 93 94 95 public Map getStringMap() { 96 return stringMap; 97 } 98 99 100 public void setStringMap(Map stringMap) { 101 this.stringMap.clear(); 102 this.stringMap.putAll(stringMap); 103 } 104 105 106 public Set getRemovedStrings() { 107 return removedStrings; 108 } 109 110 111 public void setRemovedStrings(Set removedStrings) { 112 this.removedStrings = removedStrings; 113 } 114 115 } 116 | Popular Tags |