2014-01-30 76 views
2

在很多stackoverflow成员的帮助下,我终于完成了我的第一个RCP应用程序。在eclipse rcp应用程序中没有显示项目资源管理器

我面对我的工程资源管理器

  1. Project Explorer中的一些问题,当我打开我的RCP应用程序似乎不活动(排序醒来时,我右键单击我的空项目资源管理器窗口上)
  2. 即使打开,它也不会显示项目探索选项。我的意思是它只是表明我的项目,并没有其他的名字(里面没有文件显示)

Pic:

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); 
    } 
} 

我已将oeui.navigatoroeui.navigator.resources添加到相关性列表

+0

是否Eclipse工作区了解文件?如果您在RCP中具有该文件,或者调用'IProject.refreshLocal'以编程方式更新项目,请尝试'File> Refresh'。 –

回答

0

对于初始空视图,你需要重写getDefaultPageInput在WorkbenchAdvisor类的RCP定义插件,像这样:

@Override 
public IAdaptable getDefaultPageInput() { 
    return ResourcesPlugin.getWorkspace().getRoot(); 
} 
相关问题