Revision 1059
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/chartsengine/events/ProgressionEventCallBack.java (revision 1059) | ||
---|---|---|
34 | 34 |
import org.txm.objects.Text; |
35 | 35 |
import org.txm.progression.core.chartsengine.base.ProgressionChartCreator; |
36 | 36 |
import org.txm.progression.core.functions.Progression; |
37 |
import org.txm.progression.rcp.messages.ProgressionUIMessages; |
|
37 | 38 |
import org.txm.rcp.editors.TXMResultEditorInput; |
38 | 39 |
import org.txm.rcp.utils.SWTEditorsUtils; |
39 | 40 |
import org.txm.searchengine.cqp.corpus.Corpus; |
... | ... | |
163 | 164 |
public void updateLinkedConcordanceEditor(ArrayList<EditorPart> linkedEditors, final ArrayList<Integer> selectedPointPositions) { |
164 | 165 |
|
165 | 166 |
// Debug |
166 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(): linked editors count: " + linkedEditors.size()); |
|
167 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(): linked editors count: " + linkedEditors.size()); //$NON-NLS-1$
|
|
167 | 168 |
|
168 | 169 |
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); |
169 | 170 |
IWorkbenchPage page = window.getActivePage(); |
... | ... | |
177 | 178 |
String query = ((Progression) chartEditor.getResult()).getQueries().get(lastSelectedSeries).getQueryString(); |
178 | 179 |
|
179 | 180 |
// Remove "[" and "]" only if it's a simple query as "[faire]" |
180 |
if(query.startsWith("[") && !query.contains("=")) { |
|
181 |
if(query.startsWith("[") && !query.contains("=")) { //$NON-NLS-1$ //$NON-NLS-2$
|
|
181 | 182 |
int length = query.length(); |
182 |
if(query.endsWith("]")) { |
|
183 |
if(query.endsWith("]")) { //$NON-NLS-1$
|
|
183 | 184 |
length--; |
184 | 185 |
} |
185 | 186 |
query = query.substring(1, length); |
... | ... | |
232 | 233 |
position = EModelService.RIGHT_OF; |
233 | 234 |
parentEditor = linkedEditors.get(linkedEditors.size() - 1); |
234 | 235 |
|
235 |
System.err.println("ProgressionEventCallBack.updateLinkedConcordanceEditor(): parent editor for splitting: " + parentEditor); |
|
236 |
System.err.println("ProgressionEventCallBack.updateLinkedConcordanceEditor(): parent editor for splitting: " + parentEditor); //$NON-NLS-1$
|
|
236 | 237 |
} |
237 | 238 |
// Split and add linked editor |
238 | 239 |
SWTEditorsUtils.addEditor(parentEditor, linkedEditor, position); |
... | ... | |
240 | 241 |
|
241 | 242 |
} |
242 | 243 |
catch (PartInitException e) { |
243 |
System.err.println("Error: "+e.getLocalizedMessage());
|
|
244 |
System.err.println(ProgressionUIMessages.ProgressionEventCallBack_error+e.getLocalizedMessage());
|
|
244 | 245 |
} |
245 | 246 |
|
246 | 247 |
// Compute the concordance if it has never been computed |
... | ... | |
332 | 333 |
tableViewer.setSelection(new StructuredSelection(line), true); |
333 | 334 |
// FIXME: commented because the set top index makes the read of the table difficult |
334 | 335 |
//tableViewer.getTable().setTopIndex(selectedPointInTableRange); |
335 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(...).new Runnable() {...}.run(): Selecting progression point (" + selectedPointInTableRange + " / " + tableViewer.getTable().getItemCount() + ") in the linked Concordance table."); |
|
336 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(...).new Runnable() {...}.run(): Selecting progression point (" + selectedPointInTableRange + " / " + tableViewer.getTable().getItemCount() + ") in the linked Concordance table."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
336 | 337 |
} |
337 | 338 |
else { |
338 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(...).new Runnable() {...}.run(): Selected progression point (" + selectedPointInTableRange + " / " + tableViewer.getTable().getItemCount() + ") doesn't exist in the linked Concordance table."); |
|
339 |
Log.finest("ProgressionEventCallBack.updateLinkedConcordanceEditor(...).new Runnable() {...}.run(): Selected progression point (" + selectedPointInTableRange + " / " + tableViewer.getTable().getItemCount() + ") doesn't exist in the linked Concordance table."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
339 | 340 |
} |
340 | 341 |
} |
341 | 342 |
}); |
... | ... | |
372 | 373 |
|
373 | 374 |
Text text = corpus.getText(textId); |
374 | 375 |
if(text == null) { |
375 |
Log.severe("Text " + textId + " is missing.");
|
|
376 |
Log.severe(ProgressionUIMessages.bind(ProgressionUIMessages.ProgressionEventCallBack_error_missing_text, textId));
|
|
376 | 377 |
return; |
377 | 378 |
} |
378 | 379 |
|
379 | 380 |
Edition edition = text.getEdition(corpus.getMainCorpus().getDefaultEdition()); |
380 | 381 |
|
381 | 382 |
if(edition == null) { |
382 |
Log.severe("Default edition is missing.");
|
|
383 |
Log.severe(ProgressionUIMessages.ProgressionEventCallBack_error_missing_default_edition);
|
|
383 | 384 |
return; |
384 | 385 |
} |
385 | 386 |
|
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/preferences/ProgressionPreferencePage.java (revision 1059) | ||
---|---|---|
38 | 38 |
import org.txm.rcp.jface.DoubleFieldEditor; |
39 | 39 |
import org.txm.rcp.preferences.TXMPreferencePage; |
40 | 40 |
import org.txm.rcp.preferences.TXMPreferenceStore; |
41 |
import org.txm.utils.logger.Log; |
|
41 | 42 |
|
42 | 43 |
/** |
43 | 44 |
* Progression preference page. |
... | ... | |
70 | 71 |
|
71 | 72 |
// other shared preferences |
72 | 73 |
SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab); |
73 |
|
|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
@Override |
77 | 77 |
public void init(IWorkbench workbench) { |
78 |
System.out.println("ProgressionPreferencePage.init()" + ProgressionPreferences.CHART_CUMULATIVE);
|
|
78 |
Log.info("ProgressionPreferencePage.init()" + ProgressionPreferences.CHART_CUMULATIVE); // $NON-NLS-1$
|
|
79 | 79 |
|
80 | 80 |
//this.setPreferenceStore(new TXMPreferenceStore(ProgressionPreferences.PREFERENCES_NODE)); |
81 | 81 |
//System.out.println("ProgressionPreferences.getInstance() " + ProgressionPreferences.PREFERENCES_NODE); |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/adapters/ProgressionAdapterFactory.java (revision 1059) | ||
---|---|---|
20 | 20 |
|
21 | 21 |
public static final ImageDescriptor ICON = |
22 | 22 |
AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(ProgressionAdapterFactory.class).getSymbolicName(), |
23 |
"platform:/plugin/"+ FrameworkUtil.getBundle(ProgressionAdapterFactory.class).getSymbolicName() + "/icons/functions/progression.png"); //$NON-NLS-1$ |
|
23 |
"platform:/plugin/"+ FrameworkUtil.getBundle(ProgressionAdapterFactory.class).getSymbolicName() + "/icons/functions/progression.png"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
24 | 24 |
|
25 | 25 |
@Override |
26 | 26 |
public Object getAdapter(Object adaptableObject, Class adapterType) { |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/ProgressionUIMessages.java (revision 1059) | ||
---|---|---|
14 | 14 |
|
15 | 15 |
private static final String BUNDLE_NAME = "org.txm.progression.rcp.messages.messages"; //$NON-NLS-1$ |
16 | 16 |
|
17 |
public static String ProgressionEventCallBack_error; |
|
18 |
public static String ProgressionEventCallBack_error_missing_default_edition; |
|
19 |
public static String ProgressionEventCallBack_error_missing_text; |
|
20 |
|
|
21 |
public static String common_ok; |
|
22 |
|
|
17 | 23 |
public static String ProgressionPreferencePage_3; |
18 | 24 |
public static String ProgressionPreferencePage_6; |
19 | 25 |
public static String ProgressionPreferencePage_7; |
... | ... | |
27 | 33 |
public static String ProgressionDialog_7; |
28 | 34 |
|
29 | 35 |
|
36 |
public static String ProgressionEditor_add; |
|
37 |
|
|
38 |
public static String ProgressionEditor_add_queries_from_file; |
|
39 |
|
|
40 |
public static String ProgressionEditor_no_query; |
|
41 |
|
|
42 |
public static String ProgressionEditor_queries; |
|
43 |
|
|
44 |
public static String ProgressionEditor_query; |
|
45 |
|
|
46 |
public static String ProgressionEditor_select_property_file; |
|
47 |
|
|
48 |
public static String error_error2; |
|
49 |
|
|
30 | 50 |
public static String error_theQueryIsAlreadyRepresentedByACurveInTheGraphic; |
51 |
|
|
52 |
public static String preferences_multipleLineStrokeStyles; |
|
31 | 53 |
|
32 | 54 |
static { |
33 | 55 |
// initializes resource bundle |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/messages/messages.properties (revision 1059) | ||
---|---|---|
1 | 1 |
|
2 |
common_ok= |
|
2 | 3 |
ProgressionDialog_1 = Chart type: |
3 | 4 |
ProgressionDialog_11 = Bandewidth multiplier: |
4 | 5 |
ProgressionDialog_15 = Repeat same values |
... | ... | |
6 | 7 |
ProgressionDialog_2 = cumulative |
7 | 8 |
ProgressionDialog_3 = density |
8 | 9 |
ProgressionDialog_7 = Regex: |
10 |
ProgressionEditor_add=Add |
|
11 |
ProgressionEditor_add_queries_from_file=Add queries from file... |
|
12 |
ProgressionEditor_no_query=No query - |
|
13 |
ProgressionEditor_queries=\ queries - |
|
14 |
ProgressionEditor_query=\ query - |
|
15 |
ProgressionEditor_select_property_file=Select an UTF-8 property file |
|
9 | 16 |
|
10 | 17 |
ProgressionPreferencePage_3 = Default chart type is cumulative |
11 | 18 |
ProgressionPreferencePage_6 = Repeat the values of the structure properties |
12 | 19 |
ProgressionPreferencePage_7 = Bande size multiplier |
13 | 20 |
|
21 |
error_error2= |
|
14 | 22 |
error_theQueryIsAlreadyRepresentedByACurveInTheGraphic = The query {0} is already represented by a curve in the graphic. Please use another query. |
23 |
preferences_multipleLineStrokeStyles= |
|
24 |
|
|
25 |
ProgressionEventCallBack_error=Error: |
|
26 |
ProgressionEventCallBack_error_missing_default_edition=Default edition is missing. |
|
27 |
ProgressionEventCallBack_error_missing_text=Text {0} is missing. |
tmp/org.txm.progression.rcp/src/org/txm/progression/rcp/editors/ProgressionEditor.java (revision 1059) | ||
---|---|---|
180 | 180 |
getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); |
181 | 181 |
|
182 | 182 |
miniInfoLabel = new Label(getMainParametersComposite(), SWT.NONE); |
183 |
miniInfoLabel.setText("No query - ");
|
|
183 |
miniInfoLabel.setText(ProgressionUIMessages.ProgressionEditor_no_query);
|
|
184 | 184 |
miniInfoLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); |
185 | 185 |
|
186 | 186 |
// Label queryLabel = new Label(getMainParametersComposite(), SWT.NONE); |
... | ... | |
204 | 204 |
}); |
205 | 205 |
|
206 | 206 |
Button addNewQueryButton = new Button(getMainParametersComposite(), SWT.PUSH); |
207 |
addNewQueryButton.setText("Add");
|
|
207 |
addNewQueryButton.setText(ProgressionUIMessages.ProgressionEditor_add);
|
|
208 | 208 |
addNewQueryButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false)); |
209 | 209 |
addNewQueryButton.addSelectionListener(new SelectionListener() { |
210 | 210 |
|
... | ... | |
339 | 339 |
// add queries from file button |
340 | 340 |
Button addQueriesFromFileButton = new Button(queriesFocusComposite, SWT.NONE); |
341 | 341 |
addQueriesFromFileButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false)); |
342 |
addQueriesFromFileButton.setText("Add queries from file...");
|
|
342 |
addQueriesFromFileButton.setText(ProgressionUIMessages.ProgressionEditor_add_queries_from_file);
|
|
343 | 343 |
|
344 | 344 |
addQueriesFromFileButton.addListener(SWT.Selection, new Listener() { |
345 | 345 |
@Override |
346 | 346 |
public void handleEvent(Event event) { |
347 | 347 |
FileDialog dialog = new FileDialog(event.display.getActiveShell(), SWT.OPEN); |
348 |
dialog.setText("Select an UTF-8 property file");
|
|
348 |
dialog.setText(ProgressionUIMessages.ProgressionEditor_select_property_file);
|
|
349 | 349 |
String path = dialog.open(); |
350 | 350 |
if (path != null) { |
351 | 351 |
Properties props = new Properties(); |
... | ... | |
382 | 382 |
*/ |
383 | 383 |
public boolean onPlusButtonPressed(Event event, String query) { |
384 | 384 |
if (colors.length > queryWidgets.size() && !queryExists(query)) { |
385 |
Log.finest("Adding query field."); |
|
385 |
Log.finest("Adding query field."); //$NON-NLS-1$
|
|
386 | 386 |
|
387 | 387 |
QueryField qf = addFocusQueryField(query); |
388 | 388 |
sc1.layout(true); |
... | ... | |
400 | 400 |
*/ |
401 | 401 |
public void updateMiniInfoLabelText() { |
402 | 402 |
if (queryWidgets.size() == 0) { |
403 |
miniInfoLabel.setText("No query - ");
|
|
403 |
miniInfoLabel.setText(ProgressionUIMessages.ProgressionEditor_no_query);
|
|
404 | 404 |
} |
405 | 405 |
else if (queryWidgets.size() == 1) { |
406 |
miniInfoLabel.setText(queryWidgets.size() + " query - ");
|
|
406 |
miniInfoLabel.setText(queryWidgets.size() + ProgressionUIMessages.ProgressionEditor_query);
|
|
407 | 407 |
} |
408 | 408 |
else { |
409 |
miniInfoLabel.setText(queryWidgets.size() + " queries - ");
|
|
409 |
miniInfoLabel.setText(queryWidgets.size() + ProgressionUIMessages.ProgressionEditor_queries);
|
|
410 | 410 |
} |
411 | 411 |
} |
412 | 412 |
|
Also available in: Unified diff