Search in sources :

Example 1 with NewInterfaceCreationWizard

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

the class CreateJavaTypeQuickfixes method newJavaInterfaceQuickfix.

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

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

                @Override
                public void run() {
                    NewInterfaceWizardPage classWizardPage = new NewInterfaceWizardPage();
                    NewInterfaceCreationWizard wizard = new NewInterfaceCreationWizard(classWizardPage, true);
                    WizardDialog dialog = createWizardDialog(wizard);
                    configureWizardPage(classWizardPage, resource.getURI(), typeName, explicitPackage);
                    dialog.open();
                }
            });
        }
    });
}
Also used : NewInterfaceWizardPage(org.eclipse.jdt.ui.wizards.NewInterfaceWizardPage) IModificationContext(org.eclipse.xtext.ui.editor.model.edit.IModificationContext) NewInterfaceCreationWizard(org.eclipse.jdt.internal.ui.wizards.NewInterfaceCreationWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) JavaModelException(org.eclipse.jdt.core.JavaModelException) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

Aggregations

JavaModelException (org.eclipse.jdt.core.JavaModelException)1 NewInterfaceCreationWizard (org.eclipse.jdt.internal.ui.wizards.NewInterfaceCreationWizard)1 NewInterfaceWizardPage (org.eclipse.jdt.ui.wizards.NewInterfaceWizardPage)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 IModification (org.eclipse.xtext.ui.editor.model.edit.IModification)1 IModificationContext (org.eclipse.xtext.ui.editor.model.edit.IModificationContext)1