Révision 1102

tmp/org.txm.core/src/java/org/txm/objects/Text.java (revision 1102)
43 43
 */
44 44
public class Text extends TXMResult {
45 45

  
46
	/** The editions. */
47
	HashMap<String, Edition> editions = new HashMap<String, Edition>();
46
//	/** The editions. */
47
//	HashMap<String, Edition> editions = new HashMap<String, Edition>();
48 48
	
49 49
	/** The source file. */
50 50
	@Parameter(key=TBXPreferences.SOURCE)
......
142 142
	 * @return the edition
143 143
	 */
144 144
	public Edition getEdition(String name) {
145
		if (!editions.containsKey(name)) {
146
			for (Edition edition : getEditions()) {
147
				if (edition.getName().equals(name)) {
148
					editions.put(name, edition);
149
					break;
150
				}
145
		List<Edition> editions = this.getEditions();
146
		for (Edition ed : editions) {
147
			if (name.equals(ed.getName())) {
148
				return ed;
151 149
			}
152 150
		}
153
		return editions.get(name);
151
		return null;
154 152
	}
155 153

  
156 154
//	/**
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 1102)
59 59
	String pIndex;
60 60

  
61 61
	/** The pages. */
62
	ArrayList<Page> pages = new ArrayList<Page>();
62
	ArrayList<Page> pages;
63 63

  
64 64
	@Parameter(key=TBXPreferences.NAMES)
65 65
	ArrayList<String> pPageNames = new ArrayList<String>();
......
311 311

  
312 312
		if (defaultHtmlDir == null) {
313 313
			File binDir = getText().getProject().getProjectDirectory();
314
			defaultHtmlDir = new File(binDir, "HTML/"+getText().getName()+"/"+getName()); //$NON-NLS-1$ //$NON-NLS-2$
314
			defaultHtmlDir = new File(binDir, "HTML/"+getText().getProject().getName()+"/"+getName()); //$NON-NLS-1$ //$NON-NLS-2$
315 315
		}
316 316
		return defaultHtmlDir;
317 317
	}
......
358 358
			pPageFirstWordIds = new ArrayList<>(Arrays.asList(wordids.split("\t")));
359 359
		}
360 360
		
361
		pages.clear();
361
		if (pages == null) {
362
			pages = new ArrayList<Page>();
363
		} else {
364
			pages.clear();
365
		}
366
		
362 367
		for (int i = 0 ; i < pPageNames.size() && i < pPageFirstWordIds.size() ; i++) {
363 368
			pages.add(new Page(this, pPageNames.get(i), pPageFirstWordIds.get(i)));
364 369
		}
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 1102)
306 306
		List<Text> texts = getTexts();
307 307
		if (texts.size() > 0) {
308 308
			int idx = texts.indexOf(t) + 1;
309
			if (idx > 1 && idx < texts.size()) {
310
				texts.get(idx);
309
			if (idx >= 1 && idx < texts.size()) {
310
				return texts.get(idx);
311 311
			}
312 312
		}
313 313

  
......
325 325
		if (texts.size() > 0) {
326 326
			int idx = texts.indexOf(t) -1 ;
327 327
			if (idx >= 0) {
328
				texts.get(idx);
328
				return texts.get(idx);
329 329
			}
330 330
		}
331 331

  
tmp/org.txm.core/src/java/org/txm/objects/Page.java (revision 1102)
38 38
import org.txm.core.messages.TXMCoreMessages;
39 39
import org.w3c.dom.Element;
40 40

  
41
// TODO: Auto-generated Javadoc
42 41
/**
43 42
 * The Class Page a fle to open in the Browser
44 43
 */
......
65 64
		this.edition = edition;
66 65
		this.name = name;
67 66
		this.firstWordId = wordid;
68
		this.htmlfile = new File(edition.getHtmlDir(), name+".html");
67
		this.htmlfile = new File(edition.getHtmlDir(), edition.getText().getName()+"_"+name+".html");
69 68
	}
70 69
	
71 70
	/**
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java (revision 1102)
550 550
		});
551 551

  
552 552
		openEditions(corpus, text, editionNames);
553
		firstPage();
553 554
	}
554 555

  
555 556
	/**
......
776 777
	@Override
777 778
	public void updateResultFromEditor() {
778 779
		// TODO Auto-generated method stub
779
		
780 780
	}
781 781

  
782 782
	@Override
783 783
	public void updateEditorFromResult(boolean update) throws Exception {
784
		// TODO Auto-generated method stub
785
		
784
		this.firstPage();
786 785
	}
787 786
	
788 787
	// Called by JavaScript
tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java (revision 1102)
43 43
import org.txm.edition.rcp.editors.SynopticEditorInput;
44 44
import org.txm.edition.rcp.messages.EditionUIMessages;
45 45
import org.txm.objects.Text;
46
import org.txm.rcp.editors.TXMEditor;
46 47
import org.txm.searchengine.cqp.corpus.CQPCorpus;
47 48
import org.txm.searchengine.cqp.corpus.MainCorpus;
48 49
import org.txm.searchengine.cqp.corpus.Property;
......
105 106

  
106 107
				editor = openEdition(c, editionsToOpen);
107 108

  
108
				if (editor != null)
109
					editor.firstPage();
110

  
109
//				if (editor != null)
110
//					editor.firstPage();
111 111
			} catch (Exception e) {
112 112
				System.out.println(EditionUIMessages.OpenEdition_4+e);
113 113
				org.txm.rcp.utils.Logger.printStackTrace(e);
......
167 167
			//String[] editions = {maincorpus.getDefaultEdition()};
168 168
			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
169 169
			IWorkbenchPage page = window.getActivePage();
170

  
170
			
171 171
			SynopticEditorInput editorInput = new SynopticEditorInput(corpus, text.getName(), editions);
172 172
			SynopticEditionEditor editor = (SynopticEditionEditor) page.openEditor(editorInput,
173 173
					SynopticEditionEditor.ID, true);
174

  
174
			
175 175
			return editor;
176 176

  
177 177
		} catch (Exception e) {

Formats disponibles : Unified diff