Search in sources :

Example 1 with BasePresenter

use of org.eclipse.che.ide.api.parts.base.BasePresenter 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();
}
Also used : TabItem(org.eclipse.che.ide.api.parts.PartStackView.TabItem) PartButton(org.eclipse.che.ide.part.widgets.partbutton.PartButton) BasePresenter(org.eclipse.che.ide.api.parts.base.BasePresenter)

Aggregations

TabItem (org.eclipse.che.ide.api.parts.PartStackView.TabItem)1 BasePresenter (org.eclipse.che.ide.api.parts.base.BasePresenter)1 PartButton (org.eclipse.che.ide.part.widgets.partbutton.PartButton)1