e4

How to remove a perspective from perspective toolbar(placed in the top right corner) programmatically

岁酱吖の 提交于 2019-12-12 03:35:38
问题 If i select a perspective(eg. Java EE perspective) from "open perspective" combo the perspective will be opened and it will be added near to the "open perspective" icon placed in the toolbar.Upon changing multiple perspectives the respective perspectives will be added in toolbar for shortcut purpose. I have an rcp application in which we can install selective/all plugins from the available list of plugins.First i am installing all the plugins, opening the rcp application(windows msi) and

Relative filepath to access resources

末鹿安然 提交于 2019-12-12 03:24:37
问题 I am quite new to Eclipse 4, RCP and SWT and I am stuck on this issue : I want to access image resources from code with a relative filepath. Problem is that the default location ./ is set to my home directory /home/name/ (I'm using Ubuntu). I have found that by creating a new File and printing its CanonicalPath. I am used to having the default location set to the project directory, such as /home/name/workspace/project/ , which is, from what I've seen so far, the default behavior in Eclipse /

how to open a text editor in eclipse 4.4 programmatically?

谁说胖子不能爱 提交于 2019-12-12 03:23:05
问题 I want to open a text editor in eclipse 4.4 programmatically. I've tried it using IDE class but it is not accessible in eclipse 4.4. How can I do this? 回答1: e4 only has parts, not editors and views. It also doesn't have any predefined text editors. Assuming you want to have several editor parts open at the same time you need to define a 'Part Descriptor' in the application model for the editor. You then create a part from the descriptor using: @Inject EPartService partService; MPart part =

Constructor of Part is being called twice

穿精又带淫゛_ 提交于 2019-12-12 01:44:19
问题 Short story: I have a class that is being used as a Part in the e4xmi. This class has a constructor, which initializes a list, and methods that are bindings from a DS (declarative service on OSGi). When the binding methods are called, this list should add or remove an item. The first time the constructor is called (automatically by the e4, because it's a Part in the Application Model), the list is initialized. Ok, that's how it is supposed to work. After that, an item is added to the list

How to save/restore the views in eclipse e4

一世执手 提交于 2019-12-12 01:43:03
问题 I have two sections. In the left section I am using checkbox tableviewer for displaying list of file names. The right section is for showing graphs(I am using JFreechart). I have a handler which is used for dynamically adding tabs to the right side section. IF I am in first tab and made some checkbox selections in left side tableviewer ,the graph is displayed in right side. When I create a new tab(right side) , the left side tableviewer should reset. When I select the first tab again and I

How to listen to lose focus event of a part in Eclipse E4 RCP?

ぃ、小莉子 提交于 2019-12-11 23:13:41
问题 I have multiple views in a perspective, these are shown as tabs. I want to catch the event when I switch from one Part to another (by clicking on the other parts tab). In other words I want to catch the event when a part looses focus. How can I do that in E4? I have tried IPartListener implementation but its methods are called twice and also too late. For example, if I have parts A and B and part A is in focus, when I click on tab for part B, the @Focus method of part B is called first and

SWT Section/ExpandableComposite in Eclipse e4 Project

跟風遠走 提交于 2019-12-11 20:09:43
问题 Is is not possible to use Eclipse Forms (org.eclipse.ui.forms) in pure e4 projects? I want to utilize an ExpandableComposite. When I start my application using the run/debug configuration everything works find. But as soon as I try to run it from the product configuration or is as a packaged e4 product, I'm getting a "Missing Constraint: Require Bundle: org.eclipse.ui.forms" error. Also, adding org.eclipse.ui.forms to the list of dependencies and starting the product, seems to alter my plugin

Toolbar does not scale correctly in E4

╄→尐↘猪︶ㄣ 提交于 2019-12-11 15:17:12
问题 I have a E4 application with some custom toolbar widgets. When the application ran in WIndows 10 without DPI scaling, everything looks fine. After chaning the DPI settings the application toolbar is not fully viewed. Correct view: With scaling enabled: The application.e4xmi looks like: The class that is responsible for creating the widget looks like: public class OpenOrderDropDown { @Inject private IEclipseContext context; private Combo combo; private static final String[] ITEMS = {"Default",

How to disable or enable a MMenu (not MMenuItem) in an Eclipse E4 application

ぐ巨炮叔叔 提交于 2019-12-11 14:46:58
问题 I have an Eclipse E4 application with a MMenu (in the main menu of the application and in popup menus of different parts) that contains items provided at runtime by a dynamic menu contribution. What I want to achieve is to disable the menu element, if the menu contribution does not provide any item. Something like @CanExecute for handler classes for commands or direct menu items. 回答1: Do you use the latest version of eclipse and you have an Application.e4xmi file? If so, for your "Dynamic

How to disable a Dynamic Menu Contribution parent in Eclipse 4 RCP Application

自作多情 提交于 2019-12-11 14:16:48
问题 This question stems from How to disable or enable a MMenu (not MMenuItem) in an Eclipse E4 application I have been attempting to grey-out/disable an entire Dynamic Menu Contribution in Eclipse 4 when a condition is met in the application. The Dynamic Menu Contribution is itself in the File Menu Model Element. My workaround has been to remove all options so the menu does not show anything, but is still active (not-grey) when the condition is met with the code below for clearing the menu. items