Revision 441

tmp/org.txm.rcp/src/main/java/org/txm/rcp/JobsTimer.java (revision 441)
54 54
	}
55 55
	
56 56
	public static void stopAndPrint() {
57
		if (TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.SHOW_TIMINGS)) {
57
		if (TXMPreferences.getBoolean(TBXPreferences.SHOW_TIMINGS, TBXPreferences.PREFERENCES_NODE)) {
58 58
			if (time <= 1000) System.out.println(NLS.bind(Messages.JobsTimer_15, stop(),(int)time));
59 59
			else System.out.println(NLS.bind(Messages.JobsTimer_19, stop()));
60 60
		}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 441)
340 340

  
341 341
		// Remove RCP Update preference page
342 342
		Log.warning(Messages.ApplicationWorkbenchAdvisor_21);
343
		if (!TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.EXPERT_USER)) {
343
		if (!TXMPreferences.getBoolean(TBXPreferences.EXPERT_USER, TBXPreferences.PREFERENCES_NODE)) {
344 344
			pm.remove("org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage"); //$NON-NLS-1$
345 345

  
346 346
			// Remove the Team menu
......
373 373
		if (wasFirstLaunch) return; // don't call for update for the first run of TXM
374 374

  
375 375
		try {
376
			boolean doUpdate = TXMPreferences.getBoolean(TBXPreferences.PREFERENCES_NODE, TBXPreferences.FETCH_UPDATES_AT_STARTUP);
376
			boolean doUpdate = TXMPreferences.getBoolean(TBXPreferences.FETCH_UPDATES_AT_STARTUP, TBXPreferences.PREFERENCES_NODE);
377 377
			if (!doUpdate) return;
378 378
			//
379 379
			//				this.syncExec(new Runnable() {
......
411 411
	}
412 412

  
413 413
	public static boolean firstLaunchAfterInstallation() {
414
		if (TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME) == null || TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME).trim().equals("")) {
414
		if (TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE).trim().isEmpty()) {
415 415
			System.out.println("TXM Home directory preference not set.");
416 416
			return true;
417 417
		}
418
		File dir = new File(TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME).trim());
418
		File dir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE).trim());
419 419
		if (!dir.exists()) {
420 420
			System.out.println("TXM Home directory is set but does not exist.");
421 421
			return true;
......
493 493
	private boolean loadInstallPreferences(JobHandler jobHandler) {
494 494
		try {
495 495
			// check if the install preference file has been loaded
496
			if ((TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR) == null)
497
					|| (TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR).equals("")) //$NON-NLS-1$
498
					|| !new File(TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR)).exists()) {
496
			if (TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE).isEmpty()
497
					|| !new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE)).exists()) {
499 498
				Display.getDefault().syncExec(new Runnable() {
500 499
					@Override
501 500
					public void run() { OpenWelcomePage.openWelcomePage(); }
......
539 538
					TxmPreferences.importFromFile(preferenceFile);
540 539

  
541 540
				// restore previous TreeTagger preferences
542
				String ttpath = TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.TREETAGGER_INSTALL_PATH);
543
				String ttmodelpath = TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.TREETAGGER_MODELS_PATH);
541
				String ttpath = TXMPreferences.getString(TBXPreferences.TREETAGGER_INSTALL_PATH, TBXPreferences.PREFERENCES_NODE);
542
				String ttmodelpath = TXMPreferences.getString(TBXPreferences.TREETAGGER_MODELS_PATH, TBXPreferences.PREFERENCES_NODE);
544 543
				if (ttpath != null && ttpath.length() > 0) {
545 544
					TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.TREETAGGER_INSTALL_PATH, ttpath);
546 545
					TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.TREETAGGER_MODELS_PATH, ttmodelpath);
......
586 585
		@Override
