Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.e4.ui.workbench.UIEvents.EventTags;
import org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddonUtil;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
Expand Down Expand Up @@ -59,12 +63,20 @@ public final class ViewIntroAdapterPart extends ViewPart {
}

Object changedObj = event.getProperty(EventTags.ELEMENT);
if (!(changedObj instanceof MPartStack)) {
if (!(changedObj instanceof MPartStack) && !(changedObj instanceof MPlaceholder)) {
return;
}

if (changedObj != getIntroStack()) {
return;
MPartStack introStack = getIntroStack();
if (changedObj != introStack) {
MArea parentArea = MinMaxAddonUtil.getAreaFor(introStack);
if (parentArea != null && !(parentArea.getWidget() instanceof CTabFolder)) {
if (parentArea.getCurSharedRef() != changedObj) {
return;
}
} else {
return;
}
}

if (UIEvents.isADD(event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler;
import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
import org.eclipse.e4.ui.workbench.addons.minmax.MinMaxAddonUtil;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
Expand Down Expand Up @@ -191,7 +194,7 @@ public void setIntroStandby(IIntroPart part, boolean standby) {
return;
}

MPartStack introStack = getIntroStack(viewIntroAdapterPart);
MUIElement introStack = getIntroStack(viewIntroAdapterPart);
if (introStack == null) {
return;
}
Expand All @@ -204,22 +207,26 @@ public void setIntroStandby(IIntroPart part, boolean standby) {
}
}

private MPartStack getIntroStack(ViewIntroAdapterPart introAdapter) {
private MUIElement getIntroStack(ViewIntroAdapterPart introAdapter) {
ViewSite site = (ViewSite) introAdapter.getViewSite();

MPart introModelPart = site.getModel();
if (introModelPart.getCurSharedRef() != null) {
MUIElement introPartParent = introModelPart.getCurSharedRef().getParent();
if (introPartParent instanceof MPartStack) {
return (MPartStack) introPartParent;
if (introPartParent instanceof MPartStack parentStack) {
MArea parentArea = MinMaxAddonUtil.getAreaFor(parentStack);
if (parentArea != null && !(parentArea.getWidget() instanceof CTabFolder)) {
return parentArea.getCurSharedRef();
}
return introPartParent;
}
}

return null;
}

private boolean isIntroMaximized(ViewIntroAdapterPart introAdapter) {
MPartStack introStack = getIntroStack(introAdapter);
MUIElement introStack = getIntroStack(introAdapter);
if (introStack == null) {
return false;
}
Expand Down
Loading