Menu

HowToEclipse

Remo
Attachments
activities.png (46750 bytes)
activities2.png (83146 bytes)
activities3.png (33429 bytes)
activities4.png (29408 bytes)
contextMenuID.png (49067 bytes)
contextMenuID2.jpg (43686 bytes)
eclipseInspector.png (3403 bytes)
menuID.png (18986 bytes)
menuTree1.png (4116 bytes)
menuTree2.png (7097 bytes)
toolItem1.png (20864 bytes)
toolItem2.png (45434 bytes)
toolItem3.jpg (46457 bytes)
toolItem4.png (23939 bytes)
toolItem5.png (33270 bytes)

Eclipse

HowTo: get an idea of the tree hierarchy
HowTo: find menu contribution ID
HowTo: find toolbar action contribution
HowTo: find the published context menu IDs
HowTo: find current workbench selection
HowTo: to find an extension point
HowTo: to find a service
HowTo: find activities
HowTo: find IDs for activities creation

ToDo?: Explain “catcher” and refresh. Pay attention to the active part stuff!

[HowTo]: get an idea of the tree hierarchy


The navigation part of the object inspection view contains 7 top level elements:

  • Contribution: shows the bundle from which the active part is contributed
  • Main-Menu: contains all the main menu items. Note: if the the main menu items like “File” or “Edit” is empty you have to open the menu and refresh the Eclipse Inspector.
  • Workbench: provides information about the most important workbench elements like active Workbench(-Window), part, opened perspective, views and editors. If you want to know e.g. all available view-contributions to the application (not only the already opened one) you’ll find them under the “All ExtensionPoints?” item (“org.eclipse.ui.views”).
  • OSGI Services: Lists all available OSGi services with all parameters
  • Eclipse Services: Gives an overview on the most important services installed in the eclipse environment. Activities and Commands are handled a bit special. For better overview they got their own hierarchy.
  • All ExtensionPoints?: lists all extensions available in the platform. Note: Extension values cannot be changed here.
  • Bundles: same functionality like [BundleInspector].

[HowTo]: find menu contribution ID

What to do if menu is empty (only data is there) -> open all the menus and then refresh


The id is available in the “*Data” object: property id:

[HowTo]: find toolbar action contribution

Note: use for that purpose the SWT Inspector! The fastest way is enable capturing and push the toolitem direct which means that the action is run. This can cause problems especial if the toolitem will be disposed (like the “New Java Project” toolitem). If no result is shown in the SWT Inspector then keep capturing enabled and select another workbench control. If in the SWT Inspector is an element selected try again to select the toolitem. It should select now the toolitem.

If you have a problem with disposed toolitems then try to inspect the toolbar instead of the item.
The toolbar has a property called items:

Double click it and a new inspector dialog is opened:

Select the second one -> double click and you get the “save” toolitem:

[HowTo]: find the published context menu IDs

Enable the smiley and click on the workbench part you want to inspect. Go to the “Part’s Site” element. The ContextMenuIds?-property contains all context menus which are registered for this site.

[HowTo]: find current workbench selection

Workbench -> Selection
or
Workbench -> Page -> selection-property.
Pay attention: if you want to inspect the selection through the page selection property! the page-Object properties will be loaded dynamically. If the Page-Node is selected (and was not selected before), the active part is normally net.sf.yari.eclipse.EclipseInspectorViewPart?. You have to select the Page-node (important step!) and then click the “smiley” to catch again the workbench part. The page will have now the properties of the inspected page-object loaded (including the correct selection).

[HowTo]: to find an extension point

You have just installed a lot of different 3rd party bundles and features for your Eclipse IDE or you just created a complete RCP-Product for your business with brand new features and suddenly your workbench starting behavior is much slower than before.
If you are curious you may want to have a look at the [BundleInspector] for showing all active bundles (do have bundles ab, cd, …, and xy to be in an active state now?) or you could have a look at “All ExtensionPoints?” item for the famous "org.eclipse.ui.startup" extension point and realize that there is now (instead of the three or four well known plug-ins) a bunch of bundles which use this hook for different purposes.
Perhaps the time consuming tasks (e.g. initialization of some sort of caches) which are done there could be scheduled more efficient?

Of course you can also have a look at the pde manifest editor and use the “find references” action for extensions. But you will only find the bundles which either are in workspace or included in the target platform.
With Eclipse Inspector you will see all extensions at runtime!

[HowTo]: to find a service

Description comming soon.

[HowTo]: find activities

Description comming soon.

[HowTo]: find IDs for activities creation

You want to build a rcp application without the 'General'-Preferences item in the eclipse preferences?

You can use activities to remove this contribution. But therefore you need to know the contribution plugin and bundle...
To get all these informations use the following steps:

  • Open the preferences dialog. Hover over the tree and press ctrl+alt+-. The yari inspection dialog should appear (if not, close the prefernces, open the SWT Inspector view to be sure that the bundle is loaded and try again).
  • Select Tree{} and on the Object tab open items by doubleclicking
  • Open the item 0: TreeItem?{General} and switch to the Data-Tab

  • the id is: org.eclipse.ui.preferencePages.Workbench

  • create an activity:

    <extension point="org.eclipse.ui.activities">
    <activity id="net.sf.yari.sample.activity" name="Sample Activity">
    </activity>
    <activityPatternBinding activityId="net.sf.yari.sample.activity" pattern="org\.eclipse\.ui.*/org\.eclipse\.ui\.preferencePages\.Workbench">
    </activityPatternBinding>
    </extension>

General-tab has gone:


Related

Documentation: BundleInspector
Documentation: Home
Documentation: HowTo

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.