views:

644

answers:

2

Hello everyone.

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

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 ?

+1  A: 

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

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.

Rich Seller
No in fact i really need to have the same intro page as the one described in my example (as a starting point) ...You example is good but it is for HTML-made intro page I need it SWT made.
Ar3s
Sorry I'm not clear what the problem is then, can you amend your question to include the configuration you're having trouble with?
Rich Seller
I exactly wanted to have the examlpe shown in my link but I managed to make it work when I decided to override all the methods of the class. The fact is that in the eclipse doc they did not specify it so I only coded what thay told ... I am a bit stupid sometimes but the eclipse documentation is a bit badly made ...
Ar3s
@Ar3s, could you post your changes as an answer? If you got it to work it would be useful for anyone else with the same problem
Rich Seller
+1  A: 

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 ^^

Ar3s