Eclipse应用程序运行/启动配置UI

时间:2018-08-08 10:06:51

标签: java eclipse launch-configuration

我正在开发具有自己的启动配置类型的Eclipse应用程序。 它几乎需要与Java Application配置类型相同(Project的“ Main”,接口类和带有参数“ Common”和“ JRE”的表)。 常见于org.eclipse.debug.ui软件包中,因此很容易实现。

我使用了本教程的某些部分: http://www.vogella.com/tutorials/EclipseLauncherFramework/article.html#eclipsecustomlaunchconfigurationui

对于Main-和JRE-Tab我什么也没找到。这些标签有模板吗?

我开始使用本教程创建一个自己的Main-Tab(如上所述),但是无法执行Apply。.

public class MainTab extends AbstractLaunchConfigurationTab {

private Text project;
private Text interfaceText;

@Override
public void createControl(Composite parent) {

    Composite comp = new Group(parent, SWT.BORDER);
    setControl(comp);

    // Project
    GridLayoutFactory.swtDefaults().numColumns(2).applyTo(comp);

    Label label = new Label(comp, SWT.NONE);
    label.setText("Project:");
    GridDataFactory.swtDefaults().applyTo(label);

    project = new Text(comp, SWT.BORDER);
    project.setMessage("Project");
    GridDataFactory.fillDefaults().grab(true, false).applyTo(project);

    // Interface Class
    GridLayoutFactory.swtDefaults().numColumns(2).applyTo(comp);

    Label label3 = new Label(comp, SWT.NONE);
    label3.setText("Interface:");
    GridDataFactory.swtDefaults().applyTo(label3);

    interfaceText = new Text(comp, SWT.BORDER);
    interfaceText.setMessage("Interface");
    GridDataFactory.fillDefaults().grab(true, false).applyTo(interfaceText);
}

@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
}

@Override
public void initializeFrom(ILaunchConfiguration configuration) {
}

@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
    // set the text value for the CONSOLE_TEXT key
    if (project.getText() != null) {
        configuration.setAttribute(ExampleLaunchConfigurationAttributes.CONSOLE_TEXT, project.getText());
    }
}

@Override
public String getName() {
    return "Main";
}

}

0 个答案:

没有答案