示例#1
0
  protected Control createDialogArea(Composite parent) {
    dialogArea = new Composite(parent, SWT.NONE);
    dialogArea.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    dialogArea.setLayout(layout);
    dialogArea.addMouseListener(clickListener);

    // The "click to update" label
    Label infoLabel = new Label(dialogArea, SWT.NONE);
    infoLabel.setText(
        MessageFormat.format(
            EplMessages.TitaniumUpdatePopup_update_detail, EclipseUtil.getStudioPrefix()));
    infoLabel.setLayoutData(new GridData(GridData.FILL_BOTH));
    infoLabel.addMouseListener(clickListener);

    return dialogArea;
  }
示例#2
0
  public TitaniumUpdatePopup(Shell parentShell, final Runnable updateAction) {
    super(
        parentShell,
        PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE | SWT.MODELESS,
        false,
        true,
        true,
        false,
        false,
        MessageFormat.format(
            EplMessages.TitaniumUpdatePopup_update_title, EclipseUtil.getStudioPrefix()),
        null);

    clickListener =
        new MouseAdapter() {
          public void mouseDown(MouseEvent e) {
            updateAction.run();
            close();
          }
        };
  }