@Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    Dialog dialog = new LicenseDialog(HandlerUtil.getActiveShell(event));
    dialog.open();

    return null;
  }
  public void widgetSelected(SelectionEvent e) {
    Object source = e.getSource();

    if (source == newSiteButton) {
      final Shell shell = getShell();
      Dialog dlg =
          new FTPPropertyDialogProvider()
              .createPropertyDialog(
                  new IShellProvider() {

                    public Shell getShell() {
                      return shell;
                    }
                  });
      if (dlg instanceof IPropertyDialog) {
        ((IPropertyDialog) dlg)
            .setPropertySource(
                CoreIOPlugin.getConnectionPointManager().getType(IBaseFTPConnectionPoint.TYPE_FTP));
      }
      int ret = dlg.open();

      if (ret == Window.OK) {
        populateTable();

        if (dlg instanceof IPropertyDialog) {
          checkItem((IConnectionPoint) ((IPropertyDialog) dlg).getPropertySource());
        }
      }
    } else if (source == syncOnFinish) {
      setSynchronize(syncOnFinish.getSelection());
    }
  }
 /*
  * Called when the user selects the action to localize this dialog.
  * This will bring up a dialog that can be used to localize this dialog.
  */
 protected void localizationPressed() {
   Dialog dialog =
       new LocalizeDialog(
           getShell(),
           TranslatableNLS.bind(Messages.LocalizeDialog_Title_DialogPart, getShell().getText()),
           languageSet,
           Activator.getDefault().getMenuTextSet());
   dialog.open();
 }