587 586
		public void publish(final LogRecord record) {
588 587
			//System.out.println("severeDialobBoxHandler.publish()");
589
			boolean showSevereDialobBox = TXMPreferences.getBoolean(RCPPreferences.PREFERENCES_NODE, RCPPreferences.SHOW_SEVERE_DIALOG);
588
			boolean showSevereDialobBox = TXMPreferences.getBoolean(RCPPreferences.SHOW_SEVERE_DIALOG, RCPPreferences.PREFERENCES_NODE);
590 589
			if (showSevereDialobBox) {
591 590
				//System.out.println("SHOW SEVERE DIALOG BOX: "+record.getMessage());
592 591
				TXMWindows.getActiveWindow().getShell().getDisplay().syncExec(new Runnable() {
......
633 632

  
634 633
			try {
635 634
				Log.info("Checking TXM install directory.");
636
				installDirectory = new File(TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR));
635
				installDirectory = new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE));
637 636
				if (!installDirectory.exists()) { // the TXM install directory could not be read !! :o
638 637
					Display.getDefault().syncExec(new Runnable() {
639 638
						@Override
......
652 651
					Log.severe("Error: The provided install directory does not exists. Aborting.");
653 652
					return false;
654 653
				}
655
				Log.info(NLS.bind(Messages.ApplicationWorkbenchAdvisor_8, TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR)));
654
				Log.info(NLS.bind(Messages.ApplicationWorkbenchAdvisor_8, TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE)));
656 655

  
657 656
				Log.info("Checking TXM user directory.");
658
				if (TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME) == null 
659
						|| TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME).trim().equals("")) { //$NON-NLS-1$
657
				if (TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE).trim().isEmpty()) {
660 658
					txmhomedir = new File(System.getProperty("user.home"), "TXM"); //$NON-NLS-1$ //$NON-NLS-2$
661 659
				} else {
662
					txmhomedir = new File(TXMPreferences.getString(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME).trim());
660
					txmhomedir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE).trim());
663 661
				}
664 662
				txmhomedir.mkdirs(); // creates the directory if needed
665 663
				
tmp/org.txm.rcp/src/main/java/org/txm/rcp/AdapterFactory.java (revision 441)
39 39
import org.eclipse.ui.model.IWorkbenchAdapter;
40 40
import org.eclipse.ui.plugin.AbstractUIPlugin;
41 41
import org.txm.concordance.core.functions.Concordance;
42
import org.txm.core.results.ITXMResult;
42
import org.txm.core.results.TXMResult;
43 43
import org.txm.functions.internal.InternalView;
44 44
import org.txm.functions.intertextualdistance.InterTextDistance;
45 45
//import org.txm.functions.queryindex.QueryIndex;
......
120 120
		@Override
121 121
		public Object[] getChildren(Object corpus) {
122 122
			//List<Subcorpus> subcorpora = ((Corpus) corpus).getSubcorpora();
123
			ArrayList<ITXMResult> results = ((Corpus) corpus).getResults(true);
123
			ArrayList<TXMResult> results = ((Corpus) corpus).getResults(true);
124 124
			for (int i = 0; i < results.size(); i++) {
125 125
				Object result = results.get(i);
126 126
				
......
168 168

  
169 169
		@Override
170 170
		public Object[] getChildren(Object partition) {
171
			ArrayList<ITXMResult> children = ((Partition) partition).getResults();
171
			ArrayList<TXMResult> children = ((Partition) partition).getResults();
172 172
			// System.out.println("PARTITION RESULTS "+children);
173 173
			return children.toArray();
174 174
		}
tmp/org.txm.rcp/plugin.xml (revision 441)
3602 3602
                        ifEmpty="false"
3603 3603
                        operator="and">
3604 3604
                     <instanceof
3605
                           value="org.txm.core.results.ITXMResult">
3605
                           value="org.txm.core.results.TXMResult">
3606 3606
                     </instanceof>
3607 3607
                  </iterate>
3608 3608
               </with>

Also available in: Unified diff