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));
}
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());
}
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);
}
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));
}
});
}
}
Aggregations