Révision 3579

TXM/trunk/org.txm.conllu.rcp/src/org/txm/conllu/rcp/importsection/CoNLLUSection.java (revision 3579)
23 23
	
24 24
	private static final int SECTION_SIZE = 1;
25 25
	
26
	Button buildTIGERIndexesButton;
26 27
	Button useNewDocIdButton;
27 28
	Button keepWordContractionsButton;
28 29
	Text udPropertiesPrefixButton;
......
64 65
		sectionClient.setLayout(slayout);
65 66
		this.section.setClient(sectionClient);
66 67
		
67
		useNewDocIdButton = toolkit.createButton(sectionClient, "Use new doc id when importing CoNLL-U files", SWT.CHECK);
68
		buildTIGERIndexesButton = toolkit.createButton(sectionClient, "Build TIGERSearch indexes as well", SWT.CHECK);
68 69
		TableWrapData gdata2 = getButtonLayoutData();
69 70
		gdata2.colspan = 4; // one line
71
		buildTIGERIndexesButton.setLayoutData(gdata2);
72
		
73
		useNewDocIdButton = toolkit.createButton(sectionClient, "Use new doc id when importing CoNLL-U files", SWT.CHECK);
74
		gdata2 = getButtonLayoutData();
75
		gdata2.colspan = 4; // one line
70 76
		useNewDocIdButton.setLayoutData(gdata2);
71 77
		
72 78
		keepWordContractionsButton = toolkit.createButton(sectionClient, "Keep word contractions when importing CoNLL-U files", SWT.CHECK);
......
104 110
		if (this.section.isDisposed()) return;
105 111
		if (project == null) return;
106 112
		
107
		Preferences customNode = project.getImportParameters().node("conllu");
113
		Preferences customNode = project.getPreferencesScope().getNode(UDPreferences.getInstance().getPreferencesNodeQualifier());
108 114
		
109
		useNewDocIdButton.setSelection(customNode.getBoolean(UDPreferences.IMPORT_USE_NEW_DOC_ID, true)); //$NON-NLS-1$
110
		keepWordContractionsButton.setSelection(customNode.getBoolean(UDPreferences.KEEP_CONTRACTIONS, true)); //$NON-NLS-1$
115
		buildTIGERIndexesButton.setSelection(customNode.getBoolean(UDPreferences.IMPORT_BUILD_TIGERSEARCH_INDEXES, UDPreferences.getInstance().getBoolean(UDPreferences.IMPORT_BUILD_TIGERSEARCH_INDEXES))); //$NON-NLS-1$
116
		useNewDocIdButton.setSelection(customNode.getBoolean(UDPreferences.IMPORT_USE_NEW_DOC_ID, UDPreferences.getInstance().getBoolean(UDPreferences.IMPORT_USE_NEW_DOC_ID))); //$NON-NLS-1$
117
		keepWordContractionsButton.setSelection(customNode.getBoolean(UDPreferences.KEEP_CONTRACTIONS, UDPreferences.getInstance().getBoolean(UDPreferences.KEEP_CONTRACTIONS))); //$NON-NLS-1$
111 118
		udPropertiesPrefixButton.setText(customNode.get(UDPreferences.UDPREFIX, "")); //$NON-NLS-1$
112
		headPropertiesText.setText(customNode.get(UDPreferences.IMPORT_HEAD_TO_PROJECT, "upos,deprel")); //$NON-NLS-1$
113
		depsPropertiesText.setText(customNode.get(UDPreferences.IMPORT_DEPS_TO_PROJECT, "upos,deprel")); //$NON-NLS-1$
119
		headPropertiesText.setText(customNode.get(UDPreferences.IMPORT_HEAD_TO_PROJECT, UDPreferences.getInstance().getString(UDPreferences.IMPORT_HEAD_TO_PROJECT))); //$NON-NLS-1$
120
		depsPropertiesText.setText(customNode.get(UDPreferences.IMPORT_DEPS_TO_PROJECT, UDPreferences.getInstance().getString(UDPreferences.IMPORT_DEPS_TO_PROJECT))); //$NON-NLS-1$
114 121
	}
115 122
	
116 123
	@Override
117 124
	public boolean saveFields(Project project) {
118 125
		if (this.section != null && !this.section.isDisposed()) {
119 126
			
120
			Preferences customNode = project.getImportParameters().node("conllu");
121
			customNode.putBoolean(UDPreferences.IMPORT_USE_NEW_DOC_ID, useNewDocIdButton.getSelection()); //$NON-NLS-1$
122
			customNode.putBoolean(UDPreferences.KEEP_CONTRACTIONS, keepWordContractionsButton.getSelection()); //$NON-NLS-1$
123
			customNode.put(UDPreferences.UDPREFIX, udPropertiesPrefixButton.getText()); //$NON-NLS-1$
124
			customNode.put(UDPreferences.IMPORT_HEAD_TO_PROJECT, headPropertiesText.getText()); //$NON-NLS-1$
125
			customNode.put(UDPreferences.IMPORT_DEPS_TO_PROJECT, depsPropertiesText.getText()); //$NON-NLS-1$
127
			Preferences customNode = project.getPreferencesScope().getNode(UDPreferences.getInstance().getPreferencesNodeQualifier());
128
			customNode.putBoolean(UDPreferences.IMPORT_BUILD_TIGERSEARCH_INDEXES, buildTIGERIndexesButton.getSelection());
129
			customNode.putBoolean(UDPreferences.IMPORT_USE_NEW_DOC_ID, useNewDocIdButton.getSelection());
130
			customNode.putBoolean(UDPreferences.KEEP_CONTRACTIONS, keepWordContractionsButton.getSelection());
131
			customNode.put(UDPreferences.UDPREFIX, udPropertiesPrefixButton.getText());
132
			customNode.put(UDPreferences.IMPORT_HEAD_TO_PROJECT, headPropertiesText.getText());
133
			customNode.put(UDPreferences.IMPORT_DEPS_TO_PROJECT, depsPropertiesText.getText());
126 134
		}
127 135
		return true;
128 136
	}
TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 3579)
2036 2036
	////
2037 2037
	// end of fixme
2038 2038
	
2039
	public String getProjectPreferenceValue(Project project, String key) {
2040
		String defaultValue = this.getString(key);
2041
		return getProjectPreferenceValue(project, key, defaultValue);
2042
	}
2043
	
2039 2044
	public String getProjectPreferenceValue(Project project, String key, String defaultValue) {
2040 2045
		Preferences node = project.getPreferencesScope().getNode(commandPreferencesNodeQualifier);
2041 2046
		return node.get(key, defaultValue);
TXM/trunk/org.txm.conllu.core/groovy/org/txm/scripts/importer/conllu/CoNLLUImport.groovy (revision 3579)
49 49
		// build the TIGER-XML file
50 50
		CallUD2TigerPerlScript cutps = new CallUD2TigerPerlScript();
51 51
		
52
		boolean buildtigerindexes =  UDPreferences.getInstance().getString(UDPreferences.IMPORT_BUILD_TIGERSEARCH_INDEXES); // THE conllu -> Tiger XSL MUST HAVE THE SAME BEHAVIOR BEFORE //
52
		boolean buildtigerindexes = "true".equals(UDPreferences.getInstance().getProjectPreferenceValue(this.project, UDPreferences.IMPORT_BUILD_TIGERSEARCH_INDEXES))
53 53
		if (!buildtigerindexes) {
54 54
			println "Skipping TIGER conversion step."
55 55
			return;
TXM/trunk/org.txm.conllu.core/groovy/org/txm/scripts/importer/conllu/CoNLLUImporter.groovy (revision 3579)
34 34
		
35 35
		File conlluSrcDirectory = inputDirectory
36 36
		
37
		boolean usenewdocid =  UDPreferences.getInstance().getString(UDPreferences.IMPORT_USE_NEW_DOC_ID); // THE conllu -> Tiger XSL MUST HAVE THE SAME BEHAVIOR BEFORE //
37
		boolean usenewdocid =  "true".equals(UDPreferences.getInstance().getProjectPreferenceValue(project, UDPreferences.IMPORT_USE_NEW_DOC_ID)); // THE conllu -> Tiger XSL MUST HAVE THE SAME BEHAVIOR BEFORE //
38 38
		
39 39
		if (usenewdocid) {
40 40
			conlluSrcDirectory = new File(outputDirectory.getParentFile().getParentFile(), "conllu")
......
118 118
		
119 119
		UDPreferences.getInstance().setProjectPreferenceValue(project, UDPreferences.UDPREFIX, prefix); // copy the current preference into the corpus preference
120 120
		
121
		boolean keepContractions =  UDPreferences.getInstance().getString(UDPreferences.KEEP_CONTRACTIONS)
121
		boolean keepContractions =  "true".equals(UDPreferences.getInstance().getProjectPreferenceValue(project, UDPreferences.KEEP_CONTRACTIONS, UDPreferences.getInstance().getString(UDPreferences.KEEP_CONTRACTIONS)));
122 122
		
123
		def headPropertiesToProject = UDPreferences.getInstance().getString(UDPreferences.IMPORT_HEAD_TO_PROJECT).split(",") as Set
123
		def headPropertiesToProject = UDPreferences.getInstance().getProjectPreferenceValue(project, UDPreferences.IMPORT_HEAD_TO_PROJECT, UDPreferences.getInstance().getString(UDPreferences.IMPORT_HEAD_TO_PROJECT)).split(",") as Set
124 124
		
125
		def depsPropertiesToProject = UDPreferences.getInstance().getString(UDPreferences.IMPORT_DEPS_TO_PROJECT).split(",") as Set
125
		def depsPropertiesToProject = UDPreferences.getInstance().getProjectPreferenceValue(project, UDPreferences.IMPORT_DEPS_TO_PROJECT, UDPreferences.getInstance().getString(UDPreferences.IMPORT_DEPS_TO_PROJECT)).split(",") as Set
126 126
		
127 127
		ConsoleProgressBar cpb_texts = new ConsoleProgressBar(files.size())
128 128
		
TXM/trunk/org.txm.rcp/plugin.xml (revision 3579)
30 30
      <product
31 31
            application="org.txm.rcp.Application"
32 32
            description="%product.description"
33
            name="%product.name.3">
33
            name="TXM 0.8.2">
34 34
         <property
35 35
               name="appName"
36 36
               value="TXM 0.8.2">

Formats disponibles : Unified diff