Example #4
0
 protected void buttonPressed(int buttonId) {
   if (buttonId == CALCBTN_ID) {
     this.calculateAHP();
   } else if (buttonId == IDialogConstants.OK_ID) {
     this.setWeightTree();
     this.setWeightFFT();
     super.okPressed();
   } else if (buttonId == IDialogConstants.CANCEL_ID) {
     super.cancelPressed();
   }
 }
    @Override
    public void run() {
      Dialog dialog =
          newConfirmationDialog(
              "Terminate selected environments?",
              "Are you sure you want to terminate the selected AWS Elastic Beanstalk environments?");
      if (dialog.open() != 0) return;

      Job terminateEnvironmentsJob =
          new Job("Terminating Environments") {
            @Override
            protected IStatus run(IProgressMonitor monitor) {
              String endpoint =
                  RegionUtils.getCurrentRegion()
                      .getServiceEndpoints()
                      .get(ServiceAbbreviations.BEANSTALK);
              AWSElasticBeanstalk beanstalk =
                  AwsToolkitCore.getClientFactory().getElasticBeanstalkClientByEndpoint(endpoint);

              List<Exception> errors = new ArrayList<Exception>();
              for (EnvironmentDescription env : environments) {
                try {
                  beanstalk.terminateEnvironment(
                      new TerminateEnvironmentRequest().withEnvironmentId(env.getEnvironmentId()));
                } catch (Exception e) {
                  errors.add(e);
                }
              }

              IStatus status = Status.OK_STATUS;
              if (errors.size() > 0) {
                status =
                    new MultiStatus(
                        AwsToolkitCore.PLUGIN_ID, 0, "Unable to terminate environments", null);
                for (Exception error : errors) {
                  ((MultiStatus) status)
                      .add(
                          new Status(
                              Status.ERROR,
                              AwsToolkitCore.PLUGIN_ID,
                              "Unable to terminate environment",
                              error));
                }
              }

              ContentProviderRegistry.refreshAllContentProviders();

              return status;
            }
          };

      terminateEnvironmentsJob.schedule();
    }
  @Override
  protected Control createContents(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayoutFactory.fillDefaults().applyTo(container);

    if (studyParameters.getCustomizingPlugin() != null) {
      Label label = new Label(parent, SWT.NULL);
      label.setText(studyParameters.getCustomizedByMessage());
      label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));

      if (studyParameters.getMoreInformationUrl() != null) {
        ImageHyperlink link = new ImageHyperlink(parent, SWT.NONE);
        link.setText(Messages.UsageDataPreferencePage_Learn_More);
        link.setForeground(CommonColors.HYPERLINK_WIDGET);
        link.addHyperlinkListener(
            new HyperlinkAdapter() {
              @Override
              public void linkActivated(HyperlinkEvent e) {
                openMoreInformaionInBrowser();
              }
            });
      }
    }

    createLogFileSection(container);
    createUsageSection(container);
    updateEnablement();

    Dialog.applyDialogFont(container);
    return container;
  }
 /*
  * @see Window#configureShell(Shell)
  */
 @Override
 protected void configureShell(Shell newShell) {
   super.configureShell(newShell);
   PlatformUI.getWorkbench()
       .getHelpSystem()
       .setHelp(newShell, IHelpContextIds.CONFIGURE_CHART_DIALOG);
 }
  protected void buttonPressed(int buttonId) {
    if (buttonId == RESET_ID) {
      usernameField.setText(""); // $NON-NLS-1$
      passwordField.setText(""); // $NON-NLS-1$
    } else {
      if (buttonId == Window.OK) {
        if (!workspaceCombo.getEnabled()) {
          portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace);
          return;
        }
        if (workspaceCombo.getSelectionIndex() == -1) {
          portalStatus.setText(Messages.TAUPortalUploadDialog_ErrorNoWorkspace);
          return;
        }

        try {
          String success =
              uploadPPK(
                  url, uname, pwd, workspaceCombo.getItem(workspaceCombo.getSelectionIndex()), ppk);
          if (success.indexOf(Messages.TAUPortalUploadDialog_Error) >= 0) {
            portalStatus.setText(success);
            return;
          }
        } catch (Exception e) {
          e.printStackTrace();
          portalStatus.setText(Messages.TAUPortalUploadDialog_UploadError);
          return;
        }
      }
      super.buttonPressed(buttonId);
    }
  }
  @Override
  protected Control createDialogArea(Composite ancestor) {
    Composite parent = (Composite) super.createDialogArea(ancestor);

    final int nOfColumns = 4;

    initializeDialogUnits(ancestor);

    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns = nOfColumns;
    parent.setLayout(layout);

    createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

    Separator s = new Separator(SWT.SEPARATOR | SWT.HORIZONTAL);
    s.doFillIntoGrid(parent, nOfColumns);

    createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

    Dialog.applyDialogFont(parent);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(parent, IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE);
    validateAll();
    return parent;
  }
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 0;
    layout.marginWidth = 5;
    container.setLayout(layout);

    tablePart.createControl(container);

    pluginListViewer = tablePart.getTableViewer();
    pluginListViewer.setContentProvider(new BuildpathContentProvider());
    pluginListViewer.setLabelProvider(MDEPlugin.getDefault().getLabelProvider());

    GridData gd = (GridData) tablePart.getControl().getLayoutData();
    gd.heightHint = 300;
    gd.widthHint = 300;

    pluginListViewer.setInput(MDEPlugin.getDefault());
    if (fSelected != null && fSelected.length > 0) {
      tablePart.setSelection(fSelected);
    }
    setControl(container);
    Dialog.applyDialogFont(container);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.UPDATE_CLASSPATH);
  }
  @Override
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    layout.makeColumnsEqualWidth = false;
    layout.horizontalSpacing = 5;
    layout.verticalSpacing = 10;
    container.setLayout(layout);

    createScrollArea(container);
    createAvailableList(container).setLayoutData(new GridData(GridData.FILL_BOTH));
    createButtonArea(container);
    createImportList(container).setLayoutData(new GridData(GridData.FILL_BOTH));
    updateCount();

    // create container for buttons
    Composite optionComp =
        SWTFactory.createComposite(container, 1, 3, GridData.FILL_HORIZONTAL, 5, 0);
    createComputationsOption(optionComp);
    createFilterOptions(optionComp);

    addViewerListeners();
    initialize();
    addFilters();
    setControl(container);
    Dialog.applyDialogFont(container);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(container, IHelpContextIds.PLUGIN_IMPORT_SECOND_PAGE);
  }
 @Override
 protected void configureShell(Shell newShell) {
   super.configureShell(newShell);
   if (title != null) {
     newShell.setText(title);
   }
 }
 @Override
 public void configureShell(Shell newShell) {
   super.configureShell(newShell);
   newShell.setText(
       String.format("%s v%s", SystemDefine.NAME, SystemDefine.MAJOR_VERSION)); // $NON-NLS-1$
   newShell.setImage(GlobalImageUtils.getTadpoleIcon());
 }
  @Override
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setFont(parent.getFont());

    int nColumns = 1;

    GridLayout layout = new GridLayout();
    layout.numColumns = nColumns;
    composite.setLayout(layout);

    final Label applicationStyleLabel = new Label(composite, SWT.NONE);
    applicationStyleLabel.setText(
        JaxrsApplicationCreationMessages.JaxrsApplicationCreationWizardPage_ApplicationStyle);
    GridDataFactory.fillDefaults()
        .align(SWT.FILL, SWT.CENTER)
        .grab(false, false)
        .applyTo(applicationStyleLabel);
    // JAX-RS Application created as a Java class
    createJavaApplicationControls(composite);
    // JAX-RS Application created as a Servlet mapping in web.xml
    createWebxmlApplicationControls(composite);
    // Skip JAX-RS Application creation
    createSkipApplicationControls(composite);

    setControl(composite);
    Dialog.applyDialogFont(composite);
    doStatusUpdate();
    updateApplicationCreationModeControls();
  }
