// No preference defined, lets use defaults
if (tsPrefStore == null) {
tsPrefStore = new PreferenceStore(prefFile.getName());
CAS cas = DocumentUimaImpl.getVirginCAS(typeSystemFile);
TypeSystem ts = cas.getTypeSystem();
Collection<AnnotationStyle> defaultStyles = getConfiguredAnnotationStyles(tsPrefStore,
ts);
Collection<AnnotationStyle> newStyles = DefaultColors.assignColors(ts, defaultStyles);
// TODO: Settings defaults must be moved to the AnnotationEditor
for (AnnotationStyle style : newStyles) {
AnnotationStyle.putAnnotatationStyleToStore(tsPrefStore, style);
}
}
typeSystemPreferences.put(prefFile.getFullPath().toPortableString(), tsPrefStore);
}
documentToTypeSystemMap.put(document, typeSystemFile
.getFullPath().toPortableString());
IPreferenceStore store = sessionPreferenceStores.get(getTypesystemId(element));
if (store == null) {
PreferenceStore newStore = new PreferenceStore();
sessionPreferenceStores.put(getTypesystemId(element), newStore);
newStore.addPropertyChangeListener(new SaveSessionPreferencesTrigger(element));
String sessionPreferenceString = typeSystemFile.getPersistentProperty(new QualifiedName(
"", CAS_EDITOR_SESSION_PROPERTIES));
if (sessionPreferenceString != null) {
try {
newStore.load(new ByteArrayInputStream(sessionPreferenceString.getBytes("UTF-8")));
} catch (IOException e) {
CasEditorPlugin.log(e);
}
}
}
// TODO:
// Preferences are bound to the type system
// Changed in one place, then it should change in all places
CAS cas = DocumentUimaImpl.getVirginCAS(typeSystemFile);
DocumentFormat documentFormat;
// Which file format to use ?
if (casFile.getName().endsWith("xmi")) {