Java 类org.eclipse.jface.wizard.IWizardContainer 实例源码

项目:DarwinSPL    文件:DwFeatureModelWizard.java   
protected void saveModel(final IFile file) throws InvocationTargetException, InterruptedException {
    WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
        @Override
        protected void execute(IProgressMonitor progressMonitor) {
            try {
                EObject model = createInitialModel();
                EcoreIOUtil.saveModelAs(model, file);
            } finally {
                progressMonitor.done();
            }
        }
    };

    IWizardContainer container = getContainer();
    container.run(false, false, operation);
}
项目:cft    文件:CFUiUtil.java   
/**
 * Run the host name validator in the context of the wizard container and
 * provide a custom error message
 * @param appUrl
 * @param server
 * @param container
 * @param message - override with custom error message
 * @return
 */
public static HostnameValidationResult validateHostname(CloudApplicationURL appUrl, CloudFoundryServer server,
        IWizardContainer container, String message) {
    HostnameValidator val = message == null ? new HostnameValidator(appUrl, server)
            : new HostnameValidator(appUrl, server, message);
    try {
        container.run(true, true, val);
    }
    catch (Exception e) {
        CloudFoundryPlugin.logWarning("Hostname taken validation was not completed. " + e.getMessage()); //$NON-NLS-1$

        IStatus status = new Status(IStatus.ERROR, CloudFoundryServerUiPlugin.PLUGIN_ID,
                Messages.CloudApplicationUrlPart_ERROR_UNABLE_TO_CHECK_HOSTNAME);
        return new HostnameValidationResult(status, val.isRouteCreated());
    }

    return new HostnameValidationResult(val.getStatus(), val.isRouteCreated());
}
项目:txtUML    文件:FileCreator.java   
public IFile createModelFile(IWizardContainer context, IPackageFragmentRoot packageFragmentRoot,
        IPackageFragment packageFragment, String typeName, boolean isXtxtUml) {
    try {
        String filename;
        StringBuilder contentBuilder = new StringBuilder();
        if (isXtxtUml) {
            filename = buildXtxtUmlModelFileContent(packageFragment, typeName, contentBuilder);
        } else {
            filename = buildJavaModelFileContent(packageFragment, typeName, contentBuilder);
        }

        if (createFile(context, packageFragmentRoot, packageFragment, contentBuilder.toString(), filename)) {
            return (IFile) resource;
        }
    } catch (Throwable e) {
        Logger.sys.error("Error while creating package/model-info file", e);
    }
    return null;
}
项目:OpenSPIFe    文件:AbstractEnsembleProjectExportWizardPage.java   
private void carefullyDisplayErrorDialog(String message) {
    if(message == null) {
        message = "Unknown error."; 
    }
      int errorCode = MessageDialog.ERROR;
IWizardContainer container = getContainer();
Shell shell = null;
if(container != null) {
    shell = container.getShell();
}

// get a shell if the current one is null, we need to show the error.
if(shell == null) {
    shell = WidgetUtils.getShell();
}

MessageDialog.open(errorCode, shell,
              getErrorDialogTitle(), "Error encountered while " + getExportingActionVerb() + " " + getOutputProductNameSingular() + ": "
                + message, SWT.SHEET);
  }
项目:OpenSPIFe    文件:SpifeResourceUtils.java   
public static IEditorPart openPlanEditorFromWizard(final IFile planFile, final IWorkbench workbench, IWizardContainer container) {
    final IEditorPart[] result = new IEditorPart[1];
    try {
        container.run(false, false, new IRunnableWithProgress() {
            @Override
            public void run(IProgressMonitor monitor) {
                try {
                    monitor.beginTask("Opening " + planFile.getName() + " in editor", IProgressMonitor.UNKNOWN);
                    result[0] = openEditorOnPlanFile(planFile, workbench);
                } finally {
                    monitor.done();
                }
            }
        });
    } catch (Exception e) {
        LogUtil.error(e);
    }
    return result[0];
}
项目:n4js    文件:N4JSNewClassifierWizard.java   
/**
 * Sets the error message for the active wizard page.
 *
 * Note that this method has no effect if the current page doesn't support error messages.
 */
