【发布时间】:2014-02-22 23:42:40
【问题描述】:
在 stackoverflow 的许多成员的帮助下,我终于完成了我的第一个 RCP 应用程序。
我的 Project Explorer 遇到了一些问题
- 当我打开我的 RCP 应用程序时,项目资源管理器似乎没有处于活动状态(当我右键单击我的空项目资源管理器窗口时会唤醒)
- 即使它打开,它也不会显示项目探索选项。我的意思是它只显示了项目的名称,没有其他内容(没有显示其中的文件)
我的 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 添加到依赖列表中
【问题讨论】:
-
Eclipse 工作区是否知道这些文件?如果您的 RCP 中有
File > Refresh,请尝试IProject.refreshLocal以编程方式更新项目。
标签: java eclipse eclipse-rcp rcp perspective