When i create an eclipse 4 application using the wizard it automatically creates these default toolbar and menus.
It seems that whatever i do they just stay there.
I cannot modify them and the only thing that works is modifying the handler's code.
The reason is that the workspace is not updated for some reason so what i did is marked the "clear workspace data" checkbox on the launch config and it is solved
Related
JMSToolBox is an eclipse-rcp v4.5.2 based application.
I tried to upgraded to eclipse v4.6.0 but found a problem with popups menu as follows:
A part is defined in the e4 model as a Part Descriptor (PD). A popup menu is defined inside that PD
On a certain action, the PD descriptor is instanciated and the part is added and displayed in a Part Stack. The body of this part is a TabFolder with multiple tabs corresponding to a JMS Q browsed. Each tab body is basically composed of a TableViewer/Table to display JMS messages.
Each time a new tab is created, a new TableViewer/Table is created and the popupmenu is registered on the Table of the TableViewer with the following line of code:
menuService.registerContextMenu(table,<id of the popup menu in the part>);
This works perfectly with eclipse v4.5.2 (Mars) but not with v4.6.0 (Neon) !
With neon, the popup is working only for the first tab: the context menu is visible and #CanExecute methods associated to the handlers/commands of the menu items are called . For subsequent tabs created, no popup is displayed and #CanExecute methods for the menu items are not called
If I register a different menu with a different Id (previously added to the PD) for each tab, it works! So I suspect this may be due to the fact that a menu with the same element id is added to multiple TableViever/Table even if it is coming from a different instance of a PD...
Is it a bug in neon? a regression? or do I benefit of a bug in mars that makes the application is working Ok with this version?
For now I have to downgrade (or not upgrade) to eclipse v4.5.2..
For reference, I pushed some code to correct the problem. It will be in eclipse v4.6.1+ bug #496695
I want to change my custom perspective's icon in eclipse. I have searched a lot but I didn't find any solution.
The icon for a perspective can be changed by updating the iconURI attribute of the perspective's definition in workbench.xmi file. This file is located inside the .metadata directory of the workspace. e.g. /My-Workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi.
There are usually two lines with the iconURI attribute. For example:
<children xsi:type="advanced:Perspective" ... iconURI="platform:/plugin/com.atlassian.clover.eclipse.core/icons/cview16/clover.gif" tooltip="Clover">
and
<snippets xsi:type="advanced:Perspective" ... iconURI="platform:/plugin/com.atlassian.clover.eclipse.core/icons/cview16/clover.gif" tooltip="Clover">
The icon URI is a path to an image within an Eclipse plugin. (Plugins are located at {ECLIPSE_HOME}/plugins directory.)
The workbench.xmi file needs to be edited after closing the Eclipse IDE, because the file gets overwritten when you exit from Eclipse.
In this example I created a custom perspective named Clover by modifying the Java Perspective available in Eclipse, and saving it as "Clover". Initially my perspective had the same icon as the Java perspective:
So I closed Eclipse, changed the icon paths in workbench.xmi, saved the file, reopened the IDE, and got the new icon displayed:
Note: I use Eclipse 4.6.0 (Neon) but this solution would work for all Eclipse 4 versions.
If you stored an existing perspective under a different name as your custom perspective, then it is not possible to change the icon.
You would have to define the perspective by writing a small Eclipse plugin to be able to change the icon.
Open plugin.xml for your plugin; go to the Extensions page; and select your perspective extension (in org.eclipse.ui.perspectives: you should have your custom prspective entered in here). There is an icon attribute you can set for your custom perspective. (I am using Neon2)
I can't delete some working set, when I cleared up my projects working sets. The properties of this working set is as following. How can I delete it?
My eclipse version: Juno SR1 20120920-0800
You cannot delete it.
The "Other Projects" working set is a special working set. It exists to show you projects that are not explicitly inside a working set.
Why are you trying to delete it?
The only time you should care about it is if you have multiple working sets in your workspace. The "Other Projects" working set is very useful if you have Top-Level Elements->Working Sets selected in your package explorer (it's under that little triangle menu):
In this example, I've defined two working sets, Android and Collage to organize code in my workspace. Any projects not assigned to either of these working sets will appear under Other Projects so I can still see them (and possibly drag them to other working sets).
Working set can not be deleted, but you can hide it. Select the Other Projects and click right button and you will see the delete button.
I'm using Eclipse 3.7 on Ubuntu. Often, after editing a file, I cannot save it - the "save" option is greyed out in the menu and Ctrl+s seems to do nothing, even though the file has just been modified and the editor displays the asterisk before the file name in the tab header.
Changing the active tab to another file and then coming back to the first file "unlocks" the save option, which I can then choose.
What causes this behavior, and how can I fix it?
This is a reported bug in Eclipse. You can follow up and bring more information in the bug report in Eclipse's bugzilla.
The easiest workaround I could find was to just restart eclipse. Worked for me.
That can also happen when the Project Explorer view has focus (bug 211520)
The new Eclipse 2019-09 has fixed that issue
You can now save the active editor even when the Project Explorer has focus.
In cases where an extension contributes Saveables to the Project Explorer, the extension is honored and the save action on the Project Explorer will save the provided saveable item instead of the active editor.
In Eclipse, if I change a file programmatically, and it is open in a text editor, it doesn't always reload, not even when refreshing the resource programmatically. How can I forcibly reload the text editor from code so that it show the changed file contents?
In your project explorer or navigator, you can right-click on the file that's currently open and select refresh. This has always worked for me, even when editing files with several programs. Make sure to click the file itself, not parent objects like packages or folders or projects.
Edit
Refreshing programmatically? I would look into an Eclipse scripting tool:
http://eclipse-shell.sourceforge.net/
I guess there was another one called Monkey, but it doesn't appear to be maintained.
I don't know of any possibility to programmatically reload the file.
Some editors (e.g. GMF editors) look for changes in the underlying files, and refresh themselves, but this is not required at all.
I don't think that a forced reload is an option implemented globally, as in some cases there could be some merging steps involved that can be quite erroneous.
My ideas to solve this:
Have a specific editor that refreshes its content when the used resource changes (this can be timeconsuming);
Or close the editors of the file and reopen them (this is ugly in the eye of the user).
Since the Luna release of eclipse there's no need to reload files with F5/manual Refresh.
Really nice, especially as there was a bug with the F5 key binding.