我在制作自己的 Eclipse 介绍页面时遇到困难(如图所示 http://help.eclipse.org/help33/topic/org.eclipse.platform.doc.isv/guide/ua_intro_hello_world.htm).
我的产品 ID 似乎有一些问题,但我不知道如何获取产品 ID,我尝试扩展 org.eclipse.core.runtime.products,但当它询问我要注册哪个应用程序时,我不知道该回答什么,这似乎是问题的一部分......有人有任何想法吗?
这就是我最终所做的......
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;
}
}
使用的图片是我的一张,当您显示欢迎页面时,它会作为选项卡图标......
奇怪的是标题和图像没有默认值......但是嘿......这就是生活。
希望它会有所帮助^^
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)