| 36 |
36 |
import org.eclipse.ui.PlatformUI;
|
| 37 |
37 |
import org.eclipse.ui.part.EditorPart;
|
| 38 |
38 |
import org.eclipse.ui.part.ViewPart;
|
|
39 |
import org.txm.core.results.TXMResult;
|
|
40 |
import org.txm.rcp.editors.TXMEditorPart;
|
| 39 |
41 |
//import org.txm.rcp.editors.referencer.ReferencerEditor;
|
| 40 |
42 |
|
| 41 |
43 |
/**
|
| ... | ... | |
| 80 |
82 |
if (editor == null) editor = opened;
|
| 81 |
83 |
|
| 82 |
84 |
if (editor == null) currentEditorLabel.setText("No editor selected.");
|
|
85 |
|
|
86 |
if (editor instanceof TXMEditorPart) {
|
|
87 |
TXMEditorPart reditor = (TXMEditorPart)editor;
|
|
88 |
StringBuffer buffer = new StringBuffer();
|
|
89 |
TXMResult result = reditor.getResultData();
|
|
90 |
buffer.append(""+result.toString()+"\n");
|
|
91 |
buffer.append(""+result.getDetails()+"\n\n");
|
|
92 |
|
|
93 |
|
|
94 |
try {
|
|
95 |
String[] keys = result.getParametersKeys();
|
|
96 |
buffer.append("Parameters ("+keys.length+"): \n");
|
|
97 |
for (String key : keys)
|
|
98 |
buffer.append(" - "+key+"="+result.getStringParameterValue(key)+"\n");
|
|
99 |
} catch(Exception e) {
|
|
100 |
System.out.println("Error: "+e.getLocalizedMessage());
|
|
101 |
}
|
|
102 |
currentEditorLabel.setText(buffer.toString());
|
|
103 |
} else {
|
|
104 |
currentEditorLabel.setText("Editor is not a TXMPartEditor: "+editor);
|
|
105 |
}
|
| 83 |
106 |
// StringBuffer buffer = new StringBuffer();
|
| 84 |
107 |
// if (activated != null)
|
| 85 |
108 |
// buffer.append("\neditor activated: "+activated.getTitle());
|
| ... | ... | |
| 91 |
114 |
// buffer.append("\neditor desactivated: "+desactivated.getTitle());
|
| 92 |
115 |
// if (opened != null)
|
| 93 |
116 |
// buffer.append("\neditor opened: "+opened.getTitle());
|
| 94 |
|
// if (editor instanceof ConcordanceEditor) {
|
| 95 |
|
// currentEditorLabel.setText("Concordances "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
| 96 |
|
// } else if (editor instanceof IndexEditor) {
|
| 97 |
|
// currentEditorLabel.setText("Index "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
| 98 |
|
// } else if (editor instanceof CooccurrencesEditor) {
|
| 99 |
|
// currentEditorLabel.setText("Cooccurences "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
| 100 |
|
//// } else if (editor instanceof CAEditor) {
|
| 101 |
|
// currentEditorLabel.setText("CaEditor "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
| 102 |
|
// } else if (editor instanceof ReferencerEditor) {
|
| 103 |
|
// currentEditorLabel.setText("References "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
| 104 |
|
// }
|
|
117 |
// if (editor instanceof ConcordanceEditor) {
|
|
118 |
// currentEditorLabel.setText("Concordances "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
|
119 |
// } else if (editor instanceof IndexEditor) {
|
|
120 |
// currentEditorLabel.setText("Index "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
|
121 |
// } else if (editor instanceof CooccurrencesEditor) {
|
|
122 |
// currentEditorLabel.setText("Cooccurences "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
|
123 |
//// } else if (editor instanceof CAEditor) {
|
|
124 |
// currentEditorLabel.setText("CaEditor "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
|
125 |
// } else if (editor instanceof ReferencerEditor) {
|
|
126 |
// currentEditorLabel.setText("References "+editor.getTitle()+":\n\tquery\n\tproperty\n\tsort\n\t...");
|
|
127 |
// }
|
| 105 |
128 |
}
|
| 106 |
129 |
|
| 107 |
130 |
/* (non-Javadoc)
|
| ... | ... | |
| 109 |
132 |
*/
|
| 110 |
133 |
@Override
|
| 111 |
134 |
public void createPartControl(Composite parent) {
|
|
135 |
System.out.println("createPartControl: "+parent);
|
| 112 |
136 |
currentEditorLabel = new Label(parent, SWT.NONE);
|
| 113 |
137 |
updateEditorParameters();
|
| 114 |
138 |
}
|
| 115 |
139 |
|
| 116 |
140 |
@Override
|
| 117 |
141 |
public void partActivated(IWorkbenchPart part) {
|
|
142 |
System.out.println("partActivated: "+part);
|
| 118 |
143 |
if (part instanceof EditorPart)
|
| 119 |
144 |
activated = (EditorPart)part;
|
| 120 |
145 |
updateEditorParameters();
|
| ... | ... | |
| 122 |
147 |
|
| 123 |
148 |
@Override
|
| 124 |
149 |
public void partBroughtToTop(IWorkbenchPart part) {
|
|
150 |
System.out.println("partBroughtToTop: "+part);
|
| 125 |
151 |
if (part instanceof EditorPart)
|
| 126 |
152 |
broughtToTop = (EditorPart)part;
|
| 127 |
153 |
//updateLabel();
|
| ... | ... | |
| 129 |
155 |
|
| 130 |
156 |
@Override
|
| 131 |
157 |
public void partClosed(IWorkbenchPart part) {
|
|
158 |
System.out.println("partClosed: "+part);
|
| 132 |
159 |
if (part instanceof EditorPart) {
|
| 133 |
160 |
closed = (EditorPart)part;
|
| 134 |
161 |
}
|
| ... | ... | |
| 137 |
164 |
|
| 138 |
165 |
@Override
|
| 139 |
166 |
public void partDeactivated(IWorkbenchPart part) {
|
|
167 |
System.out.println("partDeactivated: "+part);
|
| 140 |
168 |
if (part instanceof EditorPart)
|
| 141 |
169 |
desactivated = (EditorPart)part;
|
| 142 |
170 |
//updateLabel();
|
| ... | ... | |
| 144 |
172 |
|
| 145 |
173 |
@Override
|
| 146 |
174 |
public void partOpened(IWorkbenchPart part) {
|
|
175 |
System.out.println("partOpened: "+part);
|
| 147 |
176 |
if (part instanceof EditorPart)
|
| 148 |
177 |
opened = (EditorPart)part;
|
| 149 |
178 |
//updateLabel();
|