Révision 3451

TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportFormEditor.java (revision 3451)
141 141
		if (f != null) {
142 142
			String filepath = f.getPath();
143 143
			String importName = new File(txmhome, filepath).getName();
144
			if (importName.indexOf(".Loader.groovy") > 0) {
145
				importName = importName.substring(0, importName.indexOf(".Loader.groovy"));
144
			if (importName.indexOf("Loader.groovy") > 0) {
145
				importName = importName.substring(0, importName.indexOf("Loader.groovy"));
146 146
			}
147 147
			this.setImportName(importName);
148 148
		} else { // use the corpora view selection
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 3451)
849 849
		line4.setLayout(hLayout);
850 850
		toolkit.createLabel(line4, ""+(n++)+".", SWT.WRAP); //$NON-NLS-1$ //$NON-NLS-2$
851 851
		Hyperlink hyperlink3 = toolkit.createHyperlink(line4, TXMUIMessages.startCorpusImport, SWT.WRAP);
852
		if (editor.project == null) {
852
		if (editor.getUpdateMode()) {
853 853
			hyperlink3.setText(TXMUIMessages.StartCorpusUpdate);
854 854
		}
855 855
		hyperlink3.addHyperlinkListener(startImportListener);
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/input/ImportFormEditorInput.java (revision 3451)
74 74
		
75 75
		if (scriptFile != null) {
76 76
			String importName = scriptFile.getName();
77
			if (importName.indexOf(".Loader.groovy") > 0) {
78
				importName = importName.substring(0, importName.indexOf(".Loader.groovy"));
77
			if (importName.indexOf("Loader.groovy") > 0) {
78
				importName = importName.substring(0, importName.indexOf("Loader.groovy"));
79 79
			}
80 80
			return importName;
81 81
		} else {
TXM/trunk/org.txm.core/src/java/org/txm/objects/Workspace.java (revision 3451)
36 36
import org.eclipse.core.resources.IWorkspaceRoot;
37 37
import org.eclipse.core.resources.ResourcesPlugin;
38 38
import org.eclipse.core.runtime.CoreException;
39
import org.eclipse.core.runtime.IPath;
40 39
import org.eclipse.core.runtime.IProgressMonitor;
41 40
import org.eclipse.core.runtime.Path;
42 41
import org.eclipse.osgi.util.NLS;
......
114 113
	 * Instantiates a new workspace.
115 114
	 *
116 115
	 * @param xmlproject the xmlproject
116
	 * @throws CoreException 
117 117
	 */
118
	private Workspace() {
118
	private Workspace() throws CoreException {
119 119
		super("ROOT");
120 120
		
121 121
		rcpWorkspace = ResourcesPlugin.getWorkspace();
122
		rcpWorkspace.getRoot().refreshLocal(org.eclipse.core.resources.IResource.DEPTH_INFINITE, null);
122 123
		root = rcpWorkspace.getRoot();
123 124
		corporaProject = root.getProject("corpora");
124 125
		
......
144 145
	
145 146
	public static Workspace getInstance() {
146 147
		if (Toolbox.workspace == null) {
147
			Toolbox.workspace = new Workspace();
148
			try {
149
				Toolbox.workspace = new Workspace();
150
			}
151
			catch (CoreException e) {
152
				e.printStackTrace();
153
				return null;
154
			}
148 155
		}
149 156
		
150 157
		return Toolbox.workspace;
......
247 254
			
248 255
			// load the project from the project .settings directory
249 256
			IWorkspace rcpWorkspace = ResourcesPlugin.getWorkspace();
250
			
251 257
			// rcpWorkspace.getRoot().refreshLocal(1, new LogMonitor());
252 258
			
253 259
			IProjectDescription description = rcpWorkspace.loadProjectDescription(new Path(binCorpusDir.getAbsolutePath() + "/.project"));
......
404 410
		Log.fine("Toolbox.initialize(): reloading projects...");
405 411
		
406 412
		IWorkspace rcpWorkspace = ResourcesPlugin.getWorkspace();
413
		rcpWorkspace.getRoot().refreshLocal(org.eclipse.core.resources.IResource.DEPTH_INFINITE, null);
407 414
		IProject corporaDirectory = rcpWorkspace.getRoot().getProject("corpora");
408 415
		
409 416
		if (!corporaDirectory.exists()) {
TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java (revision 3451)
409 409
				// Log.severe("Project._compute(): Import engine not found.");
410 410
				
411 411
				// no import set
412
				return true;
412
				Log.severe("Error: no improt module set. Aborting import.");
413
				return false;
413 414
			}
414 415
			
415 416
			Log.finest("RUNNING IMPORT MODULE WITH NAME = " + getImportModuleName());

Formats disponibles : Unified diff