rcp

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 /

Eclipse RCP: How to pre-select a new project wizard?

独自空忆成欢 提交于 2019-12-12 01:43:14
问题 I have an Eclipse plugin using RCP and Eclipse 4.5.2. This plugin is for developing a project of type "X". Right now, under File > New > Project... I have "X" within a category of "MyPlugin". I'd have to expand "MyPlugin" then double click on "X" to open the X version of the new project wizard. Is it possible to pre-select "X" when clicking on File > New > Project...? This would mean the category "MyPlugin" would have to be automatically expanded to show the pre-selected "X". Here's a snippet

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

Filtering contents in Eclipse Common Navigator Framework view

ぃ、小莉子 提交于 2019-12-11 15:07:14
问题 I am developing a 3.x based Eclipse RCP application. In the part of application, I am implementing Common-navigator plugin of Eclipse itself, in order to display resources in the workspace. I'have created the navigator view shown below: But I would like display only one tree child element. More specifically, I only want clause folder and its elements to be shown. What is the accurate way to do it? 回答1: Add dependecy of org.eclipse.ui.navigator if not exists in plugin.xml. Add extension point

Java RCP - Not able to dynamically set text to SWT label control

纵然是瞬间 提交于 2019-12-11 14:45:37
问题 In one of our rcp application's window, I need to set label text dynamically after the creation of the window. When the window is created I would have created the label control but I would not set the text by then. After user selects a button on the window, I want to set the text of the label inside the button's selection listener method. After setting text to label inside button's selection listener method I am not able to see the text on the window. Why is that I am not able to see the

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

Removing a view from Eclipse Window -> Show views

我的未来我决定 提交于 2019-12-11 13:25:59
问题 We have an application in which some views only work when attached to certain perspectives. We want to remove those views from the Window -> Show View dialog so that users cannot add them to perspectives where they don't work. Any ideas on how to do this either programmatically or declaratively? I have tried using <visibleWhen /> , but the views are still showing in the dialog: <view class="com.mycompany.ViewClass" id="com.mycompany.ViewId" name="View Name" restorable="true"> <visibleWhen>

How to contribute to the Eclipse IDE from a model fragment

有些话、适合烂在心里 提交于 2019-12-11 11:08:53
问题 I need to contribute a part (with a command and handler) to the eclipse IDE. I'm using Eclipse RCP and RAP developers (Mars 4.5) and I don't know how to program my handler so my part goes to the editor of the eclipse ide. My part contributor is something like this: public class Menu extends ViewPart { @PostConstruct @Override public void createPartControl(Composite parent) { parent.setLayout(null); Label lblService = new Label(parent, SWT.NONE); lblService.setBounds(67, 49, 40, 15);

Opening a new Window with Java RCP and SWT

末鹿安然 提交于 2019-12-11 09:26:38
问题 I'm currently developing an app, and for this, I'm using Java RCP with SWT. What I want : I have a window, and when I click on a Button, i need a whole window to be opened. The window works perfectly and looks like this : Window1 When I press it, a new window opens. It looks like this : Window2 (Yup, the middle pic has its importance) How it's currently done : The Window 1 is a TrimmedWindow done with the Application.e4xmi, with some Parts in. The button is included in one of these parts.

Stop Parts from being detachable

你说的曾经没有我的故事 提交于 2019-12-11 07:53:58
问题 I would like to stop Parts from being detachable in Eclipse RCP 4. Currently if I right click on a Part I can select detach. From this I can then close the tab even if the Part isn't Closeable . In RCP 3 when a detached View is closed it would then return back to its original location but now it closes completely. Structure Part Config How can I remove the option to detach a Part ? Also how can I stop a detached Part from being closed or make it return to its original location? 回答1: To stop