use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class CloseOtherAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent event) {
EditorPartStack currentPartStack = getEditorPane(event);
EditorPartPresenter currentEditor = getEditorTab(event).getRelativeEditorPart();
for (EditorPartPresenter editorPart : editorAgent.getOpenedEditorsFor(currentPartStack)) {
if (currentEditor != editorPart) {
editorAgent.closeEditor(editorPart);
}
}
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class CloseOtherAction method isFilesToCloseExist.
private boolean isFilesToCloseExist(ActionEvent event) {
EditorPartStack currentPartStack = getEditorPane(event);
EditorPartPresenter currentEditor = getEditorTab(event).getRelativeEditorPart();
for (EditorPartPresenter openedEditor : editorAgent.getOpenedEditorsFor(currentPartStack)) {
if (currentEditor != openedEditor) {
return true;
}
}
return false;
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class ReopenClosedFileAction method actionPerformed.
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent event) {
EditorPartStack currentPartStack = getEditorPane(event);
EditorPartPresenter lastClosed = currentPartStack.getLastClosed();
VirtualFile file = lastClosed.getEditorInput().getFile();
eventBus.fireEvent(FileEvent.createOpenFileEvent(file));
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class TestResultViewImpl method gotoClass.
@Override
public void gotoClass(String packagePath, int line) {
lastWentLine = line;
final Project project = appContext.getRootProject();
String testSrcPath = project.getPath() + "/" + DEFAULT_TEST_SOURCE_FOLDER;
appContext.getWorkspaceRoot().getFile(testSrcPath + packagePath).then(new Operation<Optional<File>>() {
@Override
public void apply(Optional<File> file) throws OperationException {
if (file.isPresent()) {
eventBus.fireEvent(FileEvent.createOpenFileEvent(file.get()));
Timer t = new Timer() {
@Override
public void run() {
EditorPartPresenter editorPart = editorAgent.getActiveEditor();
Document doc = ((TextEditor) editorPart).getDocument();
doc.setCursorPosition(new TextPosition(lastWentLine - 1, 0));
}
};
t.schedule(500);
}
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError error) throws OperationException {
Log.info(TestResultViewImpl.class, error);
}
});
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class RunClassTestAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
EditorPartPresenter editorPart = editorAgent.getActiveEditor();
final VirtualFile file = editorPart.getEditorInput().getFile();
String fqn = JavaUtil.resolveFQN(file);
Map<String, String> parameters = new HashMap<>();
parameters.put("fqn", fqn);
parameters.put("runClass", "true");
parameters.put("updateClasspath", "true");
delegate.doRunTests(e, parameters);
}
Aggregations