Revision 807

tmp/org.txm.annotation.core/src/org/txm/annotation/core/repository/KnowledgeRepositoryManager.java (revision 807)
154 154
			}
155 155
		}
156 156

  
157
		Element krCorpusElement = KRAnnotationEngine.getKnowledgeRepositoryElement(corpus.getBase().getBaseParameters(), name);
157
		BaseParameters bp = corpus.getBase().getBaseParameters();
158
		Element krCorpusElement = KRAnnotationEngine.getKnowledgeRepositoryElement(bp, name);
159
		if (krCorpusElement == null) krCorpusElement = KRAnnotationEngine.createKnowledgeRepositoryElement(bp, name);
158 160
		String sKRCorpusVersion = krCorpusElement.getAttribute("version");
159 161

  
160 162
		if (kr != null) {
tmp/org.txm.annotation.core/src/org/txm/annotation/core/KRAnnotationEngine.java (revision 807)
235 235
		}
236 236
	}
237 237
	
238
	protected Element createKnowledgeRepositoryElement(BaseParameters params, String name) {
238
	public static Element createKnowledgeRepositoryElement(BaseParameters params, String name) {
239 239
		Element rElement = getKnowledgeRepositoriesElement(params.getCorpusElement());
240 240
		Element e = rElement.getOwnerDocument().createElement("repository");
241 241
		e.setAttribute("name", name);
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java (revision 807)
268 268
	 * @return the int
269 269
	 */
270 270
	public int size() {
271
		return getEnd() - getStart() + 1;
271
		return end - start + 1;
272 272
	}
273 273
	
274 274
	public int getLength() {
......
282 282
	public void setEnd(int p) {
283 283
		this.end = p;
284 284
	}
285

  
286
	public void setStart(int p) {
287
		this.start = p;
288
	}
285 289
}
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/teitxm/AnnotationInjection.groovy (revision 807)
248 248
	 * @param wordId the word id
249 249
	 * @return the ana tag
250 250
	 */
251
	private void writeAnaTag(String wordId)
251
	private void writeAnaTags(String wordId)
252 252
	{
253 253
		String anabalises ="\n";
254 254
		for (String link : links) {
......
317 317
	protected void processEndElement() {
318 318
		switch (parser.getLocalName()) {
319 319
			case "w":
320
				writeAnaTag(wordId);
320
				writeAnaTags(wordId);
321 321
				flagW = false
322 322
				break;
323 323
			case "ana":
tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/concordance/KRConcordanceAnnotationExtension.java (revision 807)
167 167
			@Override
168 168
			public void widgetSelected(SelectionEvent e) {
169 169
				if (annotationArea != null) {
170
					try {
171
						AnnotationManager am = KRAnnotationEngine.getAnnotationManager(corpus);
172
						if (am != null && am.hasChanges()) {
173
							// && MessageDialog.openConfirm(e.display.getActiveShell(), "Confirm annotation save", "Saving annotation will close this editor. Are you sure you want to save annotations right now ?")
174
							JobHandler saveJob = SaveAnnotations.save(corpus.getMainCorpus());
175
							if (saveJob.getResult() == Status.CANCEL_STATUS) {
176
								// update editor corpus
177
								System.out.println("Fail to save annotations of the corpus."); //$NON-NLS-1$
178
							}
179
						}
180
					} catch(Exception ex) {
181
						ex.printStackTrace();
182
					}
170
					//@TODO Closing the annotation tool bar 
171
					//System.out.println("must hide");
172
					annotationSize = annotationArea.getSize();
173
					annotationArea.dispose();
174
					annotationArea = null;
175
					annotationButton.getParent().layout(true);
176
					annotationButton.setToolTipText(ConcordanceUIMessages.ConcordancesEditor_75);
177
					annotationButton.setImage(IImageKeys.getImage(IImageKeys.PENCIL));
178
					annotationColumn.setWidth(0);
179
					annotationColumn.setResizable(false);
183 180
				} else {
184 181
					if (annotationArea == null) {
185 182
						if (!composeAnnotationArea(controlArea)) {
......
645 642
		cancelAnnotateButton.addSelectionListener(new SelectionListener() {
646 643
			@Override
647 644
			public void widgetSelected(SelectionEvent e) {
648
				//@TODO Closing the annotation tool bar 
649
				//System.out.println("must hide");
650
				annotationSize = annotationArea.getSize();
651
				annotationArea.dispose();
652
				annotationArea = null;
653
				parent.layout(true);
654
				parent.layout();
655
				annotationButton.setToolTipText(ConcordanceUIMessages.ConcordancesEditor_75);
656
				annotationButton.setImage(IImageKeys.getImage(IImageKeys.PENCIL));
657
				annotationColumn.setWidth(0);
658
				annotationColumn.setResizable(false);
645
				
646
				try {
647
					AnnotationManager am = KRAnnotationEngine.getAnnotationManager(corpus);
648
					if (am != null && am.hasChanges()) {
649
						// && MessageDialog.openConfirm(e.display.getActiveShell(), "Confirm annotation save", "Saving annotation will close this editor. Are you sure you want to save annotations right now ?")
650
						JobHandler saveJob = SaveAnnotations.save(corpus.getMainCorpus());
651
						if (saveJob.getResult() == Status.CANCEL_STATUS) {
652
							// update editor corpus
653
							System.out.println("Fail to save annotations of the corpus."); //$NON-NLS-1$
654
						}
655
					}
656
				} catch(Exception ex) {
657
					ex.printStackTrace();
658
				}
659 659
			}
660 660

  
661 661
			@Override
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java (revision 807)
303 303
		public void dispose() {
304 304
			showParameters.dispose();
305 305
		}
306

  
307
		public Composite getParent() {
308
			return showParameters.getParent();
309
		}
306 310
	}
307 311

  
308 312
	public void unInstallGroup(String groupTitle) {
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 807)
1076 1076
		int startsearchM3 = 0; // optimisation: m3 is ordered
1077 1077
		//time = System.currentTimeMillis();
1078 1078
		for (Match m : m1) { // for each match = for each focus
1079
			
1080
			if (m.getTarget() >= 0) { // if target is set focus on target position
1081
				m.setStart(m.getTarget());
1082
				m.setEnd(m.getTarget());
1083
			}
1079 1084
			//System.out.println("for match m: "+m);
1080 1085
			Match n = null; // the match which contains the context
1081 1086
			Match o = null; // the match which does not contain the context

Also available in: Unified diff