Search in sources :

Example 1 with EditorPartPresenter

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);
    }
}
Also used : VirtualFile(org.eclipse.che.ide.api.resources.VirtualFile) Breakpoint(org.eclipse.che.ide.api.debug.Breakpoint) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Example 2 with EditorPartPresenter

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);
}
Also used : EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter) Test(org.junit.Test)

Example 3 with EditorPartPresenter

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);
}
Also used : EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter) Test(org.junit.Test)

Example 4 with EditorPartPresenter

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);
}
Also used : EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Example 5 with EditorPartPresenter

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();
        }
    }
}
Also used : TextEditor(org.eclipse.che.ide.api.editor.texteditor.TextEditor) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Aggregations

EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)79 TextEditor (org.eclipse.che.ide.api.editor.texteditor.TextEditor)21 VirtualFile (org.eclipse.che.ide.api.resources.VirtualFile)19 OperationException (org.eclipse.che.api.promises.client.OperationException)13 Project (org.eclipse.che.ide.api.resources.Project)13 Resource (org.eclipse.che.ide.api.resources.Resource)11 Test (org.junit.Test)10 Operation (org.eclipse.che.api.promises.client.Operation)9 Path (org.eclipse.che.ide.resource.Path)8 File (org.eclipse.che.ide.api.resources.File)7 Scheduler (com.google.gwt.core.client.Scheduler)6 EditorPartStack (org.eclipse.che.ide.api.parts.EditorPartStack)6 PartPresenter (org.eclipse.che.ide.api.parts.PartPresenter)6 Optional (com.google.common.base.Optional)5 OpenEditorCallbackImpl (org.eclipse.che.ide.api.editor.OpenEditorCallbackImpl)5 LanguageServerEditorConfiguration (org.eclipse.che.plugin.languageserver.ide.editor.LanguageServerEditorConfiguration)5 HandlesTextOperations (org.eclipse.che.ide.api.editor.texteditor.HandlesTextOperations)4 ResourceDelta (org.eclipse.che.ide.api.resources.ResourceDelta)4 ClassContent (org.eclipse.che.ide.ext.java.shared.dto.ClassContent)4 JsonObject (elemental.json.JsonObject)3