I have used a third-party plug-in to my rcp application that adds some UI contribution to my application. basically it provides me a UI editing functionality like graphity that we are showing in a separate perspective. it also add some toolbar and menu-bar contributions.
my question is can we hide the toolbar contribution from a third party plug-ins depending on active perspective? that's mean let's say i have two perspective and i want only one perspective will show the toolbar contribution from this third party plugns but not the other one.
thank you advance for you help.
Related
I am developing an Eclipse RCP application, and would like to remove some of the items displayed in the "Show In" context menu. The items are placed in this menu by various plug-ins, and I would prefer to not have them there.
Adding a new entry to this menu is well documented: https://wiki.eclipse.org/FAQ_How_do_I_make_my_view_appear_in_the_Show_In_menu%3F
However, removing an existing entry seems problematic, since Views are listed in the "Show In" menu by virtue of them implementing the IShowInTarget interface. The resulting menu items do not have unique IDs that could be used to disable them via an Activity.
It seems to me like the only way to avoid listing a View defined by an existing plug-in in the "Show In" menu is to extend the plug-in class implementing this View.
The source code for the 'Show In' menu is org.eclipse.ui.internal.ShowInMenu.
This gets contributions from a number of places but I don't see anything that could be used to filter them.
'Extending the plug-in class implementing the view' is not really possible.
I am developing RCP plug-in with GEF framework.
I've created basic graphical editor (GraphicalEditor and IEditorInput)
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(new TEditorInput("T"), TGraphicalEditor.ID,false);
When I run the application I get editor with a header that contains the tab with the name of the editor and control buttons to maximize and minimize the editor.
What I need is to display just the editor, without the header.
Can it be done?
To my knowledge, it is not possible to just hide an editor's tab.
However, you can try two workarounds:
Have your GEF editor be displayed in an Eclipse view instead of an editor and open such a view as a standalone view. An example of how to open a GEF diagram in a view can be found in GEF's Directed Graph Example. An example of how to open a view as standalone can be found in one the Eclipse RCP official tutorials.
Extend the presentation factories extension point to control how workbench parts are displayed (which includes control over the part stack tab).
I suggest you try the first approach, as to me it seems easier to implement.
The idea with editors is that you can instantiate them multiply for different editor inputs. I am not aware of any way to restrict the number of open editors to just one (well, it appears you can in Eclipse 4.2 if that helps you)
For views, what you want can be done by setting the perspective to fixed and set showTitle of the org.eclipse.ui.perspectiveExtensions extension to false on the view. Maybe you can use a view instead of an editor and control the editor input yourself?
(For example, using an editor, the default Open action would instantiate a new editor, while you probably want to replace the contents in your only editor, right?)
My eclipse rcp application depends on a set of eclipse plugins, after I add them as dependency, the "Run" and "Search" menu appear in the main menu bar.
Which plugin contains these two menu contribution ?
How Can I hide the menu, while I still need the plugin which contribute the menu ?
You could try to use activities and contexts, as described in the Eclipse Help
Which plugin contains these two menu contribution ?
You can use Shift-Alt-F2 and then click the menu (inside your IDE, not your RCP app) to find out the menu id and thereby get a good idea of which plugin contributes it.
In my RCP app, I contribute several items to the main toolbar. The easy question now is: How do I make Eclipse lay them out so that they appear in a second row, just under the normal toolbar? Or can I add an additional toolbar that appears just under the main bar? Right now, they just appear somewhere between the other items contributed by other plugins. I tried a lot of stuff and searched a long time, couldn't find any answer though.
I'm afraid the main eclipse toolbar is beyond programatic control, it is entirely up to the user how he arranges the items. I've tried similar to arrange perspective buttons with no success.
I use a lot of eclipse shortcuts, but for some tasks there arnt any convenient ones. For example I frequently look at the subversion history for java files.
I see these icons next to the right-click menu items that I assume I should be able to place on the eclipse taskbar so that I can save a couple of mouse clicks. But I havnt been able to figure out how to do that yet.
I am talking about the icon next to RightClick-Team-Show History once you install the subclipse plugin. I would like this icon to be on my taskbar so I can just do a single click and look at the history.
Any suggestions?
Other tips on customizing eclipse for java development are also welcome.
Take a look at my answer for similar question: How to add undo / redo buttons to toolbar in Eclipse?
It is possible to do the same for Show History command. Differences are: 1) you need to declare dependency on org.tigris.subversion.subclipse.ui plugin, and command ID you are looking for is org.tigris.subversion.subclipse.ui.showresourceinhistoryaction. You may want to include custom icon to avoid having long "Show History" button on your toolbar.
Update: Here is downloadable plugin for you: showsvnhistory_1.0.0.jar
The only way I know of to "customize" the Eclipse taskbar is via Window -> Customize Perspective. Oddly enough, the "Commands" tab has some influence on the toolbar.
But the developer of whatever component you want to use must have enabled the commmand and (at least for me), SVN doesn't offer a history button.
Maybe some XML hacking is more helpful here?