use of org.eclipse.che.ide.part.widgets.partbutton.PartButton in project che by eclipse.
the class PartStackPresenter method addPart.
/** {@inheritDoc} */
@Override
public void addPart(@NotNull PartPresenter part, @Nullable Constraints constraint) {
if (containsPart(part)) {
TabItem tab = getTabByPart(part);
onTabClicked(tab);
return;
}
if (part instanceof BasePresenter) {
((BasePresenter) part).setPartStack(this);
}
part.addPropertyListener(propertyListener);
PartButton partButton = tabItemFactory.createPartButton(part.getTitle()).setTooltip(part.getTitleToolTip()).setIcon(part.getTitleImage());
partButton.setDelegate(this);
parts.put(partButton, part);
constraints.put(part, constraint);
view.addTab(partButton, part);
sortPartsOnView();
onRequestFocus();
}
Aggregations