eclipse-rcp

Eclipse RCP obtain toolbar contributions programmatically

岁酱吖の 提交于 2019-12-20 03:12:47
问题 I have an RCP application and I want disable/enable some elements of the toolbar when I perform some actions. My extension: <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar"> <toolbar id="vendor.toolbar1h"> <command commandId="vendor.commands.MyCommand" icon="icon.png" id="MyButtonID1" style="toggle"> </command> </toolbar> </menuContribution> </extension> I try to enumerate all the toolbar contributions with this code, but it doesn't

Hide Coolbar/Toolbar items/Preference pages in Eclipse RCP application (Eclipse e4)

删除回忆录丶 提交于 2019-12-20 02:37:13
问题 In our Eclipse RCP application (using Eclipse 3.7 ) I had overridden WorkbenchWindowAdvisor.postWindowCreate() method, to hide the unwanted Coolbar/Toolbar items like File , Run etc. menus and Run Last Tool , Search etc. toolbar buttons and it was working fine. Now I have moved my code to Eclipse e4 4.1.2 and when I run my RCP application now it gets launched but it is showing these unwanted Coolbar/Toolbar items. On some digging into the issue I found out that WorkbenchWindowAdvisor

Automatically generate IDs on SWT-Widgets

梦想与她 提交于 2019-12-19 21:23:22
问题 Is there a way to automatically generate IDs on SWT-Widgets so UI-Tests can reference them? I know i can manually set an id using seData but I want to implement this feature for an existing application in a somewhat generic fashion. 回答1: You can recursively assign IDs for all your shells in your application using Display.getCurrent().getShells(); and Widget.setData(); . Setting the IDs Shell []shells = Display.getCurrent().getShells(); for(Shell obj : shells) { setIds(obj); } You have access

Eclipse: Storing info in .project file

為{幸葍}努か 提交于 2019-12-19 16:27:22
问题 I'm trying to associate information with projects (certain properties). I tried using the persistence store ( getPersistentProperty() and setPersistentProperty() ). The problem with that is that when I export the project and re-import it in a different workspace, those properties are gone (since they are stored somewhere in the .metadata folder of the workspace). So I was thinking that if there's a way to store the info in the .project file then this would solve my problem because this file

how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

泄露秘密 提交于 2019-12-19 10:05:09
问题 I am loading my ComboViewer with over one thousand elements. Some elements are longer than the width of underlying combo . I want to add tooltip on the entries and NOT on the combo . I want it in such a way that, when the list drops down and the user places the mouse pointer over one of the value, the entire text should be displayable via tooltip similar to the tooltip shown for a JFace TableViewer . 回答1: If you are using a ComboViewer and you provide your own CCombo instance, you can get

how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

不羁岁月 提交于 2019-12-19 10:04:03
问题 I am loading my ComboViewer with over one thousand elements. Some elements are longer than the width of underlying combo . I want to add tooltip on the entries and NOT on the combo . I want it in such a way that, when the list drops down and the user places the mouse pointer over one of the value, the entire text should be displayable via tooltip similar to the tooltip shown for a JFace TableViewer . 回答1: If you are using a ComboViewer and you provide your own CCombo instance, you can get

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

Display.getCurrent().asyncExec not run in parallel?

回眸只為那壹抹淺笑 提交于 2019-12-19 08:20:07
问题 Here is my code: Display.getCurrent().asyncExec(new Runnable() { public void run() { try { Event e1 = new Event(); e1.type = EVT_CONNECTING; for (Listener listener : listeners) { listener.handleEvent(e1); } database = new Database(cp.getName(), cp.getConnection()); Event e2 = new Event(); e2.type = EVT_CONNECT_SUCCESS; for (Listener listener : listeners) { listener.handleEvent(e2); } } catch (Exception ex) { log.error(ex.getMessage(), ex); Event e = new Event(); e.text = ex.getMessage(); e

How do I make a view scrollable in an Eclipse RCP application?

三世轮回 提交于 2019-12-19 07:18:45
问题 What I tried so far: In createPartControl: ScrolledComposite sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); sc.setLayoutData(new GridData(GridData.FILL_BOTH)); sc.setExpandVertical(true); sc.setExpandHorizontal(true); sc.setSize(ApplicationWorkbenchWindowAdvisor.WIDTH, ApplicationWorkbenchWindowAdvisor.HEIGHT); final TabFolder tabFolder = new TabFolder(sc, SWT.TOP); but this does not work. My problem is that if I resize my program window the scrollbars does not appear in my

Lazy activation of Eclipse plugins

蹲街弑〆低调 提交于 2019-12-19 07:05:34
问题 I would like to know what is "Activate this plug-in when one of its classes is loaded" check-box in Eclipse manifest editor useful for. I thought Eclipse always use "lazy initialization" approach. Does have this option a relation to the BundleActivator class of the plugin? is initialization something different to activation? Here is a similar question, but I don't understand it entirely. 回答1: Ticking the box causes the following header to be set in the manifest: Bundle-ActivationPolicy: lazy