Exemplo n.º 1
0
  /** Overriding to make sure that the dialog is centered in screen */
  @Override
  protected void initializeBounds() {
    super.initializeBounds();

    getShell().setSize(390, 240);
    guiHelper.centerShellInScreen(getShell());
  }
Exemplo n.º 2
0
  /*
   * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
   */
  @Override
  protected void initializeBounds() {
    super.initializeBounds();

    /* Dialog was not opened before */
    if (fFirstTimeOpen) {
      Shell shell = getShell();

      /* Minimum Size */
      int minWidth = convertHorizontalDLUsToPixels(OwlUI.MIN_DIALOG_WIDTH_DLU);
      int minHeight = shell.computeSize(minWidth, SWT.DEFAULT).y;

      /* Required Size */
      Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

      shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));
      LayoutUtils.positionShell(shell);
    }
  }
  /*
   * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
   */
  @Override
  protected void initializeBounds() {
    super.initializeBounds();

    Shell shell = getShell();

    /* Minimum Size */
    int minWidth = convertHorizontalDLUsToPixels(DIALOG_WIDTH_DLUS);
    int minHeight = convertHorizontalDLUsToPixels(DIALOG_HEIGHT_DLUS);

    /* Required Size */
    Point requiredSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);

    /* Set Size */
    shell.setSize(Math.max(minWidth, requiredSize.x), Math.max(minHeight, requiredSize.y));

    /* Set Location */
    if (fFirstTimeOpen) LayoutUtils.positionShell(shell);
  }
Exemplo n.º 4
0
 protected void initializeBounds() {
   super.createButton((Composite) getButtonBar(), CALCBTN_ID, "计算", false);
   super.createButton((Composite) getButtonBar(), IDialogConstants.OK_ID, "确定", true);
   super.createButton((Composite) getButtonBar(), IDialogConstants.CANCEL_ID, "取消", true);
   super.initializeBounds();
 }
  /** 添加确定按钮 @Override */
  protected void initializeBounds() {

    super.createButton((Composite) getButtonBar(), IDialogConstants.OK_ID, "确定", true);
    super.initializeBounds();
  }
 @Override
 protected void initializeBounds() {
   super.initializeBounds();
   // call validate after creating dialog
   validateSelection();
 }