I'm using "Netbeans platform 8.1" to develop a rich client application.
It has default menus and actions inside it. I want to hide "Menu/Tools/Plugins" and open the Plugin Window programmatically from my code.
My question is: if I hide the menu from "layer.xml" and change its name to "Plugin_hidden", how can I open that window programmatically?
Use the following code.
Action action = FileUtil.getConfigObject("Actions/System/org-netbeans-modules-autoupdate-ui-actions-PluginManagerAction.instance", Action.class);
action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, ""));
I determined the path for the action by expanding Important Files/XML Layer/<this layer in context>/Menu Bar/Tools under my project in the Projects window and double clicking on Plugins. This will open a generated layer XML that contains the Plugin manager action. From there you can figure out what the action path is.
If you don't have an XML Layer in important files, you can add an empty one using the New File wizard. Just select Module Development/XML Layer. An XML layer isn't required for the above code to work; it just makes it possible to browse the available actions so that you can determine the path for the action.
For more information see DevFaqInvokeActionProgrammatically
Related
I need to add dynamic content inside about menu in eclipse application.
Any idea about the About menu plugin??
In the Branding tab inside product file i am adding static content in the About dialog. Now i need to add some dynamic content that will be decided in the run time of the application.
Is there any method to override to get the dynamic content inside the About menu???
Please can anyone help me.
The about dialog org.eclipse.ui.internal.dialogs.AboutDialog does not support any dynamic context.
The main text comes from the aboutText property defined in the org.eclipse.core.runtime.products product definition.
The images come from the installed bundle groups.
The data on the branding / feature dialog just comes from the feature and branding plugin and is also not dynamic.
For a custom IntelliJ plugin I am trying to write a handler that is invoked when the user uses the "cmd" key (or "control" in windows) and clicks in the value of an XML tag (which usually triggers a "go to declaration" or "show usages") in regular java code. In the tutorials I have found samples for creating a plugin that handles a click to an entry in the menu bar, but I need a handler for that one specific action.
Does IntelliJ support handling that event and execute a custom action? Thank you for your help in advance.
I am using the Force.com plugin to facilitate coding Salesforce classes (java-like language). When I right click in the text editor I get Force.com > Save to Server menu entry.
How do I assign a keyboard shortcut to this action?
I attempted to leverage Eclipe's macro plugin PracticallyMacro but it did not record right clicks.
Instead I came up with a solution using:
'TinyTask' can export record and save as small 'exe' files which can then be added as external Eclipse builders
'TyperTask' can automate tasks based on typed characters - epic.
I have a question in regards to a Java GUI I'm creating at the moment, it's an application that runs offsite backups.
When the application initially loads you are presented with this screen:
After loading the configuration file it fills out each field in the tabs below; at this stage it is staying on the "Run" tab after I load the configuration file, but I'd like it (after filling out each field) to bring the "Configuration" tab to the screen.
How do I go about doing this? In the method I've written to load config after the JFileChooser window is closed, I'd imagine I'll need to add something to tell it to select the Configuration tab.
I can provide the classes if necessary.
Exposing the component, then using the method:
CTabFolder#setSelection(int);
worked fine.
Thanks #MadProgrammer and #Vulcan
I'm writing a plugin to eclipse and as part of my scenario, I'm generating a html file. After the file had been generated, a web browser is been opened within eclipse, hosted by an editor.
What I'd like to do is to extend this web browser context menu (when I'm right clicking on it, I'd like to add another functionality which is called "copy URL", which will copy the URL of the web page.
Could you please assist in how this can be achieved?
I must point out and say that this is not an eclipse editor, which can be extended by adding an extension.
This web page that is been opened is a web page and not an eclipse editor. it's just been hosted by it by the following:
IWebBrowser browser = support.createBrowser(IWorkbenchBrowserSupport.AS_EDITOR, null, "RDLEditor", "tooltip");
Please assist.
Thank you,
Ido
I have tried to do this in the past and the issue is the embedded browser is not part of the eclipse framework and there are no extensions or API's available on the SWT browser object to extend the context menu. The next best thing I can think of is to create your own eclipse view that embeds a SWT browser object and then create an action in the view tool bar that will get a reference to the browser object in the Action class and copy the current URL to the clip board like you are trying to do. - Duncan Krebs
I was able to add a button to the WebBrowserView toolbar, if that is what you are looking to do. I declared an extension of WebBrowserView and then did the following.
public void createPartControl(Composite parent) {
super.createPartControl(parent);
browserViewer = this.viewer;
Composite toolbarComp = (Composite) browserViewer.getChildren()[0];
browserToolBar = (ToolBar) toolbarComp.getChildren()[0];
// add new ToolItems to that