private void setErrorMessage(String message) {
    IWizardContainer container = getContainer();
    if (container != null) {
        IWizardPage currentPage = container.getCurrentPage();
        if (currentPage instanceof DialogPage) {
            ((DialogPage) currentPage).setErrorMessage(message);
        }
    }
}
项目:n4js    文件:NpmExportWizard.java   
@Override
public void setContainer(IWizardContainer wizardContainer) {

    IWizardContainer oldContainer = this.getContainer();
    if (oldContainer instanceof WizardDialog) {
        ((WizardDialog) oldContainer).removePageChangedListener(pageListener);
    }

    if (wizardContainer instanceof WizardDialog) {
        WizardDialog wizDialog = (WizardDialog) wizardContainer;
        wizDialog.addPageChangedListener(pageListener);
    }

    super.setContainer(wizardContainer);
}
项目:gemoc-studio    文件:TemplateListSelectionPage.java   
public void setUseTemplate(boolean useTemplate){
    fUseTemplate.setSelection(useTemplate);
    wizardSelectionViewer.getControl().setEnabled(useTemplate);
    if (!useTemplate)
        setDescription(""); //$NON-NLS-1$
    setDescriptionEnabled(useTemplate);

    IWizardContainer container = getContainer();
    if(container.getCurrentPage() != null){
        container.updateButtons();
    }
}
项目:gemoc-studio    文件:OptionTemplateSection.java   
/**
 * Resets the current page state by clearing the error message and making
 * the page complete, thereby allowing users to flip to the next page.
 */
protected void resetPageState() {
    if (pages.size() == 0)
        return;
    WizardPage firstPage = pages.get(0).page;
    IWizardContainer container = firstPage.getWizard().getContainer();
    WizardPage currentPage = (WizardPage) container.getCurrentPage();
    currentPage.setErrorMessage(null);
    currentPage.setPageComplete(true);
}
项目:txtUML    文件:FileCreator.java   
public IFile createXtxtUmlFile(IWizardContainer context, IPackageFragmentRoot packageFragmentRoot,
        IPackageFragment packageFragment, String filename) {
    try {
        StringBuilder contentBuilder = new StringBuilder();
        buildXtxtUmlFileContent(packageFragment, contentBuilder);

        if (createFile(context, packageFragmentRoot, packageFragment, contentBuilder.toString(), filename)) {
            return (IFile) resource;
        }
    } catch (Throwable e) {
        Logger.sys.error("Error while creating XtxtUML file", e);
    }

    return null;
}
项目:OpenSPIFe    文件:FixingViolationsWizard.java   
@Override
public void setContainer(IWizardContainer wizardContainer) {
    super.setContainer(wizardContainer);
    if (wizardContainer instanceof WizardDialog) {
        WizardDialog wizardDialog = (WizardDialog) wizardContainer;
        wizardDialog.addPageChangingListener(new ChangingListener());
        wizardDialog.addPageChangedListener(new ChangedListener(wizardDialog));
        wizardDialog.setHelpAvailable(true);
    }
}
项目:eclipsensis    文件:NSISManualConfigWizard.java   
@Override
public void setContainer(IWizardContainer wizardContainer)
{
    if(getContainer() instanceof IPageChangeProvider) {
        ((IPageChangeProvider)getContainer()).removePageChangedListener(mPageChangedListener);
    }
    super.setContainer(wizardContainer);
    if(getContainer() instanceof IPageChangeProvider) {
        ((IPageChangeProvider)getContainer()).addPageChangedListener(mPageChangedListener);
    }
}
项目:eclipse-plugin    文件:ExportProjectToCodenvyWizard.java   
@Override
public void setContainer(IWizardContainer wizardContainer) {
    super.setContainer(wizardContainer);

    if (wizardContainer != null) {
        final WizardDialog wizardDialog = (WizardDialog)wizardContainer;
        wizardDialog.addPageChangingListener(authenticationWizardPage);
        wizardDialog.addPageChangedListener(workspaceWizardPage);
    }
}
项目:eclipse-plugin    文件:ImportProjectFromCodenvyWizard.java   
@Override
public void setContainer(IWizardContainer wizardContainer) {
    super.setContainer(wizardContainer);

    if (wizardContainer != null) {
        final WizardDialog wizardDialog = (WizardDialog)wizardContainer;
        wizardDialog.addPageChangingListener(authenticationWizardPage);
        wizardDialog.addPageChangedListener(projectWizardPage);
    }
}
项目:birt    文件:BirtWebProjectWizardConfigurationPage.java   
/**
 * Called whenever the wizard page has changed and forces its container
 * to resize its content.
 * 
 * @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
 */
