制作我自己的Eclipse Intro页面

时间:2023-01-14 14:42:13

I am facing difficulties to make my own Eclipse Intro Page (as shown here).

我在创建自己的Eclipse Intro页面时遇到了困难(如此处所示)。

It seems that I have some probleme with my product ID but I dont know how to get a product ID, I have tried to extend org.eclipse.core.runtime.products but when it asks me which application I want to register I dont know what to answer and it seems to be part of the problem ... anyone as any idea ?

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

2 个解决方案

#1


Do you need to define a new id, or do you just want a minimal config that will show only your content?

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

If it is the latter, have you seen the later section of the same help? Defining a minimal intro configuration, suggests using org.eclipse.intro.minimal so it will show just your content.

如果是后者,您是否看过同一帮助的后一部分?定义最小的介绍配置,建议使用org.eclipse.intro.minimal,以便它只显示您的内容。

#2


Here is what I finally did ...

这是我最终做的......

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;
    }
}

The picture used is one of mine and it goes as the tab icon when you display your welcome page ...

使用的图片是我的图片,当您显示欢迎页面时它会作为标签图标...

It is odd that title and image do not have default values ... but heh ... that is life.

奇怪的是标题和图像没有默认值......但是......那就是生命。

Hope it'll help ^^

希望它能帮助^^

#1


Do you need to define a new id, or do you just want a minimal config that will show only your content?

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

If it is the latter, have you seen the later section of the same help? Defining a minimal intro configuration, suggests using org.eclipse.intro.minimal so it will show just your content.

如果是后者,您是否看过同一帮助的后一部分?定义最小的介绍配置,建议使用org.eclipse.intro.minimal,以便它只显示您的内容。

#2


Here is what I finally did ...

这是我最终做的......

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;
    }
}

The picture used is one of mine and it goes as the tab icon when you display your welcome page ...

使用的图片是我的图片,当您显示欢迎页面时它会作为标签图标...

It is odd that title and image do not have default values ... but heh ... that is life.

奇怪的是标题和图像没有默认值......但是......那就是生命。

Hope it'll help ^^

希望它能帮助^^