my editor under 'new' context menu - eclipse

I am creating plugin over Eclipse. I know how to create new project with default folders underneat. Not when a user selects this default folder and right click, the new context menu should show my_editor entry to be create under this folder.
Thanks,
Darshna

You cannot place there your editor, what you can do is to create a "New-Wizard", for details see http://wiki.eclipse.org/FAQ_How_do_I_add_my_wizard_to_the_New,_Import,_or_Export_menu_categories%3F.
how to define a new wizard and http://blog.cypal-solutions.com/2008/07/how-to-create-new-file-wizard.html how to create the wizard ui that creates a new file which can be opened with your editor.
And last but not least you need a shortcut to make it available directly under the "New" Entries, see http://blogs.itemis.de/stundzig/archives/759

Related

How to add a context menu entry to the eclipse editor context menu

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!

How to create an option under "Open With" option when i right click on a file?

I am developing a RCP application that creates and shows chart. I have already developed the chart creation part. So now my goal is to when my runtime eclipse starts the package explorer already has the .csv file based on which i am creating chart. Now i want to right click on the .csv file and "Open with" should have an option called "ChartView" that on click will create a view with the chart which defines the selected file.
So how can i create a new option in "Open With" category that will create a new view on click. I tried to search this issue but unfortunately did not find any clue. Please help. Thanks
The "Open With" category is populated by the list of Editors that say they can open the file. You add an editor using the org.eclipse.ui.editors extension point.
http://help.eclipse.org/oxygen/topic/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_editors.html?cp=2_1_1_147

Get my Visio 2013 template on the New page

I've created a new template. How do I get the template to show up when I want to create a new drawing.
I did a search on .vstx and found this folder. I saved it here, but it still doesn't show up.
C:\Program Files (x86)\Microsoft Office\Office15\Visio Content\1033
This template will be the base for many drawings and I would like to be able to select it quickly while in meetings.
Thanks
In 2013 you need to go to Options/Advanced and scroll down to the bottom where it has a button for File Locations. Add a folder for templates and then save the template to that folder. Your template will show up in the New under Categories instead of Featured.
On the File menu, click Save As. In the Save as type list, click
Template (*.vst). In the File name box, type a name for your
template. Click the arrow next to Save, and make sure that Workspace
is selected (checked). In the Save in list, select the folder in
which you want to save the template.
Tip If you want the template to appear in the list that Visio displays when you click New on the File menu, save the template in the Solutions folder or one of its subfolders.
Note In Visio 2003, click the arrow next to Save, and make sure that Workspace is selected. In Visio 2007, click Save workspace on the Summary tab in the Properties window.
Click Save.
Link for these steps
Save your template as a Visio template (.vst file) in whatever location you want for your custom templates. Then you have a choice.
As Matt616 says, you could go to Options/Advanced in Visio 2013, click on "File Locations" and then enter your location as the location for templates. If you do this, then when you want to create a new drawing, your custom templates will appear under the Categories tab. The trouble with this is that the Categories tab is already full of other stuff.
As a (possibly better) alternative, go to Options/Save in Visio 2013 and enter your location as "Default personal templates location". If you do this, then when you want to creat a new drawing, there will be a new tab above the list of templates, called "Personal". Click this and you will see just your custom templates and no other stuff. Also, templates in this tab are pinnable (which doesn't seem to work in the "Categories" tab) and any templates that you pin will appear under "Featured" in future.

How to associate an Eclipse sample Editor with a file in project explorer view

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.

Eclipse plug-in: How to create a new menu for eclipse plugin with key combination?

I've been looking about this question but I couldn't find it. I need to create a new "popup menu" and assign a key pressed (in other words, I need press "F3+right-click" (for example) and this action will be appear a new popup menu, with my actions in my workbench). I don't need a submenu for my right-click... i need a new and alone menu
Example, in eclipse, when i right-click with my mouse over workbench I see a popmenu with: "undo, revert file, save, cut, copy..." and more, but i need create a new menu instead of eclipse menu, so, when I press "F3+right-click" (example) i need see my popup-menu with my actions... this is my problem, i need to create a new menu and call it with key/mouse combination...
I've been reading the forums but i don't know where to post this question and I don't know where to search (maybe i write a wrong question in the search... i think...).
I hope someone can help me.
Thank you very much;)
I assume that you would like to see this menu in an editor (rather than in a view because that would be slightly different). Most of what you need to do here is to extend eclipse extension points through declaring them in the plugin.xml for your plugin.
Thankfully, Eclipse ships with a few extension point wizards to help you get started with this. To get there, do the following
Open the plugin.xml for your plugin
Go to the extensions page
Click on Add...
Click on Extension Wizards
The "Popup Menu" wizard
After filling in all the details, there are still a few more pieces that you need to do.
The wizard creates an Object contribution, that will add the new popup menu to an object of a specified type in all views. You can change this to being an editor contribution, so that the menu item will show in editors instead.
The final step is to connect this menu item with a key-binding. For that, you need to create a new Command extension.
Start with the Command extension point wizard.
After filling in the details, you get a command, a handler, and a binding. You can remove the handler, since you will connect your action created previously to the command you just created.
From here, you need to fill in all of the stub Java classes created by the wizards and you should be in business.
This is a very rough set of steps you need to do to implement the keybindinds (and, yes, it is way more complicated than it needs to be). For more detail, you can go here:
http://www.vogella.de/articles/EclipseCommands/article.html