Telling My view to refresh after a build and get also the markers [message #661207] |
Wed, 23 March 2011 15:17 |
|
Hi All,
I have created a plugin with my view and my builder.
My builder correctly kicks in when a resource changes in the workspace, generating markers and all that stuff, the "project explorer" view correctly refreshes showing the files and the markers.
I would like to get my view to do the same.
Would you know what do I need to do to obtain that?
Thanks in advance for your help,
Giulio
|
|
|
Re: Telling My view to refresh after a build and get also the markers [message #661333 is a reply to message #661207] |
Thu, 24 March 2011 10:03 |
|
Hi Again,
I think the way to go will be to just notify my view when the build completes.
the problem now becomes obtaining the view object. Out of my book I found this snippet:
Quote: | testView = (FavoritesView)
PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage()
.showView(VIEW_ID);
|
which I exploded to (for simplicity of debugging) :
Quote: | IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow activeWorkbenchWindow = workbench
.getActiveWorkbenchWindow();
if (activeWorkbenchWindow == null) {
String cause = Display.getCurrent() == null ? "could not retrieve the display"
: "Don't know";
throw new NullPointerException(
"Could not retrieve the workbench, Cause was: " + cause);
}
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
TestCasesView result = (TestCasesView) activePage
.showView(TestCasesView.ID);
|
the result is that I always get the nullPointerException, saying that the workbench could not be retrieved because the display could not be retrieved. (that's a reason why the active workbenchpage may be returned null by the getActiveWorkbenchWindow method.
Any clue on how that works?
Wandering around for solutions I found the Common Navigator Framework (CNF) but I couldn't understand if that would solve my problem of refreshing after the build. Could someone shed some light please?
thanks,
Giulio
|
|
|
Powered by
FUDForum. Page generated in 0.03266 seconds