e4

Adding zest libraries to Eclipse 4 app

笑着哭i 提交于 2019-12-24 05:04:35
问题 I am new to both Zest and Eclipse e4 development. My aim for the moment is to build a simple app and in one of its views to visualize a graph using Zest. So I am following this tutorial and I ended up with a simple working app consisting of one main window split in 3 parts. Now I want to display a graph in one of the parts. In order to do that I have downloaded the whole GEF framework into my Eclipse from here using the "Install New Software" feature of Eclipse. So far so good. Next I try to

Programmatically resize a view in Eclipse

我只是一个虾纸丫 提交于 2019-12-23 19:01:43
问题 I'm testing an non-e4 RCP application using SWTBot and I need to change the size of my view. (Move the sash-bar) I unsuccessfully tried Resize my view using SWTBot (no such api) Resize my view using Eclipse 3 API (no supported) Resize my view using underlying e4 model (resizing not working) e4 model seams to be promising, but I'm missing something, so it doesn't work. I can Get MPart of my view: view = ePartService.findPart(ID) Get MTrimmedWindow: window = (view as EObject).eContainer as

eclipse rcp e4: how to highlight the selected tab in part stack?

落花浮王杯 提交于 2019-12-23 03:04:15
问题 What I have now (notice there is no highlight): What I want (highlight the currently active part): Thanks a lot! 回答1: These colors are controlled by your CSS. Assuming you are using the usual e4 tab renderer the selected tab color can be set with: .MPartStack.active { swt-selected-tabs-background: #E5EDFC #99BAF3 100%; } By the 'usual tab renderer' I mean: .MPartStack { swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt

Howto restart an e4 RCP application

安稳与你 提交于 2019-12-22 09:58:11
问题 A 3.* based RCP application will be restarted if IApplication.start returns IApplication.EXIT_RESTART. The class E4Application seems to always return EXIT_OK. org.eclipse.ui.IWorkbench also has a restart method, org.eclipse.e4.ui.workbench.IWorkbench does not. So how can I restart an e4 RCP application? 回答1: The current implementation in Eclipse 4.2 leads to a command with id org.eclipse.ui.file.restartWorkbench which ultimately leads to the handler class RestartWorkbenchHandler. This class

How to create my own shell to replace the shell created in the MTrimmedWindow in e4 RCP?

纵然是瞬间 提交于 2019-12-21 02:22:10
问题 Is there a way to replace the shell generated by Eclipse RCP for the MTrimmedWindow by a user defined window? Eclipse creates a shell with a particular style type, which can only be provided while creating. I want to remove maximize and resize from the shell element created for the MTrimmedWindow. If any one has a solution for the above problem please reply. 回答1: The style for the shell cannot be changed after creation, and the shell itself cannot be exchanged after it has been created by the

Eclipse Luna: Handlers' @CanExecute methods not called

柔情痞子 提交于 2019-12-19 09:46:47
问题 I'm having a problem with command handlers in Eclipse Luna RCP. In my E4 application model, I defined some commands and related handlers that must be enabled only under certain circumstances. For this reason, in my handler POJOs, I implemented methods annotated with @CanExecute where I check the required conditions. I also defined menu and toolbar items associated with those commands. The problem is that my @CanExecute methods aren't properly invoked and, as a consequence, menu and toolbar

Eclipse e4 RCP: Core Expressions - Something less XML-hell?

吃可爱长大的小学妹 提交于 2019-12-19 09:03:25
问题 I'm working on an E4 RCP application, and have a context menu which has menu items visible or not depending on the selection. The way I've found to do this is with core expressions defined in the plugin.xml like so: <extension point="org.eclipse.core.expressions.definitions"> <definition id="com.foo.bar.test.core.expression"> <with variable="org.eclipse.ui.selection"> <iterate ifEmpty="false"> <or> <instanceof value="com.foo.bar.Class1"> </instanceof> <instanceof value="com.foo.bar.Class2"> <

Trigger evaluation of PropertyTester

 ̄綄美尐妖づ 提交于 2019-12-19 04:16:09
问题 The code from two years back had to be upgraded to E4, and now a bunch of stuff does not work anymore. One of these is the IEvaluationService if used like this: <handler class="org.acme.PrintHandler" commandId="org.eclipse.ui.file.print"> <activeWhen> <with variable="activePart"> <test property="org.acme.printable" /> </with> </activeWhen> </handler> IEvaluationService service = (IEvaluationService) PlatformUI.getWorkbench().getService(IEvaluationService.class); service.requestEvaluation("org

How to Inject EPartService

微笑、不失礼 提交于 2019-12-18 13:35:46
问题 I am developing e4 application. I want to inject EPartService outside the Part and Handler when i am injecting EPartService then i will get null pointer error public class DisplayRuntimePart { @Inject EPartService partService; private void displayPart(){ MPart part=partService.findPart("com.rcpe4.myproject.part.datapart"); mpart.setVisible(true); partService.showPart(mpart, PartState.CREATE); } } I am also read this question but till not solve my problem E4 EPartService findPart() throwing

How to make Parts movable within a PartStack

这一生的挚爱 提交于 2019-12-14 00:36:03
问题 I'm trying to figure out how to make the Part's movable within a Part Stack in e4. Any ideas ? 回答1: To support drag and drop of parts you need the DndAddon and CleanupAddon specified in your Application.e4xmi. The Class URIs are: bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon bundleclass://org.eclipse.e4.ui.workbench.addons.swt/org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon This requires the org.eclipse.e4.ui.workbench