use of org.eclipse.che.ide.api.parts.PartStackView.TabItem 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));
}
});
}
}
use of org.eclipse.che.ide.api.parts.PartStackView.TabItem in project che by eclipse.
the class EditorPartStackPresenterTest method onTabItemClickedTest.
@Test
public void onTabItemClickedTest() {
TabItem tabItem = mock(TabItem.class);
when(editorPaneTabMenuItem.getData()).thenReturn(tabItem);
presenter.paneMenuTabItemHandler.onItemClicked(editorPaneTabMenuItem);
verify(view).selectTab((PartPresenter) anyObject());
}
Aggregations