Révision 3698
TXM/trunk/bundles/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java (revision 3698) | ||
---|---|---|
513 | 513 |
// @Override |
514 | 514 |
// public void widgetDefaultSelected(SelectionEvent e) { } |
515 | 515 |
// }); |
516 |
Cursor cursor = new Cursor(text_text.getDisplay(), SWT.CURSOR_SIZENS); |
|
517 |
text_text.setCursor(cursor); |
|
516 |
if (!text_text.isDisposed()) { |
|
517 |
Cursor cursor = new Cursor(text_text.getDisplay(), SWT.CURSOR_SIZENS); |
|
518 |
text_text.setCursor(cursor); |
|
519 |
} |
|
518 | 520 |
} |
519 | 521 |
catch (Exception e2) { |
520 | 522 |
e2.printStackTrace(); |
TXM/trunk/bundles/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java (revision 3698) | ||
---|---|---|
287 | 287 |
editor.addLinkedEditor(attachedBrowserEditor); |
288 | 288 |
|
289 | 289 |
int position = SynopticEditionPreferences.getInstance().getInt(SynopticEditionPreferences.BACKTOTEXT_POSITION); |
290 |
SWTEditorsUtils.addEditor(editor, attachedBrowserEditor, position); |
|
290 |
if (editor != null && position >= 0) { |
|
291 |
SWTEditorsUtils.addEditor(editor, attachedBrowserEditor, position); |
|
292 |
} |
|
291 | 293 |
} |
292 | 294 |
|
293 | 295 |
// remove previous highlighted words |
TXM/trunk/bundles/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferences.java (revision 3698) | ||
---|---|---|
20 | 20 |
public static final String FAST_HIGHLIGHT = "fast_highlight"; //$NON-NLS-1$ |
21 | 21 |
|
22 | 22 |
/** |
23 |
* one of the EModelService position constant: ABOVE = 0 BELOW = 1 LEFT_OF = 2 RIGHT_OF = 3 |
|
23 |
* one of the EModelService position constant: OVER = -1 ABOVE = 0 BELOW = 1 LEFT_OF = 2 RIGHT_OF = 3
|
|
24 | 24 |
*/ |
25 | 25 |
public static final String BACKTOTEXT_POSITION = "backtotext_position"; //$NON-NLS-1$ |
26 | 26 |
|
... | ... | |
30 | 30 |
* @return the instance |
31 | 31 |
*/ |
32 | 32 |
public static TXMPreferences getInstance() { |
33 |
|
|
33 | 34 |
if (!TXMPreferences.instances.containsKey(SynopticEditionPreferences.class)) { |
34 | 35 |
new SynopticEditionPreferences(); |
35 | 36 |
} |
... | ... | |
39 | 40 |
@Override |
40 | 41 |
public void initializeDefaultPreferences() { |
41 | 42 |
super.initializeDefaultPreferences(); |
43 |
|
|
42 | 44 |
Preferences preferences = this.getDefaultPreferencesNode(); |
43 | 45 |
preferences.putBoolean(FAST_HIGHLIGHT, false); |
44 | 46 |
preferences.putInt(BACKTOTEXT_POSITION, EModelService.ABOVE); //TODO set to RIGHT_OF later ? |
TXM/trunk/bundles/org.txm.edition.rcp/src/org/txm/edition/rcp/preferences/SynopticEditionPreferencePage.java (revision 3698) | ||
---|---|---|
3 | 3 |
import org.eclipse.e4.ui.workbench.modeling.EModelService; |
4 | 4 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
5 | 5 |
import org.eclipse.jface.preference.ComboFieldEditor; |
6 |
import org.eclipse.jface.preference.IntegerFieldEditor; |
|
7 | 6 |
import org.eclipse.ui.IWorkbench; |
8 | 7 |
import org.txm.edition.rcp.messages.EditionUIMessages; |
9 | 8 |
import org.txm.rcp.IImageKeys; |
... | ... | |
34 | 33 |
fast_highlight = new BooleanFieldEditor(SynopticEditionPreferences.FAST_HIGHLIGHT, EditionUIMessages.enableFastWordHighlight, getFieldEditorParent()); |
35 | 34 |
addField(fast_highlight); |
36 | 35 |
|
37 |
String[][] values = {{"ABOVE", ""+EModelService.ABOVE}, {"BELOW", ""+EModelService.BELOW}, {"LEFT_OF", ""+EModelService.LEFT_OF}, {"RIGHT_OF", ""+EModelService.RIGHT_OF}}; |
|
36 |
String[][] values = { |
|
37 |
{"OVER", "-1"}, |
|
38 |
{"ABOVE", ""+EModelService.ABOVE}, |
|
39 |
{"BELOW", ""+EModelService.BELOW}, |
|
40 |
{"LEFT_OF", ""+EModelService.LEFT_OF}, |
|
41 |
{"RIGHT_OF", ""+EModelService.RIGHT_OF}}; |
|
38 | 42 |
|
39 | 43 |
backtotext_position = new ComboFieldEditor(SynopticEditionPreferences.BACKTOTEXT_POSITION, "new editor position", values, getFieldEditorParent()); |
40 | 44 |
addField(backtotext_position); |
41 | 45 |
} |
46 |
|
|
47 |
public boolean performOk() { |
|
48 |
boolean b = super.performOk(); |
|
49 |
String v = SynopticEditionPreferences.getInstance().getString(SynopticEditionPreferences.BACKTOTEXT_POSITION); |
|
50 |
System.out.println("v="+v); |
|
51 |
return b; |
|
52 |
} |
|
42 | 53 |
} |
Formats disponibles : Unified diff