Пример #1
0
  @Override
  public void run() {
    File container;

    try {
      container = getSelectedContainer();
    } catch (IOException e) {
      ExceptionUtil.handle(e);
      return;
    }

    if (container == null) {
      return;
    }

    final PublishResourceWizard publishLibrary =
        new PublishResourceWizard(container.getAbsolutePath());
    WizardDialog dialog =
        new WizardDialog(UIUtil.getDefaultShell(), publishLibrary) {

          @Override
          protected void okPressed() {
            publishLibrary.setCopyFileRunnable(
                createCopyFileRunnable(
                    publishLibrary.getSourceFile(), publishLibrary.getTargetFile()));

            super.okPressed();
          }
        };

    dialog.setPageSize(500, 250);
    if (dialog.open() == Window.OK) {
      fireResourceChanged(publishLibrary.getTargetFile().getAbsolutePath());
    }
  }
Пример #2
0
 @Override
 public void run(IAction action) {
   ISelection selection = getSelection();
   if (!selection.isEmpty()) {
     Object firstElement = ((IStructuredSelection) selection).getFirstElement();
     NewFolderWizard wizard = new NewFolderWizard(firstElement.toString());
     wizard.init(getWindow().getWorkbench(), (IStructuredSelection) selection);
     WizardDialog wizardDialog = new WizardDialog(getWindow().getShell(), wizard);
     wizardDialog.setPageSize(400, 400);
     wizardDialog.open();
   }
 }
Пример #3
0
  /**
   * Must be called in the UI thread.
   *
   * @param sel will define what appears initially in the project/source folder/name.
   */
  public static void startWizard(
      AbstractPythonWizard wizard, String title, IStructuredSelection sel) {
    IWorkbenchPart part =
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();

    wizard.init(part.getSite().getWorkbenchWindow().getWorkbench(), sel);
    wizard.setWindowTitle(title);

    Shell shell = part.getSite().getShell();
    if (shell == null) {
      shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    }
    WizardDialog dialog = new WizardDialog(shell, wizard);
    dialog.setPageSize(350, 500);
    dialog.setHelpAvailable(false);
    dialog.create();
    dialog.open();
  }
 private void openHCatalogSchemaWizard(
     final HCatalogConnectionItem item,
     final MetadataTable metadataTable,
     final boolean forceReadOnly,
     final boolean creation) {
   WizardDialog wizardDialog =
       new WizardDialog(
           Display.getDefault().getActiveShell(),
           new HCatalogSchemaWizard(
               PlatformUI.getWorkbench(),
               creation,
               repositoryNode.getObject(),
               metadataTable,
               getExistingNames(),
               forceReadOnly));
   wizardDialog.setPageSize(WIZARD_WIDTH, WIZARD_HEIGHT);
   wizardDialog.create();
   wizardDialog.open();
 }
  @Override
  public void run() {
    PackagesAnalyisParameter packaFilterParameter = new PackagesAnalyisParameter();
    catalogs.clear();
    for (IRepositoryNode node : nodes) {
      if (node instanceof DBConnectionRepNode) {
        packaFilterParameter.setConnectionRepNode((DBConnectionRepNode) node);
        connNode = (DBConnectionRepNode) node;
      } else if (node instanceof DBCatalogRepNode) {
        IRepositoryNode parent = ((DBCatalogRepNode) node).getParent();
        packaFilterParameter.setConnectionRepNode((DBConnectionRepNode) parent);
        catalogs.add(node);
        packaFilterParameter.setPackages(catalogs);
        cataNode = (DBCatalogRepNode) node;
      } else if (node instanceof DBSchemaRepNode) {
        IRepositoryNode parent = ((DBSchemaRepNode) node).getParent();
        schemaNode = (DBSchemaRepNode) node;
        if (parent instanceof DBCatalogRepNode) {
          IRepositoryNode connNode = ((DBCatalogRepNode) parent).getParent();
          packaFilterParameter.setConnectionRepNode((DBConnectionRepNode) connNode);
          catalogs.add(schemaNode);
          packaFilterParameter.setPackages(catalogs);
        } else {
          catalogs.add(schemaNode);
          packaFilterParameter.setConnectionRepNode((DBConnectionRepNode) parent);
          packaFilterParameter.setPackages(catalogs);
        }
      }
    }
    Wizard wizard = null;
    if (connNode != null) {
      packaFilterParameter.setConnectionRepNode(connNode);
      wizard = WizardFactory.createAnalysisWizard(AnalysisType.CONNECTION, packaFilterParameter);
    } else if (cataNode != null) {
      wizard = WizardFactory.createAnalysisWizard(AnalysisType.CATALOG, packaFilterParameter);
    } else if (schemaNode != null) {
      wizard = WizardFactory.createAnalysisWizard(AnalysisType.SCHEMA, packaFilterParameter);
    }

    WizardDialog dialog = new WizardDialog(null, wizard);
    dialog.setPageSize(WIDTH, HEIGHT);
    dialog.open();
  }
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
   */
  @Override
  protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    RepositoryNode node = (RepositoryNode) obj;

    ERepositoryObjectType objectType = null;
    IPath path = null;

    path = RepositoryNodeUtilities.getPath(node);
    if (RepositoryConstants.isSystemFolder(path.toString())) {
      return;
    }
    objectType = (ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE);

    if (objectType != null) {
      FolderWizard processWizard = new FolderWizard(path, objectType, null);
      Shell activeShell = Display.getCurrent().getActiveShell();
      WizardDialog dialog = new WizardDialog(activeShell, processWizard);
      dialog.setPageSize(400, 60);
      dialog.create();
      dialog.open();
    }
  }
Пример #7
0
    private IConversionContext setupwizard(IConversionContext context) {
      final SetUpProcessWizardPage convertPage = new SetUpProcessWizardPage(context);

      Wizard wiz =
          new Wizard() {
            // set
            @Override
            public boolean performFinish() {
              convertPage.populateContext();
              return true;
            }
          };

      wiz.setNeedsProgressMonitor(true);
      wiz.addPage(convertPage);
      final WizardDialog wd = new WizardDialog(getSite().getShell(), wiz);
      wd.setPageSize(new Point(900, 500));
      wd.create();
      context.setConversionScheme(ConversionScheme.PROCESS);

      if (wd.open() == WizardDialog.OK) return context;

      return null;
    }