use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class BreakpointManagerImpl method changeBreakpointState.
@Override
public void changeBreakpointState(final int lineNumber) {
EditorPartPresenter editor = editorAgent.getActiveEditor();
if (editor == null) {
return;
}
final VirtualFile activeFile = editor.getEditorInput().getFile();
List<Breakpoint> pathBreakpoints = breakpoints.get(activeFile.getLocation().toString());
if (pathBreakpoints != null) {
for (final Breakpoint breakpoint : pathBreakpoints) {
if (breakpoint.getLineNumber() == lineNumber) {
// breakpoint already exists at given line
deleteBreakpoint(activeFile, breakpoint);
return;
}
}
}
if (isLineNotEmpty(activeFile, lineNumber)) {
Breakpoint breakpoint = new Breakpoint(BREAKPOINT, lineNumber, activeFile.getLocation().toString(), activeFile, false);
addBreakpoint(breakpoint);
}
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class EditorPartStackPresenterTest method shouldReturnNextPart.
@Test
public void shouldReturnNextPart() {
presenter.addPart(partPresenter1);
presenter.addPart(partPresenter2);
presenter.addPart(partPresenter3);
EditorPartPresenter result = presenter.getNextFor(partPresenter2);
assertNotNull(result);
assertEquals(partPresenter3, result);
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class EditorPartStackPresenterTest method shouldReturnPreviousPart.
@Test
public void shouldReturnPreviousPart() {
presenter.addPart(partPresenter1);
presenter.addPart(partPresenter2);
presenter.addPart(partPresenter3);
EditorPartPresenter result = presenter.getPreviousFor(partPresenter2);
assertNotNull(result);
assertEquals(partPresenter1, result);
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class OrganizeImportsAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final EditorPartPresenter editor = editorAgent.getActiveEditor();
organizeImportsPresenter.organizeImports(editor);
}
use of org.eclipse.che.ide.api.editor.EditorPartPresenter in project che by eclipse.
the class FileWatcher method reparseAllOpenedFiles.
private void reparseAllOpenedFiles() {
for (EditorPartPresenter editorPartPresenter : editorAgent.getOpenedEditors()) {
if (editorPartPresenter instanceof TextEditor) {
final TextEditor editor = (TextEditor) editorPartPresenter;
editor.refreshEditor();
}
}
}
Aggregations