在stackoverflow的许多成员的帮助下,我终于完成了我的第一个RCP应用程序。
我的Project Explorer
面临一些问题我的 Perspective.java 文件如下所示
package kr;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
// Top left: Project Explorer view and Bookmarks view placeholder
IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, 0.25f,
editorArea);
topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER);
topLeft.addPlaceholder(IPageLayout.ID_BOOKMARKS);
// Bottom left: Outline view and Property Sheet view
IFolderLayout bottomLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, 0.50f,
"topLeft");
bottomLeft.addView(IPageLayout.ID_OUTLINE);
bottomLeft.addView(IPageLayout.ID_PROP_SHEET);
// Bottom right: Task List view
// layout.addView(IPageLayout.ID_TASK_LIST, IPageLayout.BOTTOM, 0.66f, editorArea);
}
}
我已将 o.e.ui.navigator 和 o.e.ui.navigator.resources 添加到依赖关系列表
答案 0 :(得分:1)
对于初始的空视图,您需要覆盖RCP定义插件的WorkbenchAdvisor类中的getDefaultPageInput
,如下所示:
@Override
public IAdaptable getDefaultPageInput() {
return ResourcesPlugin.getWorkspace().getRoot();
}