In my eclipse plugin I have specified my custom navigator using the CNF (Common Navigator Framework). I got everything working except the context menu.
I have created a new viewer-extension for it in which I define a popup-Menu with the respective groups (I overtook all of the groups from the project explorer) and it does get displayed and everything I want to appear in it, does appear.
However there are a bunch of things that appear in it that I don't want to appear.
As an example there is the Run As... option in the context menu which I don't want as I have nothing to run anyway. I tried using the Plugin-Menu-Spy in order to find where this menuItem is being contributed but it won't give me any information about it.
I found out that when setting allowsPlatformContributions = false in my popUp-Extension the unwanted menuItems disappear but so do the Import and Export menus which I do want to have.
So how can I remove the Run As... menuItem from my navigator's context menu? Is there some kind of filter I can apply to it?
Related
I'm using Report Builder 3.0 and I have a report that links to another report when clicked on. When the new report opens the parameter options are collapsed by default. I'd like them to be expanded by default if possible but I haven't been able to find an option for it.
This issue is something I've struggled with previously. What I've done to resolve it is inject some javascript into the ReportViewer.aspx file which would "click" the bar if it detected it was collapsed by default.
In my version of RS, the element to click is called ReportViewerControl_ToggleParam, and you can tell if the bar is hidden by looking at the display value of ParametersRowReportViewerControl.
Let me know if you need more details.
I have built a .ui-file in Qt Creator that includes a few different stacked containers: a Tool Box that contains QWidgets with QLabels, QLineEdits etc. in various tabs. A few of the widgets are disabled in the beginning and should only be enabled open some other action. To be able to do that by simply calling widget.setEnabled(True) all the items on the widget, that should appear enabled now, must be enabled in QT Creator, is that correct?
My problem is, that a few items on the QWidget do not stay enabled. I can check their properties checkbox for "enabled", but as soon as I navigate to a different tab in the Tool Box and then return to my QWidget, these two items are disabled again. It also doesn't save their status as enabled when I save the file.
What distinguishes the items that do stay enabled from the ones that don't is that for the ones that don't, in the properties editor, the properties "enabled" and "cursor" appear bold, whereas for the others they don't. All other properties appear to be similar and all items are children of the same QWidget.
I tried replacing them with copied versions of another similar item on the same tab, but that doesn't help.
I've a question. I cannot find the way, how to add buttons to main toolbar programmatically. My problem is, that I've the task to dynamically (based on XML configuration file) build menus and toolbar. I found how to add a menu item programmatically, but not toolbar button.
Tutorials mostly show how to create buttons and menus using plugin descriptor (plugin.xml), but not how to do it programatically. It seems, that it is out of bounds of Eclipse plugin philosophy.
I've just found this:
There might be layout problems with this approach. I also don't
believe the framework will try and re-create your dynamic item except
at random toolbarmanager updates. With Menus they can be updated on an
SWT.Show event, which is why CompoundContributionItem only applies to
Menus.
What shall I do? Can I say Sorry, there is no way to build toolbar dynamically. I can do it just for menus? Collegue says, that it must be possible, but he does neither know how.
The only way to be able to create main toolbar entries programmatically is in an RCP app, where you supply the ActionBarAdvisor for the workbench window. This isn't dynamic, however, just called on window creation.
Another way to do it would be to use org.eclipse.ui.menus and contribute org.eclipse.ui.menus.ExtensionContributionFactory. It also works only on workbench window creation (not really dynamic), but you could read your own XML and provide IContributionItems for the main menu or toolbar.
How dynamic are you trying to be? Most solutions work well on startup/window creation.
PW
Whenever you try to do something programmatically in Eclipse that is normally done through plugin definitions you are walking on thin ice. I've tried it on a few occasions and it rarely ended up being easy or good.
Instead, think of what it is that you only know at runtime and need to be able to change on the fly. Is it the name or icon of the button? That can be changed at runtime.
Take a look at runtime commands, they can be confusing to define properly, but with them you can for example create buttons that are only visible if a condition is active. That condition could be set at runtime.
I am new to OpenERP. I need to disable some menus without uninstalling the modules that added the menus. I tried did a search for the module I wanted to disable its menu and then deleted all the search results only to get a very disorganized menu as a result. Please how do I achieve this? I just need to hide the link to two modules on the menu bar and on the home page
Create a new security group called 'Nobody' with no users in it.
Change the permission of the menus you want to hide to this group.
This is easy and you can get the menu back easily too if you change your mind.
If you delete a parent menu, then all its children appear at the top level. You can either delete all the children as well, or just remove security access from the parent menus for all but the administrator group. You might also be able to inactivate the parent menu instead of deleting it if you don't want to mess around with security.
check the below link.In this link is example of hide the UOM into the Product.
if We don’t want to display Unit Of Measure in Product Configuration.
http://pilgrimonerp.wordpress.com/2010/08/25/openerp-hide-menu-item/
Easiest way is to edit the group:
Settings > Users > Groups, select a group, select second tab (Security), add/remove menu items on Access Menu.
To disable menus it right to go with ir.menu model.
Setting -> technical -> views -> menu
or
some easy example
http://snippetbucket.com/2014/02/openerp-disable-apps-menu-remove-openerp-app/
I'm building a plugin, and adding an entry to the context menu (right-click on a folder in the project tree).
So far it works, following this tutorial:
http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
The problem is that it's adding my entry in the root of the context menu. Since my entry refers to a "New XXX" wizard, I want it to go to the "New" submenu.
It seems like I would have to set the correct locationURI or menuPath in my plugin.xml. However I can't find the locationURI or menuPath corresponding to that submenu. How can I find that?
The new contributions are menu ID based, not menu path based. So it should be something like:
<menuContribution
locationURI="menu:file?after=additions" />
See this SO answer for an example of locationUri.
See Menu Extension for more. The exact id is either:
found in the existing plugin.xml from the menu or
determined with plugin Spy
See "How to add items in popup menu?" (from justinmreina) for more on adding an entry to a menu.
If you've created a plugin for a 'New XXX' wizard, you can add it inside the 'New' menu that you see when you right-click inside the Navigator by customizing the perspective.
Go to Window -> Customize Perspective and click on the Shortcuts tab. You should see 'New XXX'. Select it and you're good to go.