让我自己的Eclipse简介页面(Make my own Eclipse Intro page)

2019-09-18 10:38发布

我现在面临的困难,使我自己的Eclipse介绍页面( 如下图所示 )。

看来,我有一些probleme我的产品ID,但我不知道如何获得产品ID,我都试图扩大org.eclipse.core.runtime.products但是当它问我我要注册我不知道哪个应用程序怎么回答,它似乎是问题的一部分......任何人的任何想法?

Answer 1:

你需要定义一个新的ID,或者你只是想有一个最小的配置,将只显示你的内容?

如果是后者,你看到的相同的帮助后面的部分? 定义一个最小的前奏配置 ,建议使用org.eclipse.intro.minimal所以它会显示您的内容。



Answer 2:

以下是我终于做到了......

public class IntroPart implements IIntroPart {

 //VITAL : you must implement
    public void createPartControl(Composite container) {
        Composite outerContainer = new Composite(container, SWT.NONE);
        GridLayout gridLayout = new GridLayout();
        outerContainer.setLayout(gridLayout);
        outerContainer.setBackground(outerContainer.getDisplay()
                .getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT));
        Label label = new Label(outerContainer, SWT.CENTER);
        label.setText("WELCOME TO ECLIPSE");
        GridData gd = new GridData(GridData.GRAB_HORIZONTAL
                | GridData.GRAB_VERTICAL);
        gd.horizontalAlignment = GridData.CENTER;
        gd.verticalAlignment = GridData.CENTER;
        label.setLayoutData(gd);
        label.setBackground(outerContainer.getDisplay().getSystemColor(
                SWT.COLOR_TITLE_BACKGROUND_GRADIENT));
    }

 //VITAL : you must implement
    public String getTitle() {
        return "My Title";
    }

 //VITAL : you must implement
    public Image getTitleImage() {
        return new Image(Display.getCurrent(), this.getClass()
                .getResourceAsStream("splash.bmp"));
    }

    public void addPropertyListener(IPropertyListener listener) {
         //NON-VITAL : implement accordingly to your needs
    }

    public void dispose() {
         //NON-VITAL : implement accordingly to your needs
    }

    public IIntroSite getIntroSite() {
         //NON-VITAL : implement accordingly to your needs
        return null;
    }

    public void init(IIntroSite site, IMemento memento)
            throws PartInitException {
         //NON-VITAL : implement accordingly to your needs
    }

    public void removePropertyListener(IPropertyListener listener) {
         //NON-VITAL : implement accordingly to your needs
    }

    public void saveState(IMemento memento) {
         //NON-VITAL : implement accordingly to your needs
    }

    public void setFocus() {
         //NON-VITAL : implement accordingly to your needs
    }

    public void standbyStateChanged(boolean standby) {
         //NON-VITAL : implement accordingly to your needs
    }

    public Object getAdapter(Class adapter) {
         //NON-VITAL : implement accordingly to your needs
        return null;
    }
}

所使用的图片是我的一个和它去,当您显示欢迎页面的标签图标...

奇怪的是,标题和图像没有默认值...但嘿...这就是生活。

希望对大家有所帮助^^



文章来源: Make my own Eclipse Intro page