I am not so familiar with Eclipse plugin. I have one question on viewing/editing source code of a wizard dialog in Eclipse.
For example: In Eclipse, click File ->New->Class, the "New Java Class" wizard dialog appears.
My question is:
How to view the source code of this wizard dialog?
Can I modify the style of this wizard dialog? For example, the default value for "Superclass" is java.lang.Object, can I change the default value to another class(e.g. com.myown.myaction)?
Thank you!
To quickly view a source of a UI element use Plug-in Selection Spy tool (press Alt+Shift+F1 on a selected UI element). Then if you know the class and plug-in it originate from you can import it into your workspace and browse.
Related
I'm trying to create a plugin for eclipse and for the one of the requirements is to add an entry to the context menu for all text editors so that on right click I get an option corresponding to the action I want to perform. I've tried to find relevant resources for it but most of the use cases are focused on adding a context menu to a view etc and not to the context menu for the eclipse editor. So far, I tried to implement this using the eclipse context in the activator but as is perhaps obvious, the workspace is not created when the activator's start method executes. Any help would be appreciated!
I work with Eclipse and PyDev plugin.
I want to develop a plugin which adds to the main menu (where File is located), an item "my own custom menu" which contains in it another menu items.
According to some examples, I eventually implemented it by using the extension point of org.eclipse.ui.actionSets.
My goal is when item of "my custom menu" is clicked, it should invoke Eclipse functionality.
for example:
"my custom menu" has menu item called "open new pyDev project".
When "open new pyDev project" is clicked, I want to open the pyDev project creation window that manually is opened by clicking the following Eclipse menu items: File->new->other->PyDev->PyDev Project.
I searched quite a lot and couldn't find the way to do it.
Does someone know how to achieve my goal?
What you want to do is implement a workbench wizard that will add them to the set of workbench wizards; then you can add a perspective extension to add it the the corresponding menu generically.
You have to look up the perspective ID you are using with PyDev, but this is the recommended way to add new wizard items to the corresponding menu.
I just find out that windowbuilder comes with the original Eclipse package. There are project palette, application window, japplet, jdialog, jdialog, jframe, jinternalframe, jpanel, swing automatic databinding. Which one should I start with and how to learn more?
For Eclipse IDE, Window Builder is one more Editor for handling java source files.
So you should be able to open all java classes with it. Right click on any java class and select open with menu option. You should see "WindowBuilder Editor" as an option there.
Note that this editor may not show any content in Design or Bindings tab for any non-GUI classes (e.g. interfaces).
I have an sample editor which opens up by selecting an action from a sample Menu created in the menu bar.
How do i associate this editor with a file in Project explorer view?
I mean if i double click on the file in project explorer view , the editor should spawn up.
Basically i want this editor to work like a regular eclipse editor.
Please let me know your suggestions or any online material which explains the framework on how to achieve this.
Thanks,
Karthik
Have a look at IWorkbenchPage.openEditor(IEditorInput input, String editorId). Here you specify the input object of the editor and the ID for the editor.
In a RCP application, the IEditorInput is usually made up by you - nothing fancy is needed unless you want to persist the editors - and ID is specified via the org.eclipse.ui.editors.
I want to add my menu in eclipse through eclipse plug-in development but not through plugin.xml. I want to use java code, as we can do the same by using IWorkBenchWindowPullDown interface for adding pulldown menu.
So what is the way to add menu in menuBar.
As above, you can use org.eclipse.ui.menus and add a menuContribution that includes a dynamic element. Then you can return whatever IContributionItems you would like from your implementation of CompoundContributionItem. See http://wiki.eclipse.org/Menu_Contributions
See the documentation of MenuManager. You could get the MenuManager via WorkbenchWindow.getMenuManager()
Check this out Menu Contributions. Scroll down for Menus API.