diff --git a/com.vogella.tasks.ui/Application.e4xmi b/com.vogella.tasks.ui/Application.e4xmi index cfc428d0..d28eed54 100644 --- a/com.vogella.tasks.ui/Application.e4xmi +++ b/com.vogella.tasks.ui/Application.e4xmi @@ -3,7 +3,7 @@ - + NoAutoCollapse @@ -14,7 +14,7 @@ - + @@ -52,6 +52,7 @@ + @@ -67,6 +68,7 @@ + @@ -86,6 +88,7 @@ + diff --git a/com.vogella.tasks.ui/META-INF/MANIFEST.MF b/com.vogella.tasks.ui/META-INF/MANIFEST.MF index c03b4e66..08bf275b 100644 --- a/com.vogella.tasks.ui/META-INF/MANIFEST.MF +++ b/com.vogella.tasks.ui/META-INF/MANIFEST.MF @@ -24,7 +24,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.18.0", org.eclipse.swt, org.eclipse.jface Bundle-RequiredExecutionEnvironment: JavaSE-17 -Require-Capability: osgi.service;filter:="(objectClass=com.vogella.tasks.model.TaskService)" +Automatic-Module-Name: com.vogella.tasks.ui Import-Package: javax.annotation;version="1.3.5", javax.inject;version="1.0.0" -Automatic-Module-Name: com.vogella.tasks.ui +Require-Capability: osgi.service;filter:="(objectClass=com.vogella.tasks.model.TaskService)" diff --git a/com.vogella.tasks.ui/src/com/vogella/tasks/ui/handlers/ResizeSashChildren.java b/com.vogella.tasks.ui/src/com/vogella/tasks/ui/handlers/ResizeSashChildren.java new file mode 100644 index 00000000..00345533 --- /dev/null +++ b/com.vogella.tasks.ui/src/com/vogella/tasks/ui/handlers/ResizeSashChildren.java @@ -0,0 +1,26 @@ + +package com.vogella.tasks.ui.handlers; + +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.ui.model.application.ui.MUIElement; +import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; +import org.eclipse.e4.ui.model.application.ui.basic.MWindow; +import org.eclipse.e4.ui.workbench.modeling.EModelService; + + +public class ResizeSashChildren { + + @Execute + public void execute(EModelService modelService, MWindow window) { + // this code assume you main sash container uses the com.vogella.tasks.ui.partsashcontainer.main id + MUIElement muiElement = modelService.find("com.vogella.tasks.ui.partsashcontainer.main", window); + if (muiElement instanceof MPartSashContainer container) { + // we only handle the case in which we have two direct children + if (container.getChildren().size()==2) { + container.getChildren().get(0).setContainerData("300"); + container.getChildren().get(1).setContainerData("700"); + } + } + } + +} \ No newline at end of file