Révision 3467

TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/r/PrintRSymbolMacro.groovy (revision 3467)
1
package org.txm.macro.r;
2
// STANDARD DECLARATIONS
3

  
4
import org.kohsuke.args4j.*
5

  
6
import groovy.transform.Field
7

  
8
import org.txm.Toolbox
9
import org.txm.statsengine.r.core.RWorkspace
10
import org.txm.statsengine.r.core.RResult
11
import org.txm.core.results.TXMResult
12

  
13
if (editor != null) {
14
	println "editor: $editor"
15
}
16

  
17
def selection = corpusViewSelection
18
if (!(selection instanceof TXMResult)) {
19
	println "Selection is not a result. Aborting"
20
	return
21
}
22
def symbol = null;
23

  
24
if (selection instanceof RResult) {
25
	symbol = ((RResult)selection).getRSymbol();
26
//} else if (selection.getStringParameterValue("rsymbol").length() > 0) {
27
//	symbol = selection.getStringParameterValue("rsymbol")
28
} else {
29
	try {
30
		symbol = selection.getClass().getDeclaredMethod("getSymbol").invoke(selection)
31
	} catch(Exception e) {}
32
}
33

  
34
if (symbol != null) {
35
	println "R Name of $selection is: $symbol"
36
} else {
37
	println "$selection has no R representation"
38
}
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/r/PrintTableRSymbolAndSelectedLinesNamesMacro.groovy (revision 3467)
1
package org.txm.macro.r;
2
// STANDARD DECLARATIONS
3

  
4
import org.kohsuke.args4j.*
5

  
6
import groovy.transform.Field
7

  
8
import org.txm.Toolbox
9
import org.txm.statsengine.r.core.RWorkspace
10
import org.txm.statsengine.r.core.RResult
11
import org.txm.core.results.TXMResult
12

  
13
if (editor == null) {
14
	println "No active editor. Aborting"
15
	return
16
}
17

  
18
if (!(editor instanceof org.txm.lexicaltable.rcp.editors.LexicalTableEditor)) {
19
	println "Active editor is not a table lexical editor ($editor). Aborting"
20
	return
21
}
22

  
23
def table = editor.getResult()
24
println "R name is: "+table.getRSymbol()
25

  
26
monitor.syncExec(new Runnable() {
27
	public void run() {
28
		def selection = editor.getlineTableViewer().getSelection()
29
		def names = table.getRowNames().asStringsArray()
30
		println "Selection: "+selection.toList()
31
		println "Names: "+names[selection.toList()]
32
	}
33
});
34

  
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/r/CreateLexicalTableFromRSymbolMacro.groovy (revision 3467)
1
package org.txm.macro.r;
2
// STANDARD DECLARATIONS
3

  
4
import org.kohsuke.args4j.*
5
import groovy.transform.Field
6
import org.txm.Toolbox
7
import org.txm.statsengine.r.core.RWorkspace
8
import org.txm.statsengine.r.core.RResult
9
import org.txm.core.results.TXMResult
10
import org.kohsuke.args4j.*
11
import groovy.transform.Field
12
import org.txm.rcp.swt.widget.parameters.*
13
import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl
14
import org.txm.lexicaltable.core.functions.LexicalTable
15
import org.txm.searchengine.cqp.corpus.MainCorpus
16

  
17
def selection = corpusViewSelection
18
if (!(selection instanceof TXMResult)) {
19
	println "Selection is not a result. Aborting"
20
	return
21
}
22

  
23
@Field @Option(name="r_table_symbol", usage="R symbol of the R table to import", widget="String", required=false, def="")
24
def r_table_symbol
25

  
26
if (!ParametersDialog.open(this)) return
27

  
28
if (!RWorkspace.getRWorkspaceInstance().containsVariable(r_table_symbol)) {
29
	println "Error: no R object found for symbol '$r_table_symbol'"
30
	return
31
}
32
def corpus = corpusViewSelection
33
if (!(corpus instanceof MainCorpus)) {
34
	corpus = corpus.getFirstParent(MainCorpus.class)
35
}
36

  
37
def lt = new LexicalTable(corpus);
38
lt.setData(new LexicalTableImpl(r_table_symbol))
39
lt.compute()
40

  
41
monitor.syncExec(new Runnable() {
42
	public void run() {
43
		org.txm.rcp.views.corpora.CorporaView.reload()
44
	}
45
});
TXM/trunk/org.txm.whatsnew.rcp/src/org/txm/whatsnew/rcp/NewsPreferences.java (revision 3467)
30 30
		super.initializeDefaultPreferences();
