Search in sources :

Example 6 with EditorTab

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

the class CloseAction method actionPerformed.

/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
    EditorTab editorTab = getEditorTab(e);
    if (editorTab == null) {
        return;
    }
    eventBus.fireEvent(FileEvent.createCloseFileEvent(editorTab));
}
Also used : EditorTab(org.eclipse.che.ide.api.parts.EditorTab)

Example 7 with EditorTab

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

the class PinEditorTabAction method actionPerformed.

/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
    EditorTab editorTab = getEditorTab(e);
    editorTab.setPinMark(!editorTab.isPinned());
}
Also used : EditorTab(org.eclipse.che.ide.api.parts.EditorTab)

Example 8 with EditorTab

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

the class EditorPartStackPresenter method onTabClose.

/** {@inheritDoc} */
@Override
public void onTabClose(@NotNull TabItem tab) {
    final EditorPaneMenuItem editorPaneMenuItem = getPaneMenuItemByTab(tab);
    editorPaneMenu.removeItem(editorPaneMenuItem);
    items.remove(editorPaneMenuItem);
    EditorPartPresenter part = ((EditorTab) tab).getRelativeEditorPart();
    closedParts.add(part);
}
Also used : EditorTab(org.eclipse.che.ide.api.parts.EditorTab) EditorPaneMenuItem(org.eclipse.che.ide.part.widgets.panemenu.EditorPaneMenuItem) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Example 9 with EditorTab

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

the class EditorPartStackPresenter method onCloseNonPinnedEditors.

/** {@inheritDoc} */
@Override
public void onCloseNonPinnedEditors(CloseNonPinnedEditorsEvent event) {
    EditorPartPresenter editorPart = event.getEditorTab().getRelativeEditorPart();
    if (!containsPart(editorPart)) {
        return;
    }
    Iterable<TabItem> nonPinned = filter(parts.keySet(), new Predicate<TabItem>() {

        @Override
        public boolean apply(@Nullable TabItem input) {
            return input instanceof EditorTab && !((EditorTab) input).isPinned();
        }
    });
    for (final TabItem tabItem : nonPinned) {
        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {

            @Override
            public void execute() {
                eventBus.fireEvent(FileEvent.createCloseFileEvent((EditorTab) tabItem));
            }
        });
    }
}
Also used : TabItem(org.eclipse.che.ide.api.parts.PartStackView.TabItem) EditorTab(org.eclipse.che.ide.api.parts.EditorTab) Scheduler(com.google.gwt.core.client.Scheduler) EditorPartPresenter(org.eclipse.che.ide.api.editor.EditorPartPresenter)

Aggregations

EditorTab (org.eclipse.che.ide.api.parts.EditorTab)9 TabItem (org.eclipse.che.ide.api.parts.PartStackView.TabItem)4 EditorPartPresenter (org.eclipse.che.ide.api.editor.EditorPartPresenter)3 Nullable (org.eclipse.che.commons.annotation.Nullable)2 EditorPartStack (org.eclipse.che.ide.api.parts.EditorPartStack)2 PartPresenter (org.eclipse.che.ide.api.parts.PartPresenter)2 Path (org.eclipse.che.ide.resource.Path)2 Scheduler (com.google.gwt.core.client.Scheduler)1 AbstractEditorPresenter (org.eclipse.che.ide.api.editor.AbstractEditorPresenter)1 EditorWithErrors (org.eclipse.che.ide.api.editor.EditorWithErrors)1 EditorState (org.eclipse.che.ide.api.editor.EditorWithErrors.EditorState)1 PropertyListener (org.eclipse.che.ide.api.parts.PropertyListener)1 VirtualFile (org.eclipse.che.ide.api.resources.VirtualFile)1 EditorPaneMenuItem (org.eclipse.che.ide.part.widgets.panemenu.EditorPaneMenuItem)1