public void pageChanged( PageChangedEvent event )
{
    if ( this.wizardPage == event.getSelectedPage( ) )
    {
        // force size update
        IWizardContainer container = getContainer( );
        if ( container instanceof IWizardContainer2 )
        {
            ( (IWizardContainer2) container ).updateSize( );
        }
    }
}
项目:goclipse    文件:LangNewProjectWizard.java   
@Override
    public void setContainer(IWizardContainer wizardContainer) {
        super.setContainer(wizardContainer);

//      if(wizardContainer != null) {
//          WizardDialog wizardDialog = assertInstance(wizardContainer, WizardDialog.class);
//          wizardDialog.addPageChangingListener(this);
//      }
    }
项目:PDFReporter-Studio    文件:AWizardPage.java   
@Override
public IWizardContainer getContainer() {
    return super.getContainer();
}
项目:SO-Eclipse-Plugin    文件:QuestionPage.java   
public IWizardContainer getContainer()
{
    return super.getContainer();
}
项目:Environment    文件:ImportWizard.java   
@Override
public void setContainer(IWizardContainer wizardContainer) {
    // TODO Auto-generated method stub

       super.setContainer(wizardContainer);
    if (wizardContainer == null)
    {
        if (this.dialog != null)
        {
            this.dialog = null;
        }
        return;
    }

    this.dialog = (WizardDialog)wizardContainer;
    this.dialog.addPageChangingListener(new IPageChangingListener() {


        @Override
        public void handlePageChanging(PageChangingEvent event) {
            // TODO Auto-generated method stub
            Object current = event.getCurrentPage();
            Object target = event.getTargetPage();

            List<IWizardPage> list = Arrays.asList(getPages());
            int idxCurrent = list.indexOf(current);
            int idxTarget = list.indexOf(target);

            java.lang.System.out.println("Current: "+current.getClass().getName()+"  ;;  Target: "+target.getClass().getName());
            if (current instanceof IWizardPageControll)
            {
                       if (idxCurrent < idxTarget)
                       {
                               // perform Next
                               ((IWizardPageControll)current).performNext();
                       }
                       else
                       {
                               // perform Back
                               ((IWizardPageControll)current).performBack();
                       }
            }

            if (target instanceof IWizardPageControll)
            {
                ((IWizardPageControll)target).performUpdate();
                currentPage = (IWizardPageControll)target;
            }
            else
            {
                currentPage = null;
            }



        }
    });
}
项目:uDig-WPS-plugin    文件:GoogleEarthExporter.java   
@Override
public IWizardContainer getContainer() {
    // TODO Auto-generated method stub
    return null;
}
项目:uDig-WPS-plugin    文件:GoogleEarthExporter.java   
@Override
public void setContainer(IWizardContainer wizardContainer) {
    // TODO Auto-generated method stub

}
项目:geokettle-2.0    文件:TextFileImportWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:geokettle-2.0    文件:TextFileImportWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:geokettle-2.0    文件:RipDatabaseWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:geokettle-2.0    文件:RipDatabaseWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:geokettle-2.0    文件:CopyTableWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:geokettle-2.0    文件:CopyTableWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:XRobot    文件:SampleImport.java   
public IWizardContainer getContainer() {
    return delegate.getContainer();
}
项目:XRobot    文件:SampleImport.java   
public void setContainer(IWizardContainer wizardContainer) {
    delegate.setContainer(wizardContainer);
}
项目:read-open-source-code    文件:TextFileImportWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:read-open-source-code    文件:TextFileImportWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:read-open-source-code    文件:RipDatabaseWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:read-open-source-code    文件:RipDatabaseWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:read-open-source-code    文件:CopyTableWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:read-open-source-code    文件:CopyTableWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:kettle-4.4.0-stable    文件:TextFileImportWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:kettle-4.4.0-stable    文件:TextFileImportWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:kettle-4.4.0-stable    文件:RipDatabaseWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}
项目:kettle-4.4.0-stable    文件:RipDatabaseWizard.java   
public void setContainer(IWizardContainer wizardContainer) 
{
}
项目:kettle-4.4.0-stable    文件:CopyTableWizard.java   
public IWizardContainer getContainer() 
{
    return null;
}