31 31
		
32 32
		Preferences preferences = this.getDefaultPreferencesNode();
33
		preferences.putBoolean(SHOW_NEWS, false); // $NON-NLS-1$
33
		preferences.putBoolean(SHOW_NEWS, false);
34 34
		preferences.put(NEWS_VERSION, "0"); // $NON-NLS-1$
35 35
		
36
		preferences.putBoolean(SHOW_NEW_SETUP, true); // $NON-NLS-1$
37
		preferences.put(NEW_SETUP_VERSION, "0"); // $NON-NLS-1$
36
		preferences.putBoolean(SHOW_NEW_SETUP, true);
37
		preferences.put(NEW_SETUP_VERSION, "0.8.2"); // $NON-NLS-1$
38 38
	}
39 39
}
TXM/trunk/org.txm.whatsnew.rcp/src/org/txm/whatsnew/rcp/DoWhatsNewSetupStep.java (revision 3467)
32 32
			String lastNewSetupVersionString = NewsEditor.getLastSetupVersion();
33 33
			
34 34
			String currentShownNewSetupVersionString = NewsPreferences.getInstance().getString(NewsPreferences.NEW_SETUP_VERSION);
35
			if (currentShownNewSetupVersionString.compareTo(lastNewSetupVersionString) > 0) { // the current version should be greater or equal to the last nest version
35
			if (currentShownNewSetupVersionString.compareTo(lastNewSetupVersionString) > 0) { // the current version should be greater or equal to the last newest version
36 36
				currentShownNewSetupVersionString = lastNewSetupVersionString;
37 37
			}
38 38
			NewsPreferences.getInstance().put(NewsPreferences.NEW_SETUP_VERSION, lastNewSetupVersionString);
TXM/trunk/org.txm.whatsnew.rcp/src/org/txm/whatsnew/rcp/NewsPreferencesPage.java (revision 3467)
24 24
		//this.addField(new BooleanFieldEditor(NewsPreferences.SHOW_NEWS, "Show news when TXM starts up", this.getFieldEditorParent()));
25 25
		
26 26
		this.addField(new BooleanFieldEditor(NewsPreferences.SHOW_NEW_SETUP, "Announce the availability of new versions of TXM/Annoncer la disponibilité de nouvelles versions de TXM", this.getFieldEditorParent()));
27
		
27
		this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEW_SETUP_VERSION, "Current new setup version index", this.getFieldEditorParent()));
28 28
		// enable if dev needs to update the NEWS_VERSION value
29 29
		if (RCPPreferences.getInstance().getBoolean(RCPPreferences.EXPERT_USER)) {
30 30
			this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEWS_VERSION, "Current news index", this.getFieldEditorParent()));
31
			this.addField(new org.eclipse.jface.preference.StringFieldEditor(NewsPreferences.NEW_SETUP_VERSION, "Current new setup index", this.getFieldEditorParent()));
31
			
32 32
		}
33 33
	}
34 34
}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3467)
1206 1206
									
1207 1207
									jobHandler.setTaskName(TXMUIMessages.toolboxReady);
1208 1208
								}
1209
								catch (Exception e) {
1210
									// TODO Auto-generated catch block
1209
								catch (Throwable e) {
1210
									System.out.println("Initialisation error: "+e);
1211 1211
									e.printStackTrace();
1212 1212
								}
1213 1213
							}
1214 1214
							
1215 1215
							monitor.done();
1216 1216
						}
1217
						
1218
						
1219 1217
					});
1220 1218
					
1221 1219
					Log.fine(TXMUIMessages.loadingViews);
......
1241 1239
			return subversion;
1242 1240
		}
1243 1241
		catch (IOException e) {
1244
			// TODO Auto-generated catch block
1245 1242
			e.printStackTrace();
1246 1243
		}
1247 1244
		return "STABLE"; //$NON-NLS-1$
TXM/trunk/org.txm.rcp/SUBVERSION (revision 3467)
1
beta
TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java (revision 3467)
1144 1144
				
1145 1145
				rcpProject.delete(true, true, new LogMonitor("Cleaning " + this));
1146 1146
				
1147
				rcpProject.refreshLocal(IResource.DEPTH_INFINITE, new LogMonitor("Refresh workspace " + this));
1148
				
1147 1149
				// Toolbox.getEngineManager(EngineType.SEARCH).getEngine("CQP").start(null); //$NON-NLS-1$
1148 1150
			}
1149 1151
			catch (Exception e) {

Formats disponibles : Unified diff