Example #15
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
  */
 @Override
 protected void configureShell(final Shell shell) {
   super.configureShell(shell);
   if (this.title != null) {
     shell.setText(this.title);
   }
 }
  /*
   * (non-Javadoc)
   * @see org.eclipse.ui.dialogs.WizardNewProjectCreationPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  @Override
  public void createControl(Composite parent) {
    super.createControl(parent);
    Composite control = (Composite) getControl();

    Group group = new Group(control, SWT.NONE);
    group.setLayout(new GridLayout(2, false));
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    group.setText(Messages.PHPDevelopmentPage_compatibility);

    Label label = new Label(group, SWT.NONE);
    label.setText(Messages.PHPDevelopmentPage_phpVersion);
    fPHPVersions = new Combo(group, SWT.BORDER | SWT.READ_ONLY | SWT.DROP_DOWN);
    fPHPVersions.setItems(
        PHPVersionConfigurationBlock.PHP_VERSION_NAMES.toArray(
            new String[PHPVersionConfigurationBlock.PHP_VERSION_NAMES.size()]));
    selectedAlias = PHPVersion.getLatest().getAlias();
    setSelectedVersion(selectedAlias);
    // Update the 'selectedAlias' on combo selection changes.
    // We do that to avoid a 'widget dispose' errors when accessing this field after the page was
    // disposed.
    fPHPVersions.addSelectionListener(
        new SelectionListener() {
          public void widgetSelected(SelectionEvent e) {
            selectedAlias =
                PHPVersionConfigurationBlock.PHP_ALIASES.get(fPHPVersions.getSelectionIndex());
          }

          public void widgetDefaultSelected(SelectionEvent e) {}
        });
    Dialog.applyDialogFont(control);
    setControl(control);
  }
 /**
  * {@inheritDoc}
  *
  * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
  */
 @Override
 protected void configureShell(Shell newShell) {
   super.configureShell(newShell);
   newShell.setText(
       DocBridgeUI.getInstance().getString("DocumentationLinkDialog_title")); // $NON-NLS-1$
   newShell.setSize(450, 520);
 }
  @Override
  public void create() {
    super.create();

    IDialogSettings settings = VistAServerPlugin.getDefault().getDialogSettings(this, MAIN);
    this.updateGlobalHistory(settings);
  }
  /** {@inheritDoc} */
  @Override
  protected void buttonPressed(int buttonId) {
    setReturnCode(buttonId);
    close();

    super.buttonPressed(buttonId);
  }
  @Override
  protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.CLOSE_ID
        || buttonId == IDialogConstants.CANCEL_ID
        || buttonId == IDialogConstants.BACK_ID) {
      this.setReturnCode(buttonId);
      this.close();

    } else if (buttonId == IDialogConstants.OK_ID) {
      try {
        if (!validate()) {
          return;
        }

        this.perfomeOK();
        setReturnCode(buttonId);
        close();

      } catch (InputException e) {
        if (e.getMessage() != null) {
          this.setMessage(ResourceString.getResourceString(e.getMessage(), e.getArgs()));
        }
        return;

      } catch (Exception e) {
        Activator.showExceptionDialog(e);
      }
    }

    super.buttonPressed(buttonId);
  }
  private void addProjectsSection(Composite parent) {
    Composite composite = createComposite(parent, 1, true);
    initializeDialogUnits(composite);

    Label label = new Label(composite, SWT.NONE);
    label.setText(PROJECTS_TEXT);

    projectList = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
    projectList.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
    projectList.setLabelProvider(
        new LabelProvider() {
          @Override
          public Image getImage(Object element) {
            return PlatformUI.getWorkbench()
                .getSharedImages()
                .getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
          }

          @Override
          public String getText(Object element) {
            return ((IProject) element).getName();
          }
        });

    // Filter out closed projects!
    ArrayList<IProject> projects = new ArrayList<IProject>();
    for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
      if (project.isOpen()) projects.add(project);
    }
    projectList.setContentProvider(new ArrayContentProvider());
    projectList.setInput(projects);

    Dialog.applyDialogFont(composite);
  }
  protected void okPressed() {
    boolean hasErrors = popupValidationErrorDialogIfNecessary();

    if (!hasErrors) {
      try {
        conceptUtil.setId(wId.getText());
      } catch (ObjectAlreadyExistsException e) {
        if (logger.isErrorEnabled()) {
          logger.error("an exception occurred", e);
        }
        MessageDialog.openError(
            getShell(),
            Messages.getString("General.USER_TITLE_ERROR"),
            Messages.getString(
                "PhysicalTableDialog.USER_ERROR_PHYSICAL_TABLE_ID_EXISTS", wId.getText()));
        return;
      }

      // attempt to set the connection
      IStructuredSelection selection = (IStructuredSelection) comboViewer.getSelection();
      DatabaseMeta con = (DatabaseMeta) selection.getFirstElement();
      BusinessModel busModel = (BusinessModel) conceptUtil;
      if (!DUMMY_CON_NAME.equals(con.getName())) {
        busModel.setConnection((DatabaseMeta) con);
      } else {
        busModel.clearConnection();
      }

      super.okPressed();
    }
  }
  protected Text createFilterText(Composite parent) {
    fFilterText = new Text(parent, SWT.NONE);
    Dialog.applyDialogFont(fFilterText);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.CENTER;
    fFilterText.setLayoutData(data);

    fFilterText.addKeyListener(
        new KeyListener() {
          public void keyPressed(KeyEvent e) {
            if (e.keyCode == 0x0D) // return
            gotoSelectedElement();
            if (e.keyCode == SWT.ARROW_DOWN) getfTreeViewer().getTree().setFocus();
            if (e.keyCode == SWT.ARROW_UP) getfTreeViewer().getTree().setFocus();
            if (e.character == 0x1B) // ESC
            dispose();
          }

          public void keyReleased(KeyEvent e) {
            // do nothing
          }
        });

    return fFilterText;
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  public void createControl(Composite parent) {
    Composite inner = new Composite(parent, SWT.NONE);
    inner.setFont(parent.getFont());

    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    inner.setLayout(layout);
    inner.setLayoutData(new GridData(GridData.FILL_BOTH));

    fInclusionPatternList.doFillIntoGrid(inner, 3);
    LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
    LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));

    fExclusionPatternList.doFillIntoGrid(inner, 3);
    LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
    LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));

    setControl(inner);
    Dialog.applyDialogFont(inner);
    if (DLTKCore.DEBUG) {
      System.err.println("SetFilterWizardOage add help support here"); // $NON-NLS-1$
    }
    // PlatformUI.getWorkbench().getHelpSystem().setHelp(inner,
    // IDLTKHelpContextIds.INCLUSION_EXCLUSION_WIZARD_PAGE);
  }
 /**
  * Configure Shell. Set a title to it.
  *
  * @param newShell The new shell.
  * @see org.eclipse.jface.dialogs.Dialog#configureShell(org.eclipse.swt.widgets.Shell)
  */
 @Override
 protected void configureShell(Shell newShell) {
   newShell.setText(
       authorResourceBundle.getMessage(
           showChoiceTable ? ExtensionTags.INSERT_CHOICE_TABLE : ExtensionTags.INSERT_TABLE));
   super.configureShell(newShell);
 }
 /** @see Windows#configureShell */
 protected void configureShell(Shell newShell) {
   super.configureShell(newShell);
   newShell.setText(JREMessages.VMDetailsDialog_0);
   PlatformUI.getWorkbench()
       .getHelpSystem()
       .setHelp(newShell, IJavaDebugHelpContextIds.JRE_DETAILS_DIALOG);
 }
