【问题标题】:Using WindowBuilder in Eclipse to add SWT TableView window to existing program在 Eclipse 中使用 WindowBuilder 将 SWT TableView 窗口添加到现有程序
【发布时间】:2012-07-25 11:18:54
【问题描述】:

我已经在 Eclipse Juno 中安装了 WindowBuilder,并且能够创建详细信息页面。生成的源代码:

    /**
 * Initialize the details page.
 * @param form
 */
public void initialize(IManagedForm form) {
    managedForm = form;
}

/**
 * Create contents of the details page.
 * @param parent
 */
public void createContents(Composite parent) {
    FormToolkit toolkit = managedForm.getToolkit();
    parent.setLayout(new FillLayout());
    //      

需要初始化 ManagedForm。一个非常 Java 的新手,我完全不知道从哪里得到这个对象。我可能错过了显而易见的事情,但非常感谢您的帮助。

【问题讨论】:

    标签: swt jface windowbuilder


    【解决方案1】:

    查看ManagedForm 课程。创建一个继承自 ManagedForm 的新类,您就得到了一个 IManagedForm 实现:

    public class MyManagedForm extends ManagedForm {
        public MyManagedForm(Composite parent) {
            super(parent);
        }
    }
    

    我建议使用像 Eclipse 这样的编辑器并将源代码放入其中,这样您就可以轻松地浏览文档和 API 的一般类。 Lars Vogel's introduction to Eclipse APIs 也不错。

    【讨论】:

      猜你喜欢
      • 2012-05-18
      • 1970-01-01
      • 2011-05-30
      • 1970-01-01
      • 1970-01-01
      • 2011-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多