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

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

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

Window.createContents介绍

[英]Creates and returns this window's contents. Subclasses may attach any number of children to the parent. As a convenience, the return value of this method will be remembered and returned by subsequent calls to getContents(). Subclasses may modify the parent's layout if they overload getLayout() to return null.

It is common practice to create and return a single composite that contains the entire window contents.

The default implementation of this framework method creates an instance of Composite. Subclasses may override.
[中]创建并返回此窗口的内容。子类可以将任意数量的子类附加到父类。为了方便起见,此方法的返回值将被记住,并通过后续对getContents()的调用返回。如果子类重载getLayout()以返回null,则子类可能会修改父类的布局。
通常的做法是创建并返回一个包含整个窗口内容的组合。
此框架方法的默认实现将创建Composite的实例。子类可以重写。

代码示例

代码示例来源: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

contents = createContents(shell);

相关文章