我正面臨着難以製作自己的Eclipse介紹頁面(as shown here)。製作我自己的Eclipse介紹頁面
看來我的產品ID有些問題,但我不知道如何獲得產品ID,我試圖擴展org.eclipse.core.runtime.products,但是當它詢問我想要哪個應用程序時註冊我不知道該怎麼回答,這似乎是問題的一部分......任何人都有任何想法?
我正面臨着難以製作自己的Eclipse介紹頁面(as shown here)。製作我自己的Eclipse介紹頁面
看來我的產品ID有些問題,但我不知道如何獲得產品ID,我試圖擴展org.eclipse.core.runtime.products,但是當它詢問我想要哪個應用程序時註冊我不知道該怎麼回答,這似乎是問題的一部分......任何人都有任何想法?
您是否需要定義一個新的ID,或者您只需要一個只顯示您的內容的最小配置?
如果是後者,你有沒有看到相同幫助的後面部分? Defining a minimal intro configuration,建議使用org.eclipse.intro.minimal,以便它只顯示你的內容。
這是我終於做到了......
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;
}
}
使用的圖片是我的一個和它去,當您顯示歡迎頁面的標籤圖標...
奇怪的是該標題和圖像沒有默認值......但是......這就是生活。
希望對大家有所幫助^^
沒有,其實我真的需要有同樣的介紹頁面,在我的例子中所描述的(作爲起點)... 您的例子是好的,但它是爲HTML製作的介紹頁面,我需要它SWT製作。 – Ar3s 2009-07-13 09:33:23
抱歉,我不清楚問題出在哪裏,你能否修改你的問題以包含你遇到的問題? – 2009-07-13 12:03:57