独自の Eclipse イントロ ページを作成するのに苦労しています (ここに示すように)。
製品 ID に問題があるようですが、製品 ID を取得する方法がわかりません。何に答えるべきか、それは問題の一部のようです...誰かアイデアはありますか?
これが私が最終的にやったことです...
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;
}
}
使用されている画像は私のもので、ウェルカム ページを表示するときにタブ アイコンとして使用されます...
title と image にデフォルト値がないのは奇妙です...しかし、へー...それが人生です。
それが役立つことを願っています^^
新しい ID を定義する必要がありますか?それとも、コンテンツのみを表示する最小限の構成が必要ですか?
後者の場合、同じヘルプの後のセクションを見ましたか? 最小限のイントロ構成を定義すると、コンテンツのみが表示されるように org.eclipse.intro.minimal を使用することが提案されます。