ContextMenu not showing [message #1782865] |
Fri, 02 March 2018 16:29  |
Eclipse User |
|
|
|
I have a TableView and would like to show a Context Menu when right-clicking.
I do as follows:
final ContextMenu cm = new ContextMenu();
cm.getItems().add(new MenuItem("bu"));
table.setContextMenu(cm);
For a "vanilla" FXApplication it works as expected. When I try the same in an e4 context, the Context Menu does not show up.
The View/Part class looks like this:
public class ViewTable {
@Inject
protected Composite parent;
private FXCanvas fxCanvas;
public ViewOrphanPeaksTable() {
};
@PostConstruct
public void createControl() {
init(parent);
}
protected void init(final Composite parent) {
// this will initialize the FX Toolkit
fxCanvas = new FXCanvas(parent, SWT.NONE);
Platform.setImplicitExit(false);
Platform.runLater(() -> createScene(parent));
}
@Focus
public void setFocus() {
fxCanvas.setFocus();
}
}
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03712 seconds