Search in sources :

Example 16 with EditorPartStack

use of org.eclipse.che.ide.api.parts.EditorPartStack in project che by eclipse.

the class EditorAgentImpl method closeEditor.

@Override
public void closeEditor(EditorPartPresenter editor) {
    if (editor == null) {
        return;
    }
    EditorPartStack editorPartStack = editorMultiPartStack.getPartStackByPart(editor);
    if (editorPartStack == null) {
        return;
    }
    EditorTab editorTab = editorPartStack.getTabByPart(editor);
    //we have the handlers for the closing file event in different places of the project
    //so we need to notify them about it (we can't just pass doClose() method)
    eventBus.fireEvent(FileEvent.createCloseFileEvent(editorTab));
}
Also used : EditorTab(org.eclipse.che.ide.api.parts.EditorTab) EditorPartStack(org.eclipse.che.ide.api.parts.EditorPartStack)

Aggregations

EditorPartStack (org.eclipse.che.ide.api.parts.EditorPartStack)16 EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)7 JsonObject (elemental.json.JsonObject)3 PartPresenter (org.eclipse.che.ide.api.parts.PartPresenter)3 OperationException (org.eclipse.che.api.promises.client.OperationException)2 Promise (org.eclipse.che.api.promises.client.Promise)2 HasDataObject (org.eclipse.che.ide.api.data.HasDataObject)2 EditorTab (org.eclipse.che.ide.api.parts.EditorTab)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 ArrayOf (elemental.util.ArrayOf)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Operation (org.eclipse.che.api.promises.client.Operation)1 Constraints (org.eclipse.che.ide.api.constraints.Constraints)1 AsyncEditorProvider (org.eclipse.che.ide.api.editor.AsyncEditorProvider)1 EditorProvider (org.eclipse.che.ide.api.editor.EditorProvider)1 FileType (org.eclipse.che.ide.api.filetypes.FileType)1 Resource (org.eclipse.che.ide.api.resources.Resource)1 VirtualFile (org.eclipse.che.ide.api.resources.VirtualFile)1 ProjectExplorerPresenter (org.eclipse.che.ide.part.explorer.project.ProjectExplorerPresenter)1