Révision 1450
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 1450) | ||
---|---|---|
12 | 12 |
import org.eclipse.core.commands.ParameterValuesException; |
13 | 13 |
import org.eclipse.core.commands.ParameterizedCommand; |
14 | 14 |
import org.eclipse.core.commands.common.NotDefinedException; |
15 |
import org.eclipse.ui.IEditorPart; |
|
15 | 16 |
import org.eclipse.ui.IViewPart; |
16 | 17 |
import org.eclipse.ui.IWorkbenchPage; |
17 | 18 |
import org.eclipse.ui.IWorkbenchWindow; |
... | ... | |
27 | 28 |
import org.txm.core.preferences.TXMPreferences; |
28 | 29 |
import org.txm.core.results.TXMResult; |
29 | 30 |
import org.txm.rcp.editors.TXMEditor; |
31 |
import org.txm.rcp.editors.TXMMultiPageEditor; |
|
30 | 32 |
import org.txm.rcp.views.corpora.CorporaView; |
31 | 33 |
import org.txm.searchengine.cqp.CQPSearchEngine; |
32 | 34 |
import org.txm.statsengine.core.messages.StatsEngineCoreMessages; |
... | ... | |
136 | 138 |
* @return |
137 | 139 |
*/ |
138 | 140 |
public static TXMEditor getActiveEditor(ExecutionEvent event) { |
139 |
try { |
|
140 |
if(event != null) { |
|
141 |
return (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart(); |
|
142 |
} |
|
143 |
else { |
|
144 |
return (TXMEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); |
|
145 |
} |
|
141 |
|
|
142 |
IEditorPart editor = null; |
|
143 |
|
|
144 |
if(event != null) { |
|
145 |
editor = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor(); |
|
146 | 146 |
} |
147 |
catch (Exception e) { |
|
147 |
else { |
|
148 |
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); |
|
148 | 149 |
} |
149 |
return null; |
|
150 |
|
|
151 |
if(editor instanceof TXMMultiPageEditor) { |
|
152 |
editor = ((TXMMultiPageEditor)editor).getMainEditorPart(); |
|
153 |
|
|
154 |
} |
|
155 |
|
|
156 |
if(!(editor instanceof TXMEditor)) { |
|
157 |
return null; |
|
158 |
} |
|
159 |
|
|
160 |
return (TXMEditor)editor; |
|
150 | 161 |
} |
151 | 162 |
|
152 | 163 |
/** |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/adapters/TXMResultAdapter.java (revision 1450) | ||
---|---|---|
66 | 66 |
|
67 | 67 |
@Override |
68 | 68 |
public FontData getFont(Object element) { |
69 |
// FIXME: font tests
|
|
69 |
// highlight the node label of the current active editor
|
|
70 | 70 |
if(element instanceof TXMResult && element == BaseAbstractHandler.getActiveEditorResult(null)) { |
71 | 71 |
FontData fontData = Display.getCurrent().getSystemFont().getFontData()[0]; |
72 | 72 |
fontData.setStyle(SWT.BOLD); |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 1450) | ||
---|---|---|
952 | 952 |
|
953 | 953 |
// FIXME: update all open editors of the children result but also of the result itself |
954 | 954 |
// FIXME: debug |
955 |
Log.finest("TXMEditor.refresh(): " + this.getClass().getSimpleName() + ": synchronizing and refreshing editors that share this editor result but also result children editors."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
955 |
Log.finest("TXMEditor.refresh(): " + this.getClass().getSimpleName() + ": synchronizing and refreshing result children opened editors."); //$NON-NLS-1$ //$NON-NLS-2$
|
|
956 | 956 |
|
957 | 957 |
List<TXMResult> results = this.getResult().getDeepChildren(); |
958 | 958 |
//results.add(this.getResult()); |
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAEditor.java (revision 1450) | ||
---|---|---|
150 | 150 |
editors = new ArrayList<EditorPart>(); |
151 | 151 |
inputs = new ArrayList<IEditorInput>(); |
152 | 152 |
|
153 |
TXMResultEditorInput caInput = (TXMResultEditorInput) getEditorInput(); |
|
153 |
TXMResultEditorInput caInput = (TXMResultEditorInput) this.getEditorInput();
|
|
154 | 154 |
this.ca = (CA) caInput.getResult(); |
155 | 155 |
|
156 | 156 |
// Initialize the editor parts and editor inputs |
Formats disponibles : Unified diff