use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class EditorContentSynchronizerImpl method onActivePartChanged.
@Override
public void onActivePartChanged(ActivePartChangedEvent event) {
PartPresenter activePart = event.getActivePart();
if (!(activePart instanceof EditorPartPresenter)) {
return;
}
EditorPartPresenter activeEditor = (EditorPartPresenter) activePart;
Path path = activeEditor.getEditorInput().getFile().getLocation();
if (editorGroups.containsKey(path)) {
editorGroups.get(path).onActiveEditorChanged(activeEditor);
}
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class EditorAgentImpl method closeEditor.
private void closeEditor(EditorTab tab) {
checkArgument(tab != null, "Null editor tab occurred");
EditorPartPresenter editor = tab.getRelativeEditorPart();
if (editor == null) {
return;
}
openedEditors.remove(editor);
openedEditorsToProviders.remove(editor);
editor.close(false);
if (editor instanceof TextEditor) {
editorContentSynchronizerProvider.get().unTrackEditor(editor);
}
if (activeEditor != null && activeEditor == editor) {
activeEditor = null;
}
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class ReopenClosedFileAction method updateInPerspective.
/** {@inheritDoc} */
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
EditorPartStack currentPartStack = getEditorPane(event);
EditorPartPresenter lastClosed = currentPartStack.getLastClosed();
event.getPresentation().setEnabled(lastClosed != null);
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class SwitchPreviousEditorAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent event) {
final EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
checkNotNull(activeEditor, "Null editor occurred");
final EditorPartPresenter previousEditor = getPreviousEditorBaseOn(activeEditor);
editorAgent.activateEditor(previousEditor);
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class EditorMultiPartStackPresenter method onActivePartChanged.
@Override
public void onActivePartChanged(ActivePartChangedEvent event) {
PartPresenter activePart = event.getActivePart();
if (activePart instanceof EditorPartPresenter) {
activeEditor = activePart;
activeEditorPartStack = getPartStackByPart(activePart);
}
}
Aggregations