Révision 877

tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java (revision 877)
113 113
			System.err.println(TXMUIMessages.ImportSelectedText_2);
114 114
			return null;
115 115
		}
116
		String txmhome = Toolbox.getTXMHOMEPATH();
116
		String txmhome = Toolbox.getTxmHomePath();
117 117
		new File(txmhome, "clipboard").mkdir(); //$NON-NLS-1$
118 118
		File clipboardDirectory = new File(txmhome, "clipboard/" + basename); //$NON-NLS-1$
119 119
		
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenBrowser.java (revision 877)
96 96

  
97 97
		if (file == null) {
98 98
			FileDialog dialog = new FileDialog(shell, SWT.OPEN);
99
			String txmhome = Toolbox.getTXMHOMEPATH();
99
			String txmhome = Toolbox.getTxmHomePath();
100 100
			if (LastOpened.getFile(ID) != null) {
101 101
				dialog.setFilterPath(LastOpened.getFolder(ID));
102 102
				dialog.setFileName(LastOpened.getFile(ID));
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java (revision 877)
130 130
	public boolean loadBinaryCorpusArchive(final File zipFile) throws ExecutionException {
131 131

  
132 132
		String filename = zipFile.getName();
133
		final File corporaDir = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
133
		final File corporaDir = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
134 134
		corporaDir.mkdir();
135 135

  
136 136
		if (!filename.endsWith(".txm") && !filename.endsWith(".zip")) { //$NON-NLS-1$ //$NON-NLS-2$
......
288 288

  
289 289
		//File txmregistry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
290 290
		//txmregistry.mkdir();
291
		File txmcorpora = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
291
		File txmcorpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
292 292
		txmcorpora.mkdir();
293 293

  
294 294
		Workspace w = org.txm.Toolbox.workspace;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/PurgeCorpora.java (revision 877)
73 73
			return;
74 74
		}
75 75
		
76
		String path = Toolbox.getTXMHOMEPATH();
76
		String path = Toolbox.getTxmHomePath();
77 77
		if (path == null || path.trim().length() == 0) {
78 78
			System.out.println(TXMUIMessages.PurgeCorpora_4);
79 79
			return;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java (revision 877)
33 33
				.getShell();
34 34
		DirectoryDialog dialog = new DirectoryDialog(shell);
35 35

  
36
		dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
36
		dialog.setFilterPath(Toolbox.getTxmHomePath());
37 37
		String path = dialog.open();
38 38

  
39
		final File corpora = new File(Toolbox.getTXMHOMEPATH(),
39
		final File corpora = new File(Toolbox.getTxmHomePath(),
40 40
				"corpora"); //$NON-NLS-1$
41 41
		final File indir = new File(path);
42 42
		final File outdir = new File(corpora, indir.getName() + 6);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java (revision 877)
42 42
	
43 43
	public static JobHandler update(final MainCorpus corpus) {
44 44
		
45
		String txmhome = Toolbox.getTXMHOMEPATH();
45
		String txmhome = Toolbox.getTxmHomePath();
46 46
		
47 47
		BaseParameters params = corpus.getBase().getBaseParameters();
48 48
		params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java (revision 877)
113 113
			protected IStatus run(IProgressMonitor monitor) {
114 114
				this.runInit(monitor);
115 115

  
116
				File corporaDirectory = new File(Toolbox.getTXMHOMEPATH(), "corpora");
116
				File corporaDirectory = new File(Toolbox.getTxmHomePath(), "corpora");
117 117
				if (!corporaDirectory.exists()) {
118 118
					System.out.println("Corpora directory not found. Aborting.");
119 119
					return Status.CANCEL_STATUS;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/tests/TestImports.java (revision 877)
83 83
	 */
84 84
	@Override
85 85
	public Object execute(ExecutionEvent event) throws ExecutionException {
86
		String txmhome = Toolbox.getTXMHOMEPATH();
86
		String txmhome = Toolbox.getTxmHomePath();
87 87
		final File scriptsdir = new File(txmhome, "scripts/import");
88 88
		// final File sourcesdir = new
89 89
		// File(System.getProperty("user.home"),"xml/TESTS");
......
131 131
			protected IStatus run(IProgressMonitor monitor) {
132 132
				this.runInit(monitor);
133 133
				try {
134
					String txmhome = Toolbox.getTXMHOMEPATH();
134
					String txmhome = Toolbox.getTxmHomePath();
135 135
					File outDir = new File(txmhome, "results/TESTS-imports");
136 136
					outDir.mkdirs();
137 137
					ArrayList<File> missings = new ArrayList<File>();
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/tests/TestImportLangs.java (revision 877)
49 49
	 */
50 50
	@Override
51 51
	public Object execute(ExecutionEvent event) throws ExecutionException {
52
		String txmhome = Toolbox.getTXMHOMEPATH();
52
		String txmhome = Toolbox.getTxmHomePath();
53 53
		final File scriptsdir = new File(txmhome, "scripts/import");
54 54

  
55 55
		System.out.println("Select the directory containing the source directories : "
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/Explorer.java (revision 877)
295 295
	 * @return true, if successful
296 296
	 */
297 297
	protected boolean CanDelete(File selectedItem) {
298
		File txmhome = new File(Toolbox.getTXMHOMEPATH());
299
		File scripts = new File(Toolbox.getTXMHOMEPATH(), "scripts"); //$NON-NLS-1$
300
		File corpora = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
298
		File txmhome = new File(Toolbox.getTxmHomePath());
299
		File scripts = new File(Toolbox.getTxmHomePath(), "scripts"); //$NON-NLS-1$
300
		File corpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
301 301
		//File registry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
302
		File workspaces = new File(Toolbox.getTXMHOMEPATH(), "workspaces"); //$NON-NLS-1$
303
		File xsl = new File(Toolbox.getTXMHOMEPATH(), "xsl"); //$NON-NLS-1$
304
		File samples = new File(Toolbox.getTXMHOMEPATH(), "samples"); //$NON-NLS-1$
302
		File workspaces = new File(Toolbox.getTxmHomePath(), "workspaces"); //$NON-NLS-1$
303
		File xsl = new File(Toolbox.getTxmHomePath(), "xsl"); //$NON-NLS-1$
304
		File samples = new File(Toolbox.getTxmHomePath(), "samples"); //$NON-NLS-1$
305 305
		if (selectedItem.equals(txmhome) || 
306 306
				selectedItem.equals(txmhome) ||
307 307
				selectedItem.equals(scripts) ||
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/MacroExplorer.java (revision 877)
78 78
	static public String ID = "org.txm.rcp.views.fileexplorer.MacroExplorer"; //$NON-NLS-1$
79 79

  
80 80
	/** The home. */
81
	private static String home = Toolbox.getTXMHOMEPATH(); 
81
	private static String home = Toolbox.getTxmHomePath(); 
82 82

  
83 83
	protected boolean showAll = false;
84 84
	
......
96 96
	public boolean isShowAll() {return showAll;}
97 97

  
98 98
	private static void initCurrentDirectory() {
99
		home = Toolbox.getTXMHOMEPATH(); 
99
		home = Toolbox.getTxmHomePath(); 
100 100
		if (home == null) home = System.getProperty("user.home"); //$NON-NLS-1$
101 101
		File scriptsDir = new File(home, "scripts"); //$NON-NLS-1$
102 102
		File currentRootDir = new File(scriptsDir, "macro/org/txm/macro"); //$NON-NLS-1$
......
163 163
		newMacro.addSelectionListener(new SelectionAdapter() {
164 164
			@Override
165 165
			public void widgetSelected(SelectionEvent e) {
166
				String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
166
				String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
167 167
				File currentRootDir = new File(scriptRootDir, "macro/org/txm/macro"); //$NON-NLS-1$
168 168
				currentRootDir.mkdirs();
169 169
				
......
281 281
	 * @return true, if successful
282 282
	 */
283 283
	protected boolean CanDelete(File selectedItem) {
284
		File txmhome = new File(Toolbox.getTXMHOMEPATH());
285
		File scripts = new File(Toolbox.getTXMHOMEPATH(), "scripts"); //$NON-NLS-1$
286
		File corpora = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
284
		File txmhome = new File(Toolbox.getTxmHomePath());
285
		File scripts = new File(Toolbox.getTxmHomePath(), "scripts"); //$NON-NLS-1$
286
		File corpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
287 287
		//File registry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
288
		File workspaces = new File(Toolbox.getTXMHOMEPATH(), "workspaces"); //$NON-NLS-1$
289
		File xsl = new File(Toolbox.getTXMHOMEPATH(), "xsl"); //$NON-NLS-1$
290
		File samples = new File(Toolbox.getTXMHOMEPATH(), "samples"); //$NON-NLS-1$
288
		File workspaces = new File(Toolbox.getTxmHomePath(), "workspaces"); //$NON-NLS-1$
289
		File xsl = new File(Toolbox.getTxmHomePath(), "xsl"); //$NON-NLS-1$
290
		File samples = new File(Toolbox.getTxmHomePath(), "samples"); //$NON-NLS-1$
291 291
		if (selectedItem.equals(txmhome) || 
292 292
				selectedItem.equals(txmhome) ||
293 293
				selectedItem.equals(scripts) ||
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/QueriesView.java (revision 877)
165 165
				File output = new File("queries.txt"); //$NON-NLS-1$
166 166

  
167 167
				FileDialog dialog = new FileDialog(arg0.display.getActiveShell(), SWT.SAVE);
168
				String txmhome = Toolbox.getTXMHOMEPATH();
168
				String txmhome = Toolbox.getTxmHomePath();
169 169
				if (LastOpened.getFile(ID) != null) {
170 170
					dialog.setFilterPath(LastOpened.getFolder(ID));
171 171
					dialog.setFileName(LastOpened.getFile(ID));
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/files/EditFile.java (revision 877)
65 65
	public Object execute(ExecutionEvent event) throws ExecutionException {
66 66

  
67 67
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
68
		String txmhome = Toolbox.getTXMHOMEPATH();
68
		String txmhome = Toolbox.getTxmHomePath();
69 69

  
70 70
		FileDialog dialog = new FileDialog(shell, SWT.OPEN);
71 71
		if (LastOpened.getFile(ID) != null) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyMacro.java (revision 877)
103 103
			dialog.setFilterExtensions(new String[] { "*.groovy" }); //$NON-NLS-1$
104 104

  
105 105
			IPreferencesService service = Platform.getPreferencesService();
106
			String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
106
			String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
107 107

  
108 108
			dialog.setFilterPath(scriptRootDir);
109 109
			result = dialog.open();
......
117 117
	
118 118
	public static void execute(String scriptpath, IWorkbenchPart page, ISelection selection) {
119 119
		IPreferencesService service = Platform.getPreferencesService();
120
		String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
120
		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
121 121
		File currentRootDir = new File(scriptRootDir, "macro"); //$NON-NLS-1$
122 122
		
123 123
		ExecuteGroovyScript.executeScript(currentRootDir, scriptpath, page, selection, false);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java (revision 877)
131 131
			dialog.setFilterExtensions(new String[] { "*.groovy" }); //$NON-NLS-1$
132 132

  
133 133
			IPreferencesService service = Platform.getPreferencesService();
134
			String scriptCurrentDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
134
			String scriptCurrentDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
135 135

  
136 136
			dialog.setFilterPath(scriptCurrentDir);
137 137
			result = dialog.open();
......
156 156
		//				ScriptPreferencePage.SCRIPT_ROOT_DIR,
157 157
		//				ScriptPreferenceInitializer.SCRIPT_ROOT_DIR_DEFAULT, null);
158 158
		//		
159
		String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
159
		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
160 160
		File currentRootDir = new File(scriptRootDir, "user"); //$NON-NLS-1$
161 161

  
162 162
		executeScript(currentRootDir, scriptpath, page, selection, modal);
......
210 210
//			//System.out.println("SCRIPT ROOT DIR CHANGED tmp="+tmp);
211 211
//		}
212 212

  
213
		String scriptsRootDirectories = Toolbox.getTXMHOMEPATH() + "/scripts";
213
		String scriptsRootDirectories = Toolbox.getTxmHomePath() + "/scripts";
214 214
		String dir = currentRootDir.getAbsolutePath();
215 215
		String path = scriptfile.getAbsolutePath();
216 216
		if (!path.startsWith(dir)) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteLastGroovyScript.java (revision 877)
82 82
			System.out.println(TXMUIMessages.ExecuteLastGroovyScript_1+lastScript);
83 83
		
84 84
		//IPreferencesService service = Platform.getPreferencesService();
85
		String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
85
		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
86 86
		File currentRootDir;
87 87
		if (macro) {
88 88
			currentRootDir = new File(scriptRootDir, "macro"); //$NON-NLS-1$
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java (revision 877)
104 104
		} else {
105 105
			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
106 106
			FileDialog dialog = new FileDialog(shell, SWT.SAVE);
107
			dialog.setFilterPath(Toolbox.getTXMHOMEPATH()+"/scripts/import");
107
			dialog.setFilterPath(Toolbox.getTxmHomePath()+"/scripts/import");
108 108
			filepath = dialog.open();
109 109
		}
110 110
		
......
151 151
			public void run() {	StatusLine.setMessage(TXMUIMessages.ExecuteScriptImport_0); }
152 152
		});
153 153

  
154
		final String txmhome = Toolbox.getTXMHOMEPATH();
154
		final String txmhome = Toolbox.getTxmHomePath();
155 155
		final File corporadir = new File(txmhome,"corpora"); //$NON-NLS-1$
156 156
		corporadir.mkdir(); // the binary corpus are stored here
157 157
		if (!corporadir.exists()) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportSVG.java (revision 877)
151 151
	public static void export(File infile) {
152 152
		// Shell shell =
153 153
		// HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
154
		String txmhome = Toolbox.getTXMHOMEPATH();
154
		String txmhome = Toolbox.getTxmHomePath();
155 155
		FileDialog dialog = new FileDialog(new Shell(), SWT.SAVE);
156 156
		if (LastOpened.getFile(ID) != null) {
157 157
			dialog.setFilterPath(LastOpened.getFolder(ID));
tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/GSERunner.java (revision 877)
63 63
		}
64 64
		
65 65
		if (scriptRootDir == null) {
66
			scriptRootDir = new File(Toolbox.getTXMHOMEPATH(), "scripts").getAbsolutePath();
66
			scriptRootDir = new File(Toolbox.getTxmHomePath(), "scripts").getAbsolutePath();
67 67
		}
68 68
		String[] roots = new String[] { 
69 69
				scriptRootDir+"/user/", //$NON-NLS-1$
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportFormEditor.java (revision 877)
128 128
		setSite(site);
129 129
		setInput(input);
130 130
		
131
		String txmhome = Toolbox.getTXMHOMEPATH();
131
		String txmhome = Toolbox.getTxmHomePath();
132 132
		String filepath = "scripts/import/" + ((ImportFormEditorInput) input).getGroovyFile().getName(); //$NON-NLS-1$ 
133 133
		this.setGroovyscript(new File(txmhome, filepath));
134 134
		
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java (revision 877)
131 131
						if (LastOpened.getFile(ID) != null) {
132 132
							dialog.setFilterPath(LastOpened.getFolder(ID));
133 133
						} else {
134
							dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
134
							dialog.setFilterPath(Toolbox.getTxmHomePath());
135 135
						}
136 136
						if (dialog.open() != null) {
137 137
							File imgDirectory = new File(dialog.getFilterPath());
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/FrontXSLSection.java (revision 877)
94 94
					dialog.setFilterPath(LastOpened.getFolder(ID));
95 95
					dialog.setFileName(LastOpened.getFile(ID));
96 96
				} else {
97
					dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
97
					dialog.setFilterPath(Toolbox.getTxmHomePath());
98 98
				}
99 99
				if (dialog.open() != null) {
100 100
					xsltfile = new File(dialog.getFilterPath(), dialog.getFileName());
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 877)
1009 1009
		if (lastOpenedSrcDir != null) {
1010 1010
			dialog.setFilterPath(lastOpenedSrcDir);
1011 1011
		} else if (lastOpenedSrcDir != null) {
1012
			dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
1012
			dialog.setFilterPath(Toolbox.getTxmHomePath());
1013 1013
		} else
1014 1014
			dialog.setFilterPath(new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE), "corpora").getAbsolutePath()); //$NON-NLS-1$
1015 1015

  
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java (revision 877)
94 94

  
95 95
		// initialize the properties file default values store
96 96
		defaultValues = new Properties();
97
		String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
97
		String scriptRootDir = Toolbox.getTxmHomePath() + "/scripts"; //$NON-NLS-1$
98 98
		File currentRootDir = new File(scriptRootDir, "macro"); //$NON-NLS-1$
99 99

  
100 100
		propFile = new File(currentRootDir, this.script.replace(".", "/")+".properties");
tmp/org.txm.practically.rcp/META-INF/MANIFEST.MF (revision 877)
18 18
Bundle-Name: PracticallyMacro Plug-in
19 19
Bundle-ManifestVersion: 2
20 20
Bundle-Activator: practicallymacro.editormacros.Activator
21
Bundle-SymbolicName: PracticallyMacro;singleton:=true
21
Bundle-SymbolicName: org.txm.pratically.rcp;singleton:=true
22 22
Bundle-RequiredExecutionEnvironment: J2SE-1.5
23 23

  
tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 877)
165 165
	 * 
166 166
	 * @return the TXM working directory set with the USER_TXM_HOME preference key 
167 167
	 */
168
	public static String getTXMHOMEPATH() {
168
	public static String getTxmHomePath() {
169 169
		return getPreference(TBXPreferences.USER_TXM_HOME);
170 170
	}
171 171

  
tmp/org.txm.core/src/java/org/txm/objects/Corpus.java (revision 877)
570 570
	 */
571 571
	public File getBaseDirectory()
572 572
	{
573
		String txmhome = Toolbox.getTXMHOMEPATH();
573
		String txmhome = Toolbox.getTxmHomePath();
574 574
		Base base = this.getBase();
575 575
		if (base != null)
576 576
			return base.params.paramFile.getParentFile();

Formats disponibles : Unified diff