use of org.eclipse.che.ide.api.parts.PartStackStateChangedEvent in project che by eclipse.
the class PartStackPresenter method setActivePart.
/** {@inheritDoc} */
@Override
public void setActivePart(@NotNull PartPresenter part) {
TabItem tab = getTabByPart(part);
if (tab == null) {
return;
}
activePart = part;
activeTab = tab;
if (state == State.MINIMIZED) {
state = State.NORMAL;
if (currentSize < MIN_PART_SIZE) {
currentSize = DEFAULT_PART_SIZE;
}
workBenchPartController.setSize(currentSize);
workBenchPartController.setMinSize(MIN_PART_SIZE);
workBenchPartController.setHidden(false);
} else if (state == State.COLLAPSED) {
// Ask the delegate to restore part stacks.
if (delegate != null) {
delegate.onRestore(this);
}
} else if (state == State.NORMAL) {
if (workBenchPartController.getSize() < MIN_PART_SIZE) {
workBenchPartController.setMinSize(MIN_PART_SIZE);
workBenchPartController.setSize(DEFAULT_PART_SIZE);
}
workBenchPartController.setHidden(false);
}
// Notify the part stack state has been changed.
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
eventBus.fireEvent(new PartStackStateChangedEvent(PartStackPresenter.this));
}
});
selectActiveTab(tab);
}
Aggregations