Creating file wizard extensions
From Aptana Development
This page describes how to create file wizard extensions.
Contents |
Instructions
You can create either a Project file wizard or an untitled file wizard.
Project File Wizard
You can create a new file of a specific type by right-clicking on or within a project. This will bring up a context menu with "New" menu. Project files that have been registered with the IDE will appear under that menu item. Below are the steps needed to create a New File Wizard for your editor.
- Open the plugin.xml file from your editor's project.
- Select the Extensions tab.
- Click Add...
- Select the "org.eclipse.ui.newWizards" extension point.
- Click Finish.
- Right-click the "org.eclipse.ui.newWizards" extension.
- Select New > Category from the context menu.
- Fill in the category properties as seen in the following image:
- Right-click the "org.eclipse.ui.newWizards" extension.
- Select New > wizard from the context menu.
- Fill in the wizard properties using the following image as a guide.
- The "id" naming convention is com.aptana.ide.editors.wizards.XXXNewWizard, where XXX is the abbreviated name of your language.
- "name" will be designate the text used in the UI for this wizard.
- "class" implements the INewWizard interface. However, to simplify things, you should subclass "com.aptana.ide.editors.wizards.SimpleNewFileWizard". Also, by convention, file wizards live in the "com.aptana.ide.editor.XXX.wizards" package, where XXX is the abbreviated name of you language.
- "icon" should point to an image file that looks like your editor's icon but with a "+" in the graphic. Our current naming convention is XXX_new_file.png where XXX is the file extension for your language. Note that you need to make sure that your icon directory is selected under the "Build Binary" section of the "Build" tab in your plugin.xml file.
- "category" should use the same id as you defined in the category above.
- "finalPerspective" and "preferredPerspective" should both be set to "com.aptana.ide.js.ui.WebPerspective". NOTE: I'm not sure why we're using that value.
- "project", "helpHref", "descriptionImage", and "canFinishEarly" should remain empty.
Untitled File Wizard
You can create a new untitled file of a specific type by selecting File > New on or within a project. Untitled file types that have been registered with the IDE will appear under that menu item. Below are the steps needed to create a New Untitled File Wizard for your editor.
- Follow the same steps above to create an "Untitled Files" category. Use the image below as a guide for the "id", and "name" values.
- Follow the same steps above to create an "Untitled File Wizard". Use the following image as a guide for the differing values in "id", "name", "class", "category", "canFinishEarly", and "hasPages".
- Note that the class defined in "class" should subclass "com.aptana.ide.editors.wizards.UntitledTextFileWizard" for convenience.






