Révision 689
tmp/org.txm.para.rcp/src/org/txm/para/rcp/messages/messages.properties (revision 689) | ||
---|---|---|
1 |
|
|
2 |
OpenParaBrowser_0 = Opening the parabrowser |
|
3 |
|
|
4 |
ParaBrowserEditor_11 = ParaBrowser: get next({0}) struct {1} paraid {2} value {3} |
|
5 |
ParaBrowserEditor_18 = -MOVE to |
|
6 |
ParaBrowserEditor_19 = -Don't MOVE !!!!! NEXT is |
|
7 |
ParaBrowserEditor_21 = _ |
|
8 |
ParaBrowserEditor_22 = Open Parabrowser |
|
9 |
ParaBrowserEditor_3 = Ref: |
|
10 |
ParaBrowserEditor_4 = Références |
|
11 |
ParaBrowserEditor_9 = Ref: {0}: {1} |
|
0 | 12 |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/messages/messages_ru.properties (revision 689) | ||
---|---|---|
1 |
|
|
2 |
OpenParaBrowser_0 = Открытие Парабраузер// |
|
3 |
|
|
4 |
ParaBrowserEditor_11 = ParaBrowser : get next({0}) struct {1} paraid {2} value {3} |
|
5 |
ParaBrowserEditor_18 = -Перейти к |
|
6 |
ParaBrowserEditor_19 = -Оставаться на месте!!!!! NEXT - |
|
7 |
ParaBrowserEditor_21 = _ |
|
8 |
ParaBrowserEditor_22 = Открыть встроенный браузер |
|
9 |
ParaBrowserEditor_3 = Ссылка : |
|
10 |
ParaBrowserEditor_4 = Ссылки |
|
11 |
ParaBrowserEditor_9 = Ссылки: {0} : {1} |
|
0 | 12 |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/messages/messages_fr.properties (revision 689) | ||
---|---|---|
1 |
|
|
2 |
OpenParaBrowser_0 = Ouverture du Navigateur// |
|
3 |
|
|
4 |
ParaBrowserEditor_11 = ParaBrowser : get next({0}) struct {1} paraid {2} value {3} |
|
5 |
ParaBrowserEditor_18 = -Aller à |
|
6 |
ParaBrowserEditor_19 = -Rester sur place !!!!! NEXT est |
|
7 |
ParaBrowserEditor_21 = _ |
|
8 |
ParaBrowserEditor_22 = Ouvrir le Navigateur interne |
|
9 |
ParaBrowserEditor_3 = Réf : |
|
10 |
ParaBrowserEditor_4 = Références |
|
11 |
ParaBrowserEditor_9 = Réf : {0} : {1} |
|
0 | 12 |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/messages/ParaBrowserUIMessages.java (revision 689) | ||
---|---|---|
1 |
package org.txm.para.rcp.messages; |
|
2 |
|
|
3 |
import org.eclipse.osgi.util.NLS; |
|
4 |
import org.txm.utils.messages.Utf8NLS; |
|
5 |
|
|
6 |
|
|
7 |
/** |
|
8 |
* Parallel browser UI messages. |
|
9 |
* |
|
10 |
* @author mdecorde |
|
11 |
* @author sjacquot |
|
12 |
* |
|
13 |
*/ |
|
14 |
public class ParaBrowserUIMessages extends NLS { |
|
15 |
|
|
16 |
private static final String BUNDLE_NAME = "org.txm.para.rcp.messages.messages"; //$NON-NLS-1$ |
|
17 |
|
|
18 |
public static String ParaBrowserEditor_11; |
|
19 |
public static String ParaBrowserEditor_18; |
|
20 |
public static String ParaBrowserEditor_19; |
|
21 |
public static String ParaBrowserEditor_21; |
|
22 |
public static String ParaBrowserEditor_22; |
|
23 |
public static String ParaBrowserEditor_3; |
|
24 |
public static String ParaBrowserEditor_4; |
|
25 |
public static String ParaBrowserEditor_9; |
|
26 |
|
|
27 |
public static String OpenParaBrowser_0; |
|
28 |
|
|
29 |
|
|
30 |
static { |
|
31 |
// initialize resource bundle |
|
32 |
Utf8NLS.initializeMessages(BUNDLE_NAME, ParaBrowserUIMessages.class); |
|
33 |
} |
|
34 |
|
|
35 |
private ParaBrowserUIMessages() { |
|
36 |
} |
|
37 |
} |
|
0 | 38 |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/editors/DefineParaSortReferencePattern.java (revision 689) | ||
---|---|---|
47 | 47 |
import org.eclipse.ui.IWorkbenchWindow; |
48 | 48 |
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; |
49 | 49 |
import org.txm.concordance.rcp.editors.ConcordanceEditor; |
50 |
import org.txm.rcp.RCPMessages;
|
|
50 |
import org.txm.rcp.messages.TXMUIMessages;
|
|
51 | 51 |
import org.txm.searchengine.cqp.ReferencePattern; |
52 | 52 |
import org.txm.searchengine.cqp.corpus.Property; |
53 | 53 |
import org.txm.searchengine.cqp.corpus.StructuralUnit; |
... | ... | |
83 | 83 |
this.window = window; |
84 | 84 |
this.concordanceEditor = concordanceEditor; |
85 | 85 |
setId(ID); |
86 |
setText(RCPMessages.DefineReferencePattern_3);
|
|
87 |
setToolTipText(RCPMessages.DefineReferencePattern_4);
|
|
86 |
setText(TXMUIMessages.DefineReferencePattern_3);
|
|
87 |
setToolTipText(TXMUIMessages.DefineReferencePattern_4);
|
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
/** |
... | ... | |
98 | 98 |
this.window = window; |
99 | 99 |
this.paraBrowserEditor = paraBrowserEditor; |
100 | 100 |
setId(ID); |
101 |
setText(RCPMessages.DefineReferencePattern_3);
|
|
102 |
setToolTipText(RCPMessages.DefineReferencePattern_4);
|
|
101 |
setText(TXMUIMessages.DefineReferencePattern_3);
|
|
102 |
setToolTipText(TXMUIMessages.DefineReferencePattern_4);
|
|
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
|
... | ... | |
218 | 218 |
@Override |
219 | 219 |
protected void configureShell(Shell shell) { |
220 | 220 |
super.configureShell(shell); |
221 |
shell.setText(RCPMessages.DefineReferencePattern_5);
|
|
221 |
shell.setText(TXMUIMessages.DefineReferencePattern_5);
|
|
222 | 222 |
|
223 | 223 |
shell.setSize(400, 500); |
224 | 224 |
shell.setLocation(shell.getParent().getLocation()); |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/editors/DefineParaViewReferencePattern.java (revision 689) | ||
---|---|---|
47 | 47 |
import org.eclipse.ui.IWorkbenchWindow; |
48 | 48 |
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; |
49 | 49 |
import org.txm.concordance.rcp.editors.ConcordanceEditor; |
50 |
import org.txm.rcp.RCPMessages;
|
|
50 |
import org.txm.rcp.messages.TXMUIMessages;
|
|
51 | 51 |
import org.txm.searchengine.cqp.ReferencePattern; |
52 | 52 |
import org.txm.searchengine.cqp.corpus.Property; |
53 | 53 |
import org.txm.searchengine.cqp.corpus.StructuralUnit; |
... | ... | |
83 | 83 |
this.window = window; |
84 | 84 |
this.concordanceEditor = concordanceEditor; |
85 | 85 |
setId(ID); |
86 |
setText(RCPMessages.DefineReferencePattern_1);
|
|
87 |
setToolTipText(RCPMessages.DefineReferencePattern_2);
|
|
86 |
setText(TXMUIMessages.DefineReferencePattern_1);
|
|
87 |
setToolTipText(TXMUIMessages.DefineReferencePattern_2);
|
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
/** |
... | ... | |
98 | 98 |
this.window = window; |
99 | 99 |
this.paraBrowserEditor = paraBrowserEditor; |
100 | 100 |
setId(ID); |
101 |
setText(RCPMessages.DefineReferencePattern_1);
|
|
102 |
setToolTipText(RCPMessages.DefineReferencePattern_2);
|
|
101 |
setText(TXMUIMessages.DefineReferencePattern_1);
|
|
102 |
setToolTipText(TXMUIMessages.DefineReferencePattern_2);
|
|
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
|
... | ... | |
218 | 218 |
@Override |
219 | 219 |
protected void configureShell(Shell shell) { |
220 | 220 |
super.configureShell(shell); |
221 |
shell.setText(RCPMessages.DefineReferencePattern_0);
|
|
221 |
shell.setText(TXMUIMessages.DefineReferencePattern_0);
|
|
222 | 222 |
|
223 | 223 |
shell.setSize(400, 500); |
224 | 224 |
shell.setLocation(shell.getParent().getLocation()); |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/editors/ParaBrowserEditor.java (revision 689) | ||
---|---|---|
57 | 57 |
import org.eclipse.ui.IEditorSite; |
58 | 58 |
import org.eclipse.ui.PartInitException; |
59 | 59 |
import org.eclipse.ui.part.EditorPart; |
60 |
import org.txm.concordance.rcp.messages.Messages; |
|
60 |
import org.txm.concordance.rcp.messages.ConcordanceUIMessages; |
|
61 |
import org.txm.core.messages.TXMCoreMessages; |
|
61 | 62 |
import org.txm.para.core.functions.ParaBrowser; |
62 |
import org.txm.rcp.RCPMessages;
|
|
63 |
import org.txm.para.rcp.messages.ParaBrowserUIMessages;
|
|
63 | 64 |
import org.txm.rcp.StatusLine; |
64 |
import org.txm.rcp.editors.input.ParaBrowserEditorInput;
|
|
65 |
import org.txm.rcp.messages.TXMUIMessages;
|
|
65 | 66 |
import org.txm.searchengine.cqp.ReferencePattern; |
66 | 67 |
import org.txm.searchengine.cqp.clientExceptions.CqiClientException; |
67 | 68 |
import org.txm.searchengine.cqp.corpus.MainCorpus; |
... | ... | |
134 | 135 |
/** The selected view properties. */ |
135 | 136 |
private List<StructuralUnit> selectedViewProperties; |
136 | 137 |
|
137 |
private ParaBrowser paraBrowser; |
|
138 |
private ParaBrowser paraBrowser = new ParaBrowser();
|
|
138 | 139 |
|
139 | 140 |
/** The next. */ |
140 | 141 |
private Button next; |
... | ... | |
326 | 327 |
selectedReference += property.getName() + "/"; //$NON-NLS-1$ |
327 | 328 |
} |
328 | 329 |
} |
329 |
referenceLabel.setText(RCPMessages.ParaBrowserEditor_3 + selectedReference);
|
|
330 |
referenceLabel.setText(ParaBrowserUIMessages.ParaBrowserEditor_3 + selectedReference);
|
|
330 | 331 |
corpusRefAreas.put(displayedCorpus, referenceLabel); |
331 | 332 |
} |
332 | 333 |
|
... | ... | |
404 | 405 |
|
405 | 406 |
// [<] |
406 | 407 |
prev = new Button(navigationArea, SWT.PUSH); |
407 |
prev.setText(Messages.ConcordancesEditor_12); |
|
408 |
prev.setText(ConcordanceUIMessages.ConcordancesEditor_12);
|
|
408 | 409 |
prev.addListener(SWT.Selection, new Listener() { |
409 | 410 |
@Override |
410 | 411 |
public void handleEvent(Event event) { |
... | ... | |
415 | 416 |
|
416 | 417 |
// [>] |
417 | 418 |
next = new Button(navigationArea, SWT.PUSH); |
418 |
next.setText(Messages.ConcordancesEditor_13); |
|
419 |
next.setText(ConcordanceUIMessages.ConcordancesEditor_13);
|
|
419 | 420 |
next.addListener(SWT.Selection, new Listener() { |
420 | 421 |
@Override |
421 | 422 |
public void handleEvent(Event event) { |
... | ... | |
435 | 436 |
// StructuralUnit |
436 | 437 |
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
437 | 438 |
Button refButton = new Button(controlArea, SWT.PUSH); |
438 |
refButton.setText(RCPMessages.ParaBrowserEditor_4);
|
|
439 |
refButton.setText(ParaBrowserUIMessages.ParaBrowserEditor_4);
|
|
439 | 440 |
refButton |
440 | 441 |
.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true)); |
441 | 442 |
refButton.addSelectionListener(new SelectionListener() { |
... | ... | |
450 | 451 |
}); |
451 | 452 |
|
452 | 453 |
Label structureLabel = new Label(controlArea, SWT.NONE); |
453 |
structureLabel.setText(RCPMessages.ParaBrowserEditor_5); // LEFT
|
|
454 |
structureLabel.setText(TXMCoreMessages.common_structure); // LEFT
|
|
454 | 455 |
structureLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, |
455 | 456 |
true)); |
456 | 457 |
|
... | ... | |
464 | 465 |
structuralUnits = selectedViewCorpus.get(0) |
465 | 466 |
.getOrderedStructuralUnits(); |
466 | 467 |
} catch (CqiClientException e) { |
467 |
System.out.println("Error: "+e); |
|
468 |
System.err |
|
469 |
.println(TXMUIMessages.ObjectExplorer_9); |
|
468 | 470 |
return; |
469 | 471 |
} |
470 | 472 |
} |
... | ... | |
679 | 681 |
*/ |
680 | 682 |
|
681 | 683 |
Label refArea = corpusRefAreas.get(corpus); |
682 |
refArea.setText(NLS.bind(RCPMessages.ParaBrowserEditor_9, corpus.getName(), selectedReference));
|
|
684 |
refArea.setText(NLS.bind(ParaBrowserUIMessages.ParaBrowserEditor_9, corpus.getName(), selectedReference));
|
|
683 | 685 |
} |
684 | 686 |
|
685 | 687 |
} |
... | ... | |
691 | 693 |
*/ |
692 | 694 |
public void nextorpreviousText(boolean findNext) { |
693 | 695 |
// get Property |
694 |
System.out.println(NLS.bind(RCPMessages.ParaBrowserEditor_11,
|
|
696 |
System.out.println(NLS.bind(ParaBrowserUIMessages.ParaBrowserEditor_11,
|
|
695 | 697 |
new Object[]{findNext, selectedStructuralUnit, selectedStructuralUnitParaId, selectedValue})); |
696 | 698 |
if (selectedStructuralUnit != null) { |
697 | 699 |
// Multiple Query, as many as there are corpuses displayed |
... | ... | |
708 | 710 |
// } |
709 | 711 |
} |
710 | 712 |
if (!newValue.equals("")) { //$NON-NLS-1$ |
711 |
System.out.println(RCPMessages.ParaBrowserEditor_18 + newValue);
|
|
713 |
System.out.println(ParaBrowserUIMessages.ParaBrowserEditor_18 + newValue);
|
|
712 | 714 |
int index = paraIdCombo.indexOf(newValue); |
713 | 715 |
if (index != -1) { |
714 | 716 |
selectedValue = newValue; |
715 | 717 |
paraIdCombo.select(index); |
716 | 718 |
} |
717 | 719 |
} else { |
718 |
System.out.println(RCPMessages.ParaBrowserEditor_19 + newValue);
|
|
720 |
System.out.println(ParaBrowserUIMessages.ParaBrowserEditor_19 + newValue);
|
|
719 | 721 |
} |
720 | 722 |
reloadTexts(); |
721 | 723 |
reloadReferences(); |
... | ... | |
729 | 731 |
*/ |
730 | 732 |
public void setReferencePattern(ReferencePattern referencePattern) { |
731 | 733 |
this.referencePattern = referencePattern; |
732 |
selectedReference = "text_id";
|
|
734 |
selectedReference = TXMUIMessages.ObjectExplorer_9;
|
|
733 | 735 |
if (referencePattern != null) { |
734 | 736 |
// selectedStructuralUnit.getName() |
735 | 737 |
List<Property> references = referencePattern.getProperties(); |
736 | 738 |
for (Property property : references) { |
737 |
selectedReference += property.getName() + RCPMessages.ParaBrowserEditor_21;
|
|
739 |
selectedReference += property.getName() + ParaBrowserUIMessages.ParaBrowserEditor_21;
|
|
738 | 740 |
} |
739 | 741 |
} |
740 | 742 |
reloadReferences(); |
... | ... | |
747 | 749 |
*/ |
748 | 750 |
@Override |
749 | 751 |
public void setFocus() { |
750 |
StatusLine.setMessage(RCPMessages.ParaBrowserEditor_22);
|
|
752 |
StatusLine.setMessage(ParaBrowserUIMessages.ParaBrowserEditor_22);
|
|
751 | 753 |
} |
752 | 754 |
|
753 | 755 |
/** |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/editors/ParaBrowserEditorInput.java (revision 689) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.para.rcp.editors; |
|
29 |
|
|
30 |
import java.util.ArrayList; |
|
31 |
import java.util.List; |
|
32 |
|
|
33 |
import org.eclipse.jface.resource.ImageDescriptor; |
|
34 |
import org.eclipse.ui.IEditorInput; |
|
35 |
import org.eclipse.ui.IPersistableElement; |
|
36 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
|
37 |
import org.txm.rcp.Application; |
|
38 |
import org.txm.rcp.IImageKeys; |
|
39 |
import org.txm.searchengine.cqp.corpus.MainCorpus; |
|
40 |
|
|
41 |
// TODO: Auto-generated Javadoc |
|
42 |
/** |
|
43 |
* The Class ParaBrowserEditorInput. |
|
44 |
*/ |
|
45 |
public class ParaBrowserEditorInput implements IEditorInput { |
|
46 |
|
|
47 |
/** The corpus. */ |
|
48 |
private List<MainCorpus> corpus; |
|
49 |
|
|
50 |
/** |
|
51 |
* Instantiates a new para browser editor input. |
|
52 |
* |
|
53 |
* @param corpus the corpus |
|
54 |
*/ |
|
55 |
public ParaBrowserEditorInput(List<MainCorpus> corpus) { |
|
56 |
this.corpus = corpus; |
|
57 |
} |
|
58 |
|
|
59 |
/* (non-Javadoc) |
|
60 |
* @see org.eclipse.ui.IEditorInput#getImageDescriptor() |
|
61 |
*/ |
|
62 |
@Override |
|
63 |
public ImageDescriptor getImageDescriptor() { |
|
64 |
return AbstractUIPlugin.imageDescriptorFromPlugin( |
|
65 |
Application.PLUGIN_ID, IImageKeys.ACTION_CONCORDANCES); |
|
66 |
} |
|
67 |
|
|
68 |
/* (non-Javadoc) |
|
69 |
* @see org.eclipse.ui.IEditorInput#getName() |
|
70 |
*/ |
|
71 |
@Override |
|
72 |
public String getName() { |
|
73 |
if (corpus.size() > 0) { |
|
74 |
return corpus.get(0).getName(); |
|
75 |
} else |
|
76 |
return ""; //$NON-NLS-1$ |
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 |
* Gets the names. |
|
81 |
* |
|
82 |
* @return the names |
|
83 |
*/ |
|
84 |
public List<String> getNames() { |
|
85 |
List<String> names = new ArrayList<String>(); |
|
86 |
for (MainCorpus corp : corpus) { |
|
87 |
names.add(corp.getName()); |
|
88 |
} |
|
89 |
return names; // corpus.getName(); |
|
90 |
} |
|
91 |
|
|
92 |
/* (non-Javadoc) |
|
93 |
* @see org.eclipse.ui.IEditorInput#getPersistable() |
|
94 |
*/ |
|
95 |
@Override |
|
96 |
public IPersistableElement getPersistable() { |
|
97 |
return null; |
|
98 |
} |
|
99 |
|
|
100 |
/* (non-Javadoc) |
|
101 |
* @see org.eclipse.ui.IEditorInput#getToolTipText() |
|
102 |
*/ |
|
103 |
@Override |
|
104 |
public String getToolTipText() { |
|
105 |
return getName(); |
|
106 |
} |
|
107 |
|
|
108 |
/* (non-Javadoc) |
|
109 |
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) |
|
110 |
*/ |
|
111 |
@Override |
|
112 |
public Object getAdapter(Class adapter) { |
|
113 |
return null; |
|
114 |
} |
|
115 |
|
|
116 |
/** |
|
117 |
* Gets the corpus. |
|
118 |
* |
|
119 |
* @return the corpus |
|
120 |
*/ |
|
121 |
public MainCorpus getCorpus() { |
|
122 |
if (corpus.size() > 0) { |
|
123 |
return corpus.get(0); |
|
124 |
} else |
|
125 |
return null; |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* Gets the corpus list. |
|
130 |
* |
|
131 |
* @return the corpus list |
|
132 |
*/ |
|
133 |
public List<MainCorpus> getCorpusList() { |
|
134 |
return corpus; |
|
135 |
} |
|
136 |
|
|
137 |
/* (non-Javadoc) |
|
138 |
* @see org.eclipse.ui.IEditorInput#exists() |
|
139 |
*/ |
|
140 |
@Override |
|
141 |
public boolean exists() { |
|
142 |
return false; |
|
143 |
} |
|
144 |
} |
|
0 | 145 |
tmp/org.txm.para.rcp/src/org/txm/para/rcp/handlers/OpenParaBrowser.java (revision 689) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate:$ |
|
25 |
// $LastChangedRevision:$ |
|
26 |
// $LastChangedBy:$ |
|
27 |
// |
|
28 |
package org.txm.para.rcp.handlers; |
|
29 |
|
|
30 |
import java.util.ArrayList; |
|
31 |
import java.util.List; |
|
32 |
|
|
33 |
import org.eclipse.core.commands.AbstractHandler; |
|
34 |
import org.eclipse.core.commands.ExecutionEvent; |
|
35 |
import org.eclipse.core.commands.ExecutionException; |
|
36 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
37 |
import org.eclipse.ui.IWorkbenchPage; |
|
38 |
import org.eclipse.ui.IWorkbenchWindow; |
|
39 |
import org.eclipse.ui.PartInitException; |
|
40 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
41 |
import org.txm.para.rcp.editors.ParaBrowserEditorInput; |
|
42 |
import org.txm.para.rcp.messages.ParaBrowserUIMessages; |
|
43 |
import org.txm.rcp.StatusLine; |
|
44 |
import org.txm.searchengine.cqp.corpus.MainCorpus; |
|
45 |
|
|
46 |
// TODO: Auto-generated Javadoc |
|
47 |
/** |
|
48 |
* Display and browse text of structural unit of parallel corpora @ author |
|
49 |
* mdecorde. |
|
50 |
*/ |
|
51 |
public class OpenParaBrowser extends AbstractHandler { |
|
52 |
|
|
53 |
/** The ID. */ |
|
54 |
public static String ID = OpenParaBrowser.class.getName(); |
|
55 |
|
|
56 |
/** The window. */ |
|
57 |
private IWorkbenchWindow window; |
|
58 |
|
|
59 |
/** The selection. */ |
|
60 |
private IStructuredSelection selection; |
|
61 |
|
|
62 |
/** The editor input. */ |
|
63 |
private ParaBrowserEditorInput editorInput; |
|
64 |
|
|
65 |
// org.txm.rcp.commands.function.OpenParaBrowser |
|
66 |
/* (non-Javadoc) |
|
67 |
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
68 |
*/ |
|
69 |
@Override |
|
70 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
71 |
window = HandlerUtil.getActiveWorkbenchWindow(event); |
|
72 |
selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); |
|
73 |
/* |
|
74 |
* Object s = selection.getFirstElement(); if (s == null) return null; |
|
75 |
* if (!(s instanceof MainCorpus)) return null; final MainCorpus corpus = |
|
76 |
* (MainCorpus) s; |
|
77 |
*/ |
|
78 |
List<Object> list = selection.toList(); |
|
79 |
List<MainCorpus> corpusList = new ArrayList<MainCorpus>(); |
|
80 |
for (Object co : list) |
|
81 |
corpusList.add((MainCorpus) co); |
|
82 |
|
|
83 |
editorInput = new ParaBrowserEditorInput(corpusList);// Put a list of |
|
84 |
// corpus |
|
85 |
|
|
86 |
IWorkbenchPage page = window.getActivePage(); |
|
87 |
try { |
|
88 |
StatusLine |
|
89 |
.setMessage(ParaBrowserUIMessages.OpenParaBrowser_0); |
|
90 |
page |
|
91 |
.openEditor(editorInput, |
|
92 |
"org.txm.rcp.editors.parabrowser.ParaBrowserEditor"); //$NON-NLS-1$ |
|
93 |
} catch (PartInitException e) { |
|
94 |
org.txm.rcp.utils.Logger.printStackTrace(e); |
|
95 |
} |
|
96 |
|
|
97 |
return null; |
|
98 |
} |
|
99 |
|
|
100 |
} |
|
0 | 101 |
Formats disponibles : Unified diff