wizards.newWizards.category = Mograsim
wizards.newWizards.mpm.name = Microprogram Memory
wizards.newWizards.mpm.desc = Creates a default new Microprogram Memory
+wizards.newWizards.mem.name = Main Memory
+wizards.newWizards.mem.desc = Creates a default new Main Memory
Bundle-Vendor.0 = Mograsim Team
\ No newline at end of file
<description>%wizards.newWizards.mpm.desc</description>
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
+ <wizard
+ id="net.mograsim.plugin.wizards.newWizards.NewWizardMEM"
+ name="%wizards.newWizards.mem.name"
+ class="net.mograsim.plugin.wizards.newWizards.NewWizardMEM"
+ category="net.mograsim.plugin.wizards.newWizards.category"
+ icon="icons/mograsim/blue-orange/icon_blue-orange_16.png">
+ <description>%wizards.newWizards.mem.desc</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
</extension>
<extension
point="org.eclipse.debug.core.launchConfigurationTypes">
--- /dev/null
+package net.mograsim.plugin.wizards.newWizards;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+public abstract class BasicNewWizard extends Wizard implements INewWizard
+{
+ private IStructuredSelection selection;
+ private WizardNewFileCreationPage page;
+
+ public void setFileExtension(String fileExtension)
+ {
+ page.setFileExtension(fileExtension);
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection)
+ {
+ this.selection = selection;
+ }
+
+ @Override
+ public void addPages()
+ {
+ addPage(page = new WizardNewFileCreationPage("Create", selection));
+ }
+
+ @Override
+ public boolean performFinish()
+ {
+ IFile file = page.createNewFile();
+ if (file != null)
+ return true;
+ return false;
+ }
+}
--- /dev/null
+package net.mograsim.plugin.wizards.newWizards;
+
+public class NewWizardMEM extends BasicNewWizard
+{
+ @Override
+ public boolean performFinish()
+ {
+ setFileExtension("mem");
+ return super.performFinish();
+ }
+
+ @Override
+ public String getWindowTitle()
+ {
+ return "Create new Main Memory";
+ }
+}
package net.mograsim.plugin.wizards.newWizards;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-public class NewWizardMPM extends Wizard implements INewWizard
+public class NewWizardMPM extends BasicNewWizard
{
-
- private IStructuredSelection selection;
- private WizardPageMPM page;
-
- @Override
- public void init(IWorkbench workbench, IStructuredSelection selection)
- {
- this.selection = selection;
- }
-
@Override
- public void addPages()
+ public boolean performFinish()
{
- addPage(page = new WizardPageMPM(selection));
+ setFileExtension("mpm");
+ return super.performFinish();
}
@Override
{
return "Create new Microprogram Memory";
}
-
- @Override
- public boolean performFinish()
- {
- IFile file = page.createNewFile();
- if (file != null)
- return true;
- return false;
- }
}
+++ /dev/null
-package net.mograsim.plugin.wizards.newWizards;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-public class WizardPageMPM extends WizardNewFileCreationPage
-{
-
- public WizardPageMPM(IStructuredSelection selection)
- {
- super("Create ", selection);
- setFileExtension("mpm");
- }
-}