Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/.settings/org.eclipse.jdt.core.prefs113
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveRenderer.java50
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWindowRenderer.java52
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WWindow.java5
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/.settings/org.eclipse.jdt.core.prefs113
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefWindowRenderer.java74
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/Application.e4xmi3
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ExtraWindowPart.java23
8 files changed, 413 insertions, 20 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/.settings/org.eclipse.jdt.core.prefs
index f42de363a..5671530f4 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,114 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveRenderer.java
index a8b6bcf73..4175e79c0 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BasePerspectiveRenderer.java
@@ -17,15 +17,18 @@ import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainerElement;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.UIEvents;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.fx.core.log.Log;
import org.eclipse.fx.core.log.Logger;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WLayoutedWidget;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WPerspective;
+import org.eclipse.fx.ui.workbench.renderers.base.widget.WWindow;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
@@ -100,12 +103,31 @@ public abstract class BasePerspectiveRenderer<N> extends BaseRenderer<MPerspecti
}
getWidget(element).addItems(list);
- for( MWindow w : element.getWindows() ) {
- engineCreateWidget(w);
+ if( ! element.getWindows().isEmpty() ) {
+ MWindow window = findParent((EObject) element);
+ WWindow<?> topLevel = (WWindow<?>) window.getWidget();
+ for( MWindow w : element.getWindows() ) {
+ topLevel.addChild((WWindow)engineCreateWidget(w));
+ }
}
}
-
- @SuppressWarnings("unchecked")
+
+ private static MWindow findParent(EObject e) {
+ if( e.eContainer() instanceof MApplication ) {
+ return null;
+ }
+
+ do {
+ e = e.eContainer();
+ if( e instanceof MWindow ) {
+ return (MWindow) e;
+ }
+ } while( e.eContainer() != null );
+
+ return null;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void childRendered(MPerspective parentElement, MUIElement element) {
if( inContentProcessing(parentElement) ) {
@@ -114,9 +136,19 @@ public abstract class BasePerspectiveRenderer<N> extends BaseRenderer<MPerspecti
if( element instanceof MPartSashContainerElement ) {
getWidget(parentElement).addItem(getRenderedIndex(parentElement, element),(WLayoutedWidget<MPartSashContainerElement>)element.getWidget());
+ } else if( element instanceof MWindow ) {
+ MWindow parent = findParent((EObject) parentElement);
+ WWindow<?> w = (WWindow<?>) parent.getWidget();
+ if( w != null ) {
+ WWindow ww = (WWindow)element.getWidget();
+ if( ww != null ) {
+ w.addChild(ww);
+ }
+ }
}
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void hideChild(MPerspective container, MUIElement changedObj) {
WPerspective<N> perspective = getWidget(container);
@@ -126,11 +158,19 @@ public abstract class BasePerspectiveRenderer<N> extends BaseRenderer<MPerspecti
}
if( changedObj instanceof MPartSashContainerElement ) {
- @SuppressWarnings("unchecked")
WLayoutedWidget<MUIElement> widget = (WLayoutedWidget<MUIElement>) changedObj.getWidget();
if( widget != null ) {
perspective.removeItem(widget);
}
+ } else if( changedObj instanceof MWindow ) {
+ MWindow parent = findParent((EObject) container);
+ WWindow<?> w = (WWindow<?>) parent.getWidget();
+ if( w != null ) {
+ WWindow ww = (WWindow)changedObj.getWidget();
+ if( ww != null ) {
+ w.removeChild(ww);
+ }
+ }
}
}
} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWindowRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWindowRenderer.java
index e48e07eb6..7cefc2153 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWindowRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWindowRenderer.java
@@ -23,6 +23,7 @@ import org.eclipse.e4.core.di.InjectionException;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.e4.ui.di.Persist;
import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.MApplicationElement;
import org.eclipse.e4.ui.model.application.ui.MContext;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
@@ -40,6 +41,7 @@ import org.eclipse.fx.core.log.Log;
import org.eclipse.fx.core.log.Logger;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WCallback;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WLayoutedWidget;
+import org.eclipse.fx.ui.workbench.renderers.base.widget.WWidget;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WWindow;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
@@ -218,6 +220,20 @@ public abstract class BaseWindowRenderer<N> extends BaseRenderer<MWindow,WWindow
return null;
}
});
+ widget.setOnCloseCallback(new WCallback<WWindow<N>, Boolean>() {
+
+ @Override
+ public Boolean call(WWindow<N> param) {
+ //TODO Call out to lifecycle
+
+ //Set the render flag for other windows
+ //TODO What do we do with: other top-level windows, ...
+ if( ! ((MApplicationElement)param.getDomElement().getParent() instanceof MApplication) ) {
+ param.getDomElement().setToBeRendered(false);
+ }
+ return Boolean.TRUE;
+ }
+ });
getModelContext(element).set(ISaveHandler.class, new DefaultSaveHandler(element, widget));
}
@@ -271,18 +287,28 @@ public abstract class BaseWindowRenderer<N> extends BaseRenderer<MWindow,WWindow
}
}
-// for( MWindow w : element.getWindows() ) {
-// engineCreateWidget(w);
-// }
+ for( MWindow w : element.getWindows() ) {
+ if( w.isVisible() && w.isToBeRendered() ) {
+ WWidget<MWindow> widget = engineCreateWidget(w);
+ if( widget != null ) {
+ @SuppressWarnings("unchecked")
+ WWindow<N> ww = (WWindow<N>) w.getWidget();
+ windowWidget.addChild(ww);
+ }
+ }
+ }
}
@Override
public void postProcess(MWindow element) {
super.postProcess(element);
- if( element.isVisible() ) {
- WWindow<N> window = getWidget(element);
- if( window != null ) {
- window.show();
+ //Only top level windows are shown explicitly
+ if( ((EObject)element).eContainer() instanceof MApplication ) {
+ if( element.isVisible() ) {
+ WWindow<N> window = getWidget(element);
+ if( window != null ) {
+ window.show();
+ }
}
}
}
@@ -301,6 +327,12 @@ public abstract class BaseWindowRenderer<N> extends BaseRenderer<MWindow,WWindow
WLayoutedWidget<MWindowElement> widget = (WLayoutedWidget<MWindowElement>) element.getWidget();
window.addChild(idx, widget);
}
+ } else if( element instanceof MWindow ) {
+ WWindow<N> window = getWidget(parentElement);
+ if( window != null ) {
+ WWindow<N> ww = (WWindow<N>) element.getWidget();
+ window.addChild(ww);
+ }
}
}
@@ -313,6 +345,12 @@ public abstract class BaseWindowRenderer<N> extends BaseRenderer<MWindow,WWindow
WLayoutedWidget<MWindowElement> widget = (WLayoutedWidget<MWindowElement>) changedObj.getWidget();
window.removeChild(widget);
}
+ } else {
+ WWindow<N> window = getWidget(container);
+ if( window != null ) {
+ WWindow<N> ww = (WWindow<N>) changedObj.getWidget();
+ window.removeChild(ww);
+ }
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WWindow.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WWindow.java
index 3604c37f3..87aeb7cda 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WWindow.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WWindow.java
@@ -27,6 +27,11 @@ public interface WWindow<N> extends WWidget<MWindow> {
public void addChild(int idx, WLayoutedWidget<MWindowElement> widget);
public void removeChild(WLayoutedWidget<MWindowElement> widget);
+ public void addChild(WWindow<N> widget);
+ public void removeChild(WWindow<N> widget);
+
+ public void setOnCloseCallback(WCallback<WWindow<N>, Boolean> closeCallback);
+
public void show();
public void close();
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/.settings/org.eclipse.jdt.core.prefs
index f42de363a..5671530f4 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,114 @@
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefWindowRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefWindowRenderer.java
index 7522e120e..39e844e1c 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefWindowRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefWindowRenderer.java
@@ -19,6 +19,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.concurrent.atomic.AtomicBoolean;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
@@ -44,7 +45,6 @@ import javafx.scene.control.TableColumn.CellEditEvent;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
@@ -53,6 +53,7 @@ import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.Window;
+import javafx.stage.WindowEvent;
import javafx.util.Callback;
import javax.annotation.PostConstruct;
@@ -68,10 +69,10 @@ import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.model.application.ui.basic.MWindowElement;
import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
-import org.eclipse.e4.ui.workbench.IResourceUtilities;
import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.e4.ui.workbench.modeling.ISaveHandler.Save;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.fx.ui.di.InjectingFXMLLoader;
import org.eclipse.fx.ui.dialogs.Dialog;
import org.eclipse.fx.ui.dialogs.MessageDialog;
@@ -87,6 +88,7 @@ import org.eclipse.fx.ui.workbench.renderers.base.BaseRenderer;
import org.eclipse.fx.ui.workbench.renderers.base.BaseWindowRenderer;
import org.eclipse.fx.ui.workbench.renderers.base.services.WindowTransitionService;
import org.eclipse.fx.ui.workbench.renderers.base.services.WindowTransitionService.AnimationDelegate;
+import org.eclipse.fx.ui.workbench.renderers.base.widget.WCallback;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WLayoutedWidget;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WWidget;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WWindow;
@@ -182,6 +184,10 @@ public class DefWindowRenderer extends BaseWindowRenderer<Stage> {
private IEclipseContext applicationContext;
+ private List<WWindow<Stage>> windows = new ArrayList<>();
+
+ private WCallback<WWindow<Stage>, Boolean> onCloseCallback;
+
@Inject
public WWindowImpl(@Named(BaseRenderer.CONTEXT_DOM_ELEMENT) MWindow mWindow, @Optional KeyBindingDispatcher dispatcher, MApplication application) {
this.mWindow = mWindow;
@@ -220,9 +226,41 @@ public class DefWindowRenderer extends BaseWindowRenderer<Stage> {
sceneRegistration.dispose();
}
+ private static MWindow findParent(EObject e) {
+ if( e.eContainer() instanceof MApplication ) {
+ return null;
+ }
+
+ do {
+ e = e.eContainer();
+ if( e instanceof MWindow ) {
+ return (MWindow) e;
+ }
+ } while( e.eContainer() != null );
+
+ return null;
+ }
+
@Override
protected Stage createWidget() {
stage = new Stage();
+ MWindow parent = findParent((EObject) mWindow);
+ if( parent != null ) {
+ stage.initOwner((Window) ((WWindow<?>)parent.getWidget()).getWidget());
+ }
+
+ stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
+
+ @Override
+ public void handle(WindowEvent event) {
+ if( onCloseCallback != null ) {
+ if( ! Boolean.TRUE.equals(onCloseCallback.call(WWindowImpl.this)) ) {
+ event.consume();
+ }
+ }
+ }
+ });
+
stage.focusedProperty().addListener(new ChangeListener<Boolean>() {
@Override
@@ -452,6 +490,11 @@ public class DefWindowRenderer extends BaseWindowRenderer<Stage> {
protected BorderPane getWidgetNode() {
return rootPane;
}
+
+ @Override
+ public void setOnCloseCallback(WCallback<WWindow<Stage>, Boolean> onCloseCallback) {
+ this.onCloseCallback = onCloseCallback;
+ }
@Inject
public void setX(@Named(UIEvents.Window.X) int x) {
@@ -526,7 +569,29 @@ public class DefWindowRenderer extends BaseWindowRenderer<Stage> {
getWidget().close();
}
+ @Override
+ public void addChild(WWindow<Stage> widget) {
+ windows.add(widget);
+ if( initDone && stage.isShowing() ) {
+ Stage s = (Stage) widget.getWidget();
+ s.show();
+ }
+ }
+
+ @Override
+ public void removeChild(WWindow<Stage> widget) {
+ if( widget.getWidget() != null ) {
+ Stage s = (Stage) widget.getWidget();
+ s.hide();
+ }
+ windows.remove(widget);
+ }
+
private void internalShow() {
+ if( getWidget().isShowing() ) {
+ return;
+ }
+
if( windowTransitionService != null ) {
AnimationDelegate<Stage> delegate = windowTransitionService.getShowDelegate(mWindow);
if( delegate != null ) {
@@ -537,9 +602,14 @@ public class DefWindowRenderer extends BaseWindowRenderer<Stage> {
} else {
getWidget().show();
}
+
+ for( WWindow<Stage> c: windows ) {
+ c.show();
+ }
}
private void internalHide() {
+ //TODO Do we need to hide them recursively???
if( windowTransitionService != null ) {
AnimationDelegate<Stage> delegate = windowTransitionService.getShowDelegate(mWindow);
if( delegate != null ) {
diff --git a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
index 2e8a3ee7f..3a5c27c42 100755
--- a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
+++ b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
@@ -149,6 +149,9 @@
<children xsi:type="menu:DynamicMenuContribution" xmi:id="_euWogC_uEeOp1Ym1-ovQ6w" elementId="org.eclipse.fx.testcases.e4.dynamicmenucontribution.2" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.contributions.DMContribution"/>
</children>
</mainMenu>
+ <windows xmi:id="_tJumwF5uEeOE9IXWSZlx5Q" elementId="org.eclipse.fx.testcases.e4.window.0" label="Extra Window" x="100" y="100" width="200" height="200">
+ <children xsi:type="basic:Part" xmi:id="_i0GJgF6LEeOE9IXWSZlx5Q" elementId="org.eclipse.fx.testcases.e4.part.16" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.ExtraWindowPart"/>
+ </windows>
<sharedElements xsi:type="basic:Part" xmi:id="_T4J0kPW5EeG7tr8qKhf17Q" elementId="org.eclipse.fx.testcases.e4.part.7" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.ContentPanel" label="C7"/>
<sharedElements xsi:type="basic:PartSashContainer" xmi:id="_wH3xYCTGEeKdCOcPGN2T3w" elementId="org.eclipse.fx.testcases.e4.partsashcontainer.1">
<children xsi:type="basic:Part" xmi:id="_wppBsCTGEeKdCOcPGN2T3w" elementId="org.eclipse.fx.testcases.e4.part.8" containerData="1" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.ContentPanel" label="P 8"/>
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ExtraWindowPart.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ExtraWindowPart.java
new file mode 100644
index 000000000..082b23629
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ExtraWindowPart.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.testcases.e4.parts;
+
+import javafx.scene.control.Label;
+import javafx.scene.layout.BorderPane;
+
+import javax.annotation.PostConstruct;
+
+public class ExtraWindowPart {
+ @PostConstruct
+ void init(BorderPane parent) {
+ parent.setCenter(new Label("I'm in an extra window"));
+ }
+}

Back to the top