Exemplo n.º 1
0
 /** @generated */
 public void init(IWorkbench workbench, IStructuredSelection selection) {
   this.workbench = workbench;
   this.selection = selection;
   setWindowTitle(Messages.WebdslCreationWizardTitle);
   setDefaultPageImageDescriptor(
       WebdslDiagramEditorPlugin.getBundledImageDescriptor(
           "icons/wizban/NewWebDSLWizard.gif")); //$NON-NLS-1$
   setNeedsProgressMonitor(true);
 }
Exemplo n.º 2
0
  /** @generated */
  public boolean performFinish() {
    IRunnableWithProgress op =
        new WorkspaceModifyOperation(null) {

          protected void execute(IProgressMonitor monitor)
              throws CoreException, InterruptedException {
            diagram =
                WebdslDiagramEditorUtil.createDiagram(
                    diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
            if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
              try {
                WebdslDiagramEditorUtil.openDiagram(diagram);
              } catch (PartInitException e) {
                ErrorDialog.openError(
                    getContainer().getShell(),
                    Messages.WebdslCreationWizardOpenEditorError,
                    null,
                    e.getStatus());
              }
            }
          }
        };
    try {
      getContainer().run(false, true, op);
    } catch (InterruptedException e) {
      return false;
    } catch (InvocationTargetException e) {
      if (e.getTargetException() instanceof CoreException) {
        ErrorDialog.openError(
            getContainer().getShell(),
            Messages.WebdslCreationWizardCreationError,
            null,
            ((CoreException) e.getTargetException()).getStatus());
      } else {
        WebdslDiagramEditorPlugin.getInstance()
            .logError("Error creating diagram", e.getTargetException()); // $NON-NLS-1$
      }
      return false;
    }
    return diagram != null;
  }