Révision 2864
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java (revision 2864) | ||
|---|---|---|
| 221 | 221 |
if (!lines.containsKey(line)) return null; |
| 222 | 222 |
return lines.get(line); |
| 223 | 223 |
} |
| 224 |
|
|
| 225 |
/** |
|
| 226 |
* |
|
| 227 |
* @param i the relative position of the AnnotationLine in the lines list |
|
| 228 |
* |
|
| 229 |
* @return the AnnotationLine pointed by 'i'. May return null if i is wrong. |
|
| 230 |
*/ |
|
| 231 |
public AnnotationLine getAnnotationLine(int i) {
|
|
| 232 |
if (lines == null) return null; |
|
| 233 |
if (lines.size() == 0) return null; |
|
| 234 |
if (lines.size() < i) return null; |
|
| 235 |
if (i < 0) return null; |
|
| 236 |
|
|
| 237 |
return lines.get(i); |
|
| 238 |
} |
|
| 239 | 224 |
} |
| tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/AnnotationLineDecorator.java (revision 2864) | ||
|---|---|---|
| 1 | 1 |
package org.txm.annotation.kr.rcp.concordance; |
| 2 | 2 |
|
| 3 | 3 |
import org.txm.annotation.kr.core.Annotation; |
| 4 |
import org.txm.concordance.core.functions.Line; |
|
| 4 | 5 |
import org.txm.concordance.core.functions.LineDecorator; |
| 5 | 6 |
|
| 6 | 7 |
public class AnnotationLineDecorator extends LineDecorator {
|
| ... | ... | |
| 14 | 15 |
* Add "<" or ">" depending of the current position of the match and the annotation start end positions |
| 15 | 16 |
*/ |
| 16 | 17 |
@Override |
| 17 |
public String decorate(int i, int currentPos, String str) {
|
|
| 18 |
public String decorate(Line i, int currentPos, String str) {
|
|
| 18 | 19 |
Annotation annotation = annotations.getAnnotationLine(i).getAnnotation(); |
| 19 | 20 |
|
| 20 | 21 |
if (annotation != null) {
|
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepositoryManager.java (revision 2864) | ||
|---|---|---|
| 346 | 346 |
for (AnnotationType annotType : annotTypes) {
|
| 347 | 347 |
kr.deleteType(annotType); |
| 348 | 348 |
} |
| 349 |
repositories.remove(kr); |
|
| 349 |
repositories.remove(kr.getName());
|
|
| 350 | 350 |
} |
| 351 | 351 |
|
| 352 | 352 |
|
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java (revision 2864) | ||
|---|---|---|
| 488 | 488 |
Preferences krconf = node.node(name); |
| 489 | 489 |
krconf.removeNode(); |
| 490 | 490 |
} |
| 491 |
|
|
| 492 |
KnowledgeRepository kr = KnowledgeRepositoryManager.getKnowledgeRepository(name); |
|
| 493 |
if (kr != null) {
|
|
| 494 |
Log.fine("Deleting KR database: "+kr);
|
|
| 495 |
KnowledgeRepositoryManager.deleteKnowledgeRepository(kr); |
|
| 496 |
} |
|
| 491 | 497 |
} |
| 492 | 498 |
catch (BackingStoreException e) {
|
| 493 | 499 |
e.printStackTrace(); |
Formats disponibles : Unified diff