Search in sources :

Example 1 with NewElementWizard

use of org.eclipse.jdt.internal.ui.wizards.NewElementWizard in project xtext-xtend by eclipse.

the class CreateXtendTypeQuickfixes method newXtendInterfaceQuickfix.

protected void newXtendInterfaceQuickfix(final String typeName, final String explicitPackage, final XtextResource resource, Issue issue, IssueResolutionAcceptor issueResolutionAcceptor) {
    String packageDescription = getPackageDescription(explicitPackage);
    issueResolutionAcceptor.accept(issue, "Create Xtend interface '" + typeName + "'" + packageDescription, "Opens the new Xtend interface wizard to create the type '" + typeName + "'" + packageDescription, "xtend_file.png", new IModification() {

        @Override
        public void apply(/* @Nullable */
        IModificationContext context) throws Exception {
            runAsyncInDisplayThread(new Runnable() {

                @Override
                public void run() {
                    NewElementWizard newXtendInterfaceWizard = newXtendInterfaceWizardProvider.get();
                    WizardDialog dialog = createWizardDialog(newXtendInterfaceWizard);
                    NewXtendInterfaceWizardPage page = (NewXtendInterfaceWizardPage) newXtendInterfaceWizard.getStartingPage();
                    configureWizardPage(page, resource.getURI(), typeName, explicitPackage);
                    dialog.open();
                }
            });
        }
    });
}
Also used : NewElementWizard(org.eclipse.jdt.internal.ui.wizards.NewElementWizard) IModificationContext(org.eclipse.xtext.ui.editor.model.edit.IModificationContext) NewXtendInterfaceWizardPage(org.eclipse.xtend.ide.wizards.NewXtendInterfaceWizardPage) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

Example 2 with NewElementWizard

use of org.eclipse.jdt.internal.ui.wizards.NewElementWizard in project xtext-xtend by eclipse.

the class CreateXtendTypeQuickfixes method newXtendClassQuickfix.

protected void newXtendClassQuickfix(final String typeName, final String explicitPackage, final XtextResource resource, Issue issue, IssueResolutionAcceptor issueResolutionAcceptor) {
    String packageDescription = getPackageDescription(explicitPackage);
    issueResolutionAcceptor.accept(issue, "Create Xtend class '" + typeName + "'" + packageDescription, "Opens the new Xtend class wizard to create the type '" + typeName + "'" + packageDescription, "xtend_file.png", new IModification() {

        @Override
        public void apply(/* @Nullable */
        IModificationContext context) throws Exception {
            runAsyncInDisplayThread(new Runnable() {

                @Override
                public void run() {
                    NewElementWizard newXtendClassWizard = newXtendClassWizardProvider.get();
                    WizardDialog dialog = createWizardDialog(newXtendClassWizard);
                    NewXtendClassWizardPage page = (NewXtendClassWizardPage) newXtendClassWizard.getStartingPage();
                    configureWizardPage(page, resource.getURI(), typeName, explicitPackage);
                    dialog.open();
                }
            });
        }
    });
}
Also used : NewElementWizard(org.eclipse.jdt.internal.ui.wizards.NewElementWizard) NewXtendClassWizardPage(org.eclipse.xtend.ide.wizards.NewXtendClassWizardPage) IModificationContext(org.eclipse.xtext.ui.editor.model.edit.IModificationContext) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

Example 3 with NewElementWizard

use of org.eclipse.jdt.internal.ui.wizards.NewElementWizard in project xtext-xtend by eclipse.

the class CreateXtendTypeQuickfixes method newXtendAnnotationQuickfix.

protected void newXtendAnnotationQuickfix(final String typeName, final String explicitPackage, final XtextResource resource, Issue issue, IssueResolutionAcceptor issueResolutionAcceptor) {
    String packageDescription = getPackageDescription(explicitPackage);
    issueResolutionAcceptor.accept(issue, "Create Xtend annotation '" + typeName + "'" + packageDescription, "Opens the new Xtend annotation wizard to create the type '" + typeName + "'" + packageDescription, "xtend_file.png", new IModification() {

        @Override
        public void apply(/* @Nullable */
        IModificationContext context) throws Exception {
            runAsyncInDisplayThread(new Runnable() {

                @Override
                public void run() {
                    NewElementWizard newXtendAnnotationWizard = newXtendAnnotationWizardProvider.get();
                    WizardDialog dialog = createWizardDialog(newXtendAnnotationWizard);
                    NewXtendAnnotationWizardPage page = (NewXtendAnnotationWizardPage) newXtendAnnotationWizard.getStartingPage();
                    configureWizardPage(page, resource.getURI(), typeName, explicitPackage);
                    dialog.open();
                }
            });
        }
    });
}
Also used : NewElementWizard(org.eclipse.jdt.internal.ui.wizards.NewElementWizard) IModificationContext(org.eclipse.xtext.ui.editor.model.edit.IModificationContext) NewXtendAnnotationWizardPage(org.eclipse.xtend.ide.wizards.NewXtendAnnotationWizardPage) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

Aggregations

NewElementWizard (org.eclipse.jdt.internal.ui.wizards.NewElementWizard)3 WizardDialog (org.eclipse.jface.wizard.WizardDialog)3 IModification (org.eclipse.xtext.ui.editor.model.edit.IModification)3 IModificationContext (org.eclipse.xtext.ui.editor.model.edit.IModificationContext)3 NewXtendAnnotationWizardPage (org.eclipse.xtend.ide.wizards.NewXtendAnnotationWizardPage)1 NewXtendClassWizardPage (org.eclipse.xtend.ide.wizards.NewXtendClassWizardPage)1 NewXtendInterfaceWizardPage (org.eclipse.xtend.ide.wizards.NewXtendInterfaceWizardPage)1