How to incorporate Eclipse 'problems' view into an RCP application [message #449616] |
Tue, 16 May 2006 17:38  |
Eclipse User |
|
|
|
Originally posted by: rjohnson.mincron.com
Does anyone have experience incorporating the standard Eclipse 'Problems' view into an RCP application? In this way, validation errors from business logic could be displayed in the problems view. And the problems list could be filterable, to relate to specific forms.
The problems view does not appear to be a standard JFace component, but I was hoping to leverage that logic in an RCP application.
|
|
|
Re: How to incorporate Eclipse 'problems' view into an RCP application [message #449628 is a reply to message #449616] |
Wed, 17 May 2006 03:31   |
Eclipse User |
|
|
|
Originally posted by: Stephen.Egan.csiro.au
Hi,
You can't (or at least shouldn't) access the problem view directly. The=
=
trick is to use the IMarker interface. Here's an example snippet:
private IMarker createMarker(IResource aResource, String aMessage, =
Element element) {
try {
IMarker marker =3D aResource.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
marker.setAttribute(IMarker.MESSAGE, aMessage);
=
if (element !=3D null)
if (!element.getGuid().equals(""))
marker.setAttribute("GUID", element.getGuid());
}
catch (CoreException ce) {
logger.warning("Marker not created for " + aResource.getName()
+ " - " + ce.getMessage());
}
return null;
}
The "GUID" attribute shows how you can assign arbitrary attributes to th=
e =
marker that are relevant to your own application.
You can then display the problem view using a line similar to this:
=
page.showView(IPageLayout.ID_PROBLEM_VIEW);
where page is an IWorkbenchPage.
Hope this helps,
//Stephen
On Wed, 17 May 2006 07:38:09 +1000, Randy Johnson <rjohnson@mincron.com>=
=
wrote:
> Does anyone have experience incorporating the standard Eclipse =
> 'Problems' view into an RCP application? In this way, validation error=
s =
> from business logic could be displayed in the problems view. And the =
> problems list could be filterable, to relate to specific forms.
>
> The problems view does not appear to be a standard JFace component, bu=
t =
> I was hoping to leverage that logic in an RCP application.
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
|
Re: How to incorporate Eclipse 'problems' view into an RCP application [message #449695 is a reply to message #449688] |
Wed, 17 May 2006 20:47   |
Eclipse User |
|
|
|
Originally posted by: Stephen.Egan.csiro.au
You will need to include the org.eclipse.core.resources plugin in your =
dependencies to access the IMarker interface, and the org.eclipse.ui.ide=
=
plugin to add the Problem View. Besides that, you can open up the Probl=
em =
view programmatically using the constant IPageLayout.ID_PROBLEM_VIEW as =
=
mentioned in the last post, or through the Window>Show View menu (assumi=
ng =
that you have that menu in your application).
//Stephen
On Thu, 18 May 2006 06:25:20 +1000, Randy Johnson <rjohnson@mincron.com>=
=
wrote:
> Thanks for the info! Of course, this prompts another question. Using =
> RCP, must I create a view and register it with the platform? If I just=
=
> try to to show the problems view, RCP tells me the view is not found, =
=
> implying that I needed to create it via extensions first.
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
|
|
Re: How to incorporate Eclipse 'problems' view into an RCP application [message #449776 is a reply to message #449704] |
Fri, 19 May 2006 01:19  |
Eclipse User |
|
|
|
Originally posted by: Stephen.Egan.csiro.au
Or alternatively click the "Synchronize" link under the "testing" sectio=
n =
of you .product file's "Overview" page (assuming that you have defined a=
=
product). You'll also need to ensure that all required plugins are in t=
he =
..product's configuration list first.
//Stephen
> This normally happens if you've launched your RCP app once, and then a=
dd =
> dependencies to one of the plugins. You need to go to the Run>Run... =
=
> menu, find your launch config, and make sure all of the new plugins ar=
e =
> included.
>
> Later,
> PW
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
|
|
Powered by
FUDForum. Page generated in 0.27179 seconds