Example #27
0
  public void createControl(Composite parent) {
    final Composite panel = new Composite(parent, SWT.NULL);
    panel.setLayout(new GridLayout());

    specsPanel = new RefSpecPanel(panel, pushPage);
    specsPanel.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    specsPanel.addRefSpecTableListener(
        new SelectionChangeListener() {
          public void selectionChanged() {
            checkPage();
          }
        });

    if (!pushPage) {
      final Group tagsGroup = new Group(panel, SWT.NULL);
      tagsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
      tagsGroup.setText(UIText.RefSpecPage_annotatedTagsGroup);
      tagsGroup.setLayout(new GridLayout());
      tagsAutoFollowButton = new Button(tagsGroup, SWT.RADIO);
      tagsAutoFollowButton.setText(UIText.RefSpecPage_annotatedTagsAutoFollow);
      tagsFetchTagsButton = new Button(tagsGroup, SWT.RADIO);
      tagsFetchTagsButton.setText(UIText.RefSpecPage_annotatedTagsFetchTags);
      tagsNoTagsButton = new Button(tagsGroup, SWT.RADIO);
      tagsNoTagsButton.setText(UIText.RefSpecPage_annotatedTagsNoTags);
    }

    saveButton = new Button(panel, SWT.CHECK);
    saveButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, false));

    Dialog.applyDialogFont(panel);
    setControl(panel);
    checkPage();
  }
 @Override
 protected void okPressed() {
   userData.setUserName(userText.getText().trim());
   userData.setPassword(passwordText.getText().trim());
   userData.setSaveCredentials(saveCredentialsCheckButton.getSelection());
   super.okPressed();
 }
  @Override
  public void createControl(Composite parent) {
    // Create filtered list component
    fLocaleFilter = new FilteredListComponent(fModelLocalesTable, new LocaleLabelProvider(), this);
    Composite container = fLocaleFilter.createFilteredListComponent(parent);

    createAllLocalesCheckbox(container);

    createLocaleGroupArea(container);

    setControl(container);
    Dialog.applyDialogFont(container);

    allLocalesCheckboxSelectionChanged();
    groupCheckboxSelectionChanged();

    try {
      int selectedIndex = getDialogSettings().getInt(SELECTED_GROUP);
      fLocaleGroupCombo.select(selectedIndex);
    } catch (NumberFormatException e) {
    }

    String pattern = not_null(getDialogSettings().get(FILTER_PATTERN), "");
    fLocaleFilter.fFilterText.setText(pattern);
  }
  @Override
  protected final void contributeButtons(final Composite parent) {
    this.statusButton = new Button(parent, SWT.PUSH);

    this.statusButton.setText("Status");

    Dialog.applyDialogFont(this.statusButton);

    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);

    int hint = this.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    int size = this.statusButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x;

    data.widthHint = Math.max(hint, size);

    this.statusButton.setLayoutData(data);

    this.statusButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          @SuppressWarnings("synthetic-access")
          public final void widgetSelected(final SelectionEvent e) {
            ElasticsearchPreferencePage.super.performOk();
            ElasticsearchPreferencePage.this.requestClusterState(true);
          }
        });

    ((GridLayout) parent.getLayout()).numColumns++;
  }