Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2013-10-08 04:20:42 -0400
committerTom Schindl2013-10-08 04:20:42 -0400
commit22b0846698f62978d207957c6145f0d8ad68aed1 (patch)
tree43895f8dc1ab29636cafbb0319d99ad772d9c4a2 /testcases
parentfe1db05585c8c3fc4a446c21387fa99d593ae722 (diff)
downloadorg.eclipse.efxclipse-22b0846698f62978d207957c6145f0d8ad68aed1.tar.gz
org.eclipse.efxclipse-22b0846698f62978d207957c6145f0d8ad68aed1.tar.xz
org.eclipse.efxclipse-22b0846698f62978d207957c6145f0d8ad68aed1.zip
Bug 418881 - Injecting ESelectionService does not work in contacts demo
Diffstat (limited to 'testcases')
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ContentPanel.java7
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ControlPanel.java18
2 files changed, 25 insertions, 0 deletions
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ContentPanel.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ContentPanel.java
index fb37883d8..a7c4eb620 100755
--- a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ContentPanel.java
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ContentPanel.java
@@ -3,6 +3,7 @@ package org.eclipse.fx.testcases.e4.parts;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
+import javax.inject.Named;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.di.extensions.EventTopic;
@@ -12,6 +13,7 @@ import org.eclipse.e4.ui.di.PersistState;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.e4.ui.di.UISynchronize;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.fx.testcases.e4.handlers.EventSender;
import javafx.event.Event;
@@ -64,6 +66,11 @@ public class ContentPanel {
System.err.println("Persiting State "+ part);
}
+ @Inject
+ void currentSelection(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) String selection) {
+ System.err.println("CURRENT SELECTION: " + selection);
+ }
+
// @Inject
// @Optional
// void eventSync(@EventTopic(EventSender.SYNC_EVENT) String event) {
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ControlPanel.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ControlPanel.java
index 513d66b1d..14d78b404 100755
--- a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ControlPanel.java
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/ControlPanel.java
@@ -1,5 +1,7 @@
package org.eclipse.fx.testcases.e4.parts;
+import java.util.UUID;
+
import javafx.collections.FXCollections;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
@@ -31,6 +33,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.impl.BasicFactoryImpl;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
import org.eclipse.fx.ui.services.Constants;
import org.eclipse.fx.ui.services.PopupMenuService;
@@ -41,6 +44,9 @@ public class ControlPanel {
IPresentationEngine engine;
private TextField focusField;
+ @Inject
+ ESelectionService selectionService;
+
@SuppressWarnings("rawtypes")
@Inject
public ControlPanel(BorderPane p, final MApplication application, final MWindow window, @Optional final MPerspective perspective, final EPartService partService, final EModelService modelService, PopupMenuService<Control> menuService) {
@@ -470,6 +476,18 @@ public class ControlPanel {
menuService.registerContextMenu(label, "org.eclipse.fx.testcases.e4.popupmenu.0");
box.getChildren().add(label);
}
+
+ {
+ Button button = new Button("Publish selection");
+ button.setOnAction(new EventHandler<ActionEvent>() {
+
+ @Override
+ public void handle(ActionEvent event) {
+ selectionService.setSelection(UUID.randomUUID().toString());
+ }
+ });
+ box.getChildren().add(button);
+ }
p.setTop(box);
}

Back to the top