adding the project explorer to a perspective [message #677359] |
Wed, 08 June 2011 05:43  |
Eclipse User |
|
|
|
Hi there,
I added to a perspective the model explorer using :
myFolderLayout.addView(IPageLayout.ID_PROJECT_EXPLORER);
project explorer is correctly displayed but seems "dirty" : I don't see my projects in the workspace.
If I right click in the project explorer (just right click, I don't select "refresh" entry in the context menu), model explorer will be refreshed.
How can I refresh it automatically ?
I tried this :
IViewReference[] viewReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences();
for (IViewReference viewRef : viewReferences)
{
if (viewRef.getId().compareTo(IPageLayout.ID_PROJECT_EXPLORER) == 0)
{
System.out.println("Wake up !");
ProjectExplorer projectExplorer = (ProjectExplorer)(viewRef.getView(true));
System.out.println (projectExplorer.isDirty()); // return false
projectExplorer.getCommonViewer().refresh();
projectExplorer.getCommonViewer().expandAll();
}
}
It doesn't work, nothing happens.
Does anyone have an idea to solve this problem ?
Best regards,
--
Nicolas
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08244 seconds