Example usage for org.eclipse.jface.wizard IWizardContainer IWizardContainer

List of usage examples for org.eclipse.jface.wizard IWizardContainer IWizardContainer

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard IWizardContainer IWizardContainer.

Prototype

IWizardContainer

Source Link

Usage

From source file:com.android.ide.eclipse.adt.wizards.newproject.StubProjectWizard.java

License:Open Source License

/**
 * Overrides parent to return dummy wizard container
 *///from  w w w .j  a v a 2 s  .co  m
@Override
public IWizardContainer getContainer() {
    return new IWizardContainer() {

        public IWizardPage getCurrentPage() {
            return null;
        }

        public Shell getShell() {
            return null;
        }

        public void showPage(IWizardPage page) {
            // pass
        }

        public void updateButtons() {
            // pass
        }

        public void updateMessage() {
            // pass
        }

        public void updateTitleBar() {
            // pass
        }

        public void updateWindowTitle() {
            // pass
        }

        /**
         * Executes runnable on current thread
         */
        public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
                throws InvocationTargetException, InterruptedException {
            runnable.run(new NullProgressMonitor());
        }

    };
}

From source file:fr.inria.diverse.trace.plugin.generator.FakeEcoreImporterWizard.java

License:Open Source License

@Override
public IWizardContainer getContainer() {
    // TODO Auto-generated method stub
    return new IWizardContainer() {

        @Override/*from ww w  .j  a  va  2s  . c o  m*/
        public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
                throws InvocationTargetException, InterruptedException {
            IWorkbench wb = PlatformUI.getWorkbench();
            IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
            win.run(false, true, runnable);

        }

        @Override
        public void updateWindowTitle() {
            // TODO Auto-generated method stub

        }

        @Override
        public void updateTitleBar() {
            // TODO Auto-generated method stub

        }

        @Override
        public void updateMessage() {
            // TODO Auto-generated method stub

        }

        @Override
        public void updateButtons() {
            // TODO Auto-generated method stub

        }

        @Override
        public void showPage(IWizardPage page) {
            // TODO Auto-generated method stub

        }

        @Override
        public Shell getShell() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public IWizardPage getCurrentPage() {
            // TODO Auto-generated method stub
            return null;
        }
    };
}

From source file:org.python.pydev.customizations.app_engine.wizards.AppEngineConfigWizardPageTestWorkbench.java

License:Open Source License

public void testCreateLaunchAndDebugGoogleAppProject() throws Exception {

    final Display display = Display.getDefault();
    final Boolean[] executed = new Boolean[] { false };
    display.syncExec(new Runnable() {

        public void run() {
            final Shell shell = new Shell(display);
            shell.setLayout(new FillLayout());
            Composite pageContainer = new Composite(shell, 0);
            AppEngineWizard appEngineWizard = new AppEngineWizard();
            appEngineWizard.setContainer(new IWizardContainer() {

                public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
                        throws InvocationTargetException, InterruptedException {
                    runnable.run(new NullProgressMonitor());
                }/*from  www . j a  v a2s.c o m*/

                public void updateWindowTitle() {
                    throw new RuntimeException("Not implemented");
                }

                public void updateTitleBar() {
                    throw new RuntimeException("Not implemented");
                }

                public void updateMessage() {
                    throw new RuntimeException("Not implemented");
                }

                public void updateButtons() {
                    throw new RuntimeException("Not implemented");
                }

                public void showPage(IWizardPage page) {
                    throw new RuntimeException("Not implemented");
                }

                public Shell getShell() {
                    throw new RuntimeException("Not implemented");
                }

                public IWizardPage getCurrentPage() {
                    return null;
                }
            });

            appEngineWizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
            appEngineWizard.addPages();
            appEngineWizard.createPageControls(pageContainer);

            IWizardPage[] pages = appEngineWizard.getPages();
            NewProjectNameAndLocationWizardPage nameAndLocation = (NewProjectNameAndLocationWizardPage) pages[0];
            AppEngineConfigWizardPage appEnginePage = (AppEngineConfigWizardPage) pages[1];

            assertFalse(nameAndLocation.isPageComplete());
            nameAndLocation.setProjectName("AppEngineTest");
            assertTrue(nameAndLocation.isPageComplete());

            assertFalse(appEnginePage.isPageComplete());
            appEnginePage.setAppEngineLocationFieldValue(
                    TestDependent.GOOGLE_APP_ENGINE_LOCATION + "invalid_path_xxx");
            assertFalse(appEnginePage.isPageComplete());
            appEnginePage.setAppEngineLocationFieldValue(TestDependent.GOOGLE_APP_ENGINE_LOCATION);
            assertTrue(appEnginePage.isPageComplete());

            assertTrue(appEngineWizard.performFinish());

            IProject createdProject = appEngineWizard.getCreatedProject();
            PythonNature nature = PythonNature.getPythonNature(createdProject);
            Map<String, String> expected = new HashMap<String, String>();
            expected.put(AppEngineConstants.GOOGLE_APP_ENGINE_VARIABLE,
                    new File(TestDependent.GOOGLE_APP_ENGINE_LOCATION).getAbsolutePath());
            IPythonPathNature pythonPathNature = nature.getPythonPathNature();
            try {
                assertEquals(expected, pythonPathNature.getVariableSubstitution());

                String projectExternalSourcePath = pythonPathNature.getProjectExternalSourcePath(false);
                assertTrue(
                        projectExternalSourcePath.indexOf(AppEngineConstants.GOOGLE_APP_ENGINE_VARIABLE) != -1);
                projectExternalSourcePath = pythonPathNature.getProjectExternalSourcePath(true);
                assertTrue(
                        projectExternalSourcePath.indexOf(AppEngineConstants.GOOGLE_APP_ENGINE_VARIABLE) == -1);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }

            //                goToManual();

            executed[0] = true;
        }
    });
    assertTrue(executed[0]);
}