org.eclipse.jface.window.Window.initializeBounds()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.eclipse.jface.window.Window.initializeBounds()方法的一些代码示例,展示了Window.initializeBounds()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.initializeBounds()方法的具体详情如下:
包路径:org.eclipse.jface.window.Window
类名称:Window
方法名:initializeBounds

Window.initializeBounds介绍

[英]Initializes the location and size of this window's SWT shell after it has been created.

This framework method is called by the create framework method. The default implementation calls getInitialSize and getInitialLocation and passes the results to Shell.setBounds. This is only done if the bounds of the shell have not already been modified. Subclasses may extend or reimplement.
[中]创建此窗口的SWT外壳后,初始化其位置和大小。
此框架方法由create框架方法调用。默认实现调用getInitialSizegetInitialLocation,并将结果传递给Shell.setBounds。只有在壳的边界尚未修改时,才能执行此操作。子类可以扩展或重新实现。

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Creates this window's widgetry in a new top-level shell.
 * <p>
 * The default implementation of this framework method creates this window's
 * shell (by calling <code>createShell</code>), and its controls (by
 * calling <code>createContents</code>), then initializes this window's
 * shell bounds (by calling <code>initializeBounds</code>).
 * </p>
 */
public void create() {
  shell = createShell();
  contents = createContents(shell);
  //initialize the bounds of the shell to that appropriate for the
  // contents
  initializeBounds();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Creates this window's widgetry in a new top-level shell.
 * <p>
 * The default implementation of this framework method creates this window's
 * shell (by calling <code>createShell</code>), and its controls (by
 * calling <code>createContents</code>), then initializes this window's
 * shell bounds (by calling <code>initializeBounds</code>).
 * </p>
 */
public void create() {
  shell = createShell();
  contents = createContents(shell);
  //initialize the bounds of the shell to that appropriate for the
  // contents
  initializeBounds();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

public void handleEvent( Event event ) {
  if( TextSizeUtil.isTemporaryResize() ) {
   temporaryResize = true;
  } else if( temporaryResize ) {
   shell.removeListener( SWT.Resize, this );
   initializeBounds();
  } else {
   shell.removeListener( SWT.Resize, this );
  }
 }
} );

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

protected void initializeBounds() {
  Shell shell = getShell();
  if (shell != null) {
    if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) {
      // make the default button the right-most button
      Button defaultButton = shell.getDefaultButton();
      if (defaultButton != null
          && isContained(buttonBar, defaultButton)) {
        defaultButton.moveBelow(null);
        ((Composite) buttonBar).layout();
      }
    }
  }
  
  super.initializeBounds();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

initializeBounds();

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * {@inheritDoc}
 * <p>
 * The implementation in {@link #Dialog} also moves the
 * {@link Shell#getDefaultButton() default button} in the
 * {@link #createButtonBar(Composite) button bar} to the right
 * if that's required by the
 * {@link Display#getDismissalAlignment() platform convention}.
 * </p>
 */
@Override
protected void initializeBounds() {
  Shell shell = getShell();
  if (shell != null) {
    if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) {
      // make the default button the right-most button
      Button defaultButton = shell.getDefaultButton();
      if (defaultButton != null
          && isContained(buttonBar, defaultButton)) {
        defaultButton.moveBelow(null);
        defaultButton.getParent().layout();
      }
    }
  }
  super.initializeBounds();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * {@inheritDoc}
 * <p>
 * The implementation in {@link #Dialog} also moves the
 * {@link Shell#getDefaultButton() default button} in the
 * {@link #createButtonBar(Composite) button bar} to the right
 * if that's required by the
 * {@link Display#getDismissalAlignment() platform convention}.
 * </p>
 */
@Override
protected void initializeBounds() {
  // UI guidelines:
  // https://developer.gnome.org/hig/stable/dialogs.html.en#primary-buttons
  // https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/OSXHIGuidelines/WindowDialogs.html#//apple_ref/doc/uid/20000957-CH43-SW5
  // https://msdn.microsoft.com/en-us/library/windows/desktop/dn742499(v=vs.85).aspx#win_dialog_box_image25
  Shell shell = getShell();
  if (shell != null) {
    if (shell.getDisplay().getDismissalAlignment() == SWT.RIGHT) {
      // make the default button the right-most button
      Button defaultButton = shell.getDefaultButton();
      if (defaultButton != null
          && isContained(buttonBar, defaultButton)) {
        defaultButton.moveBelow(null);
        defaultButton.getParent().layout();
      }
    }
  }
  super.initializeBounds();
}

代码示例来源:origin: openaudible/openaudible

protected void initializeBounds() {
  super.initializeBounds();
  getShell().setBackground(bgColor);
  getShell().addListener(SWT.MouseDown, this);
  Rectangle r = GUI.shell.getBounds();
  getShell().setLocation(r.x + 160, r.y + 160);
  getShell().addListener(SWT.Deactivate, this);
}

相关文章