Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Empty projects in my RCP app but not in plugin-version
Empty projects in my RCP app but not in plugin-version [message #1073974] Thu, 25 July 2013 21:50 Go to next message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
I built a little tool to allow me to validate and edit EPUB files
(eBooks). I wrote it originally as a plugin to the workbench . It
takes a path to an EPUB file (a zip archive), unpacks it and shows the
unpacked archive in the Project Explorer as its own type of project. It
also validates the doc (using a tool called EPUBCheck), reports the
errors in the problem console, etc. etc. It's packaged as its own
perspective.

But having to use a plugin in Eclipse is a little heavy handed for some
folks I work with so I thought I would convert it to an RCP app
(version 3.x type, not e4). I hadn't created an RCP app before (except
for a brain dead hello world tutorial). After some experimenting and
crashing about I got it working (more or less). It creates new
projects, unpacks, rebuilds, validates, reports problems, etc. EXCEPT
that the names of the projects are shown in the Project Explorer, but
the projects are empty. The project's properties point to the right
place and the resources are there, it's just that Project Explorer
either doesn't see them or won't display them. Tried turning off all
the filters (even thoug the plugin didn't need that) but no help.

Virtually all the code in the RCP is identical with the plugin version
except the Workbench advisor pieces and the associated parts of the
plugin.xml. At this point I am kind of stumped. Does this ring a bell
with anyone or can anyone suggest how to debug this?

TIA, Ric

(BTW, the plugin version can be found on github as
https://github.com/rkwright/epubcrude if anyone is curious.)
Re: Empty projects in my RCP app but not in plugin-version [message #1073979 is a reply to message #1073974] Thu, 25 July 2013 22:01 Go to previous messageGo to next message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
On 2013-07-25 21:50:49 +0000, Ric Wright said:

> I built a little tool to allow me to validate and edit EPUB files
> (eBooks). I wrote it originally as a plugin to the workbench . It
> takes a path to an EPUB file (a zip archive), unpacks it and shows the
> unpacked archive in the Project Explorer as its own type of project. It
> also validates the doc (using a tool called EPUBCheck), reports the
> errors in the problem console, etc. etc. It's packaged as its own
> perspective.
>
> But having to use a plugin in Eclipse is a little heavy handed for some
> folks I work with so I thought I would convert it to an RCP app
> (version 3.x type, not e4). I hadn't created an RCP app before (except
> for a brain dead hello world tutorial). After some experimenting and
> crashing about I got it working (more or less). It creates new
> projects, unpacks, rebuilds, validates, reports problems, etc. EXCEPT
> that the names of the projects are shown in the Project Explorer, but
> the projects are empty. The project's properties point to the right
> place and the resources are there, it's just that Project Explorer
> either doesn't see them or won't display them. Tried turning off all
> the filters (even thoug the plugin didn't need that) but no help.
>
> Virtually all the code in the RCP is identical with the plugin version
> except the Workbench advisor pieces and the associated parts of the
> plugin.xml. At this point I am kind of stumped. Does this ring a bell
> with anyone or can anyone suggest how to debug this?
>
> TIA, Ric
>
> (BTW, the plugin version can be found on github as
> https://github.com/rkwright/epubcrude if anyone is curious.)

I should have added that I get no errors, no exceptions. It all seems
to work except the Project Explorer projects are empty. After the
project is built I call project.refreshLocal() and I just walked
through it and it LOOKS like it was fine but nothing in the project.

Ric
Resolved (known bug) Re: Empty projects in my RCP app but not in plugin-version [message #1074399 is a reply to message #1073979] Fri, 26 July 2013 17:07 Go to previous message
Ric Wright is currently offline Ric WrightFriend
Messages: 70
Registered: July 2009
Member
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1187.39">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 14.0px Verdana}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 15.0px; font: 14.0px Verdana; min-height: 17.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 12.0px; line-height: 17.0px; font: 14.0px Verdana; color: #011892}
p.p4 {margin: 0.0px 0.0px 0.0px 12.0px; line-height: 17.0px; font: 14.0px Verdana; color: #011892; min-height: 17.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 24.0px; font: 14.0px Verdana; color: #008e00}
p.p6 {margin: 0.0px 0.0px 0.0px 24.0px; font: 14.0px Verdana; color: #008e00; min-height: 17.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 12.0px; font: 14.0px Verdana; color: #011892; min-height: 17.0px}
p.p8 {margin: 0.0px 0.0px 0.0px 12.0px; font: 14.0px Verdana; color: #011892}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Verdana; color: #000000; min-height: 17.0px}
p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Verdana; color: #000000}
p.p11 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Verdana; min-height: 17.0px}
p.p12 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Verdana}
p.p13 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 14.0px Verdana}
p.p14 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 14.0px Verdana; min-height: 17.0px}
p.p15 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times}
p.p16 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier}
p.p17 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px}
span.s1 {text-decoration: underline ; color: #0000ee}
</style>
</head>
<body>
<p class="p1">On 2013-07-25 22:01:33 +0000, Ric Wright said:</p>
<p class="p2"><br></p>
<p class="p3">On 2013-07-25 21:50:49 +0000, Ric Wright said:</p>
<p class="p4"><br></p>
<p class="p5">I built a little tool to allow me to validate and edit EPUB files (eBooks).<span class="Apple-converted-space">  </span>I wrote it originally as a plugin to the workbench .<span class="Apple-converted-space">  </span>It takes a path to an EPUB file (a zip archive), unpacks it and shows the unpacked archive in the Project Explorer as its own type of project. It also validates the doc (using a tool called EPUBCheck), reports the errors in the problem console, etc. etc.<span class="Apple-converted-space">  </span>It's packaged as its own perspective.</p>
<p class="p6"><br></p>
<p class="p5">But having to use a plugin in Eclipse is a little heavy handed for some folks I work with so I thought I would convert it to an RCP app (version 3.x type, not e4). I hadn't created an RCP app before (except for a brain dead hello world tutorial).<span class="Apple-converted-space">  </span>After some experimenting and crashing about I got it working (more or less).<span class="Apple-converted-space">  </span>It creates new projects, unpacks, rebuilds, validates, reports problems, etc.<span class="Apple-converted-space">  </span>EXCEPT that the names of the projects are shown in the Project Explorer, but the projects are empty. The project's properties point to the right place and the resources are there, it's just that Project Explorer either doesn't see them or won't display them. Tried turning off all the filters (even thoug the plugin didn't need that) but no help.</p>
<p class="p6"><br></p>
<p class="p5">Virtually all the code in the RCP is identical with the plugin version except the Workbench advisor pieces and the associated parts of the plugin.xml.<span class="Apple-converted-space">  </span>At this point I am kind of stumped.<span class="Apple-converted-space">  </span>Does this ring a bell with anyone or can anyone suggest how to debug this?</p>
<p class="p6"><br></p>
<p class="p5">TIA, Ric</p>
<p class="p6"><br></p>
<p class="p5">(BTW, the plugin version can be found on github as https://github.com/rkwright/epubcrude if anyone is curious.)</p>
<p class="p7"><br></p>
<p class="p8">I should have added that I get no errors, no exceptions.<span class="Apple-converted-space">  </span>It all seems to work except the Project Explorer projects are empty.<span class="Apple-converted-space">  </span>After the project is built I call project.refreshLocal() and I just walked through it and it LOOKS like it was fine but nothing in the project.</p>
<p class="p7"><br></p>
<p class="p8">Ric</p>
<p class="p9"><br></p>
<p class="p10">So the answer turns out to be that this is</p>
<p class="p11"><br></p>
<p class="p12">- a bug in Eclipse since 3.0 (!)</p>
<p class="p13">- a missing feature ditto</p>
<p class="p13">- something Eclipse doesn't want anyone to do in an RCP app</p>
<p class="p14"><br></p>
<p class="p13">Finally stumbled on this thread:</p>
<p class="p14"><br></p>
<p class="p13">http://stackoverflow.com/questions/8277902/add-package-explorer-in-rcp-application-result-in-loosing-some-icon</p>
<p class="p14"><br></p>
<p class="p13">The solution supplied by twindham works like a charm. Of course, Eclipse whines that the resources that my app needs to decorate the tree are "not accessible".<span class="Apple-converted-space">  </span>This appears to be by design, at least in part.<span class="Apple-converted-space">  </span>See this thread:</p>
<p class="p14"><br></p>
<p class="p13">https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252</p>
<p class="p14"><br></p>
<p class="p13">which has this fragment in it:</p>
<p class="p14"><br></p>
<p class="p15">Francis Upton IV 2008-06-11 10:52:54 EDT</p>
<p class="p16">(In reply to <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252#c4"><span class="s1">comment #4</span></a>)</p>
<p class="p17"><br></p>
<p class="p16">&gt; Yes, definitely! Not all RCP apps use resources. The whole point of the RCP</p>
<p class="p16">&gt; split in 3.0 was to rid the base RCP feature of everything that smelled like</p>
<p class="p16">&gt; IDE, such as core.resources, ui.ide etc.</p>
<p class="p16">&gt;<span class="Apple-converted-space"> </span></p>
<p class="p17"><br></p>
<p class="p16">Still, since the images (loaded currently in WorkbenchImages) are defined in ui.ide, they are not going to be available to RCP apps who don't include that package in any case (unless these images are also somewhere else, but I did not see that).<span class="Apple-converted-space">  </span>So I don't think there is harm (and there is substantial benefit) to do what I propose.</p>
<p class="p17"><br></p>
<p class="p13">Note that this exchange occurred in June 2008, over 5 years and 8 minor and 1 major version of Eclipse ago.<span class="Apple-converted-space">  </span>The irony is that the problem is that Project Explorer can't find the IDE-related images so it simply doesn't draw the tree at all.<span class="Apple-converted-space">  </span>Once those images are supplied it draws the tree using all sorts of icons associated with the file types, etc. (since they aren't in the IDE anyway).<span class="Apple-converted-space">  </span>It's access to the IDE resources that is missing.<span class="Apple-converted-space">  </span>As Francis Upton suggests in the bug, either make the resources available or duplicate them in another plugin that RCP apps have access to.</p>
<p class="p14"><br></p>
<p class="p13">To my mind, almost worse is that this whole e4 framework was designed and implemented for Eclipse 4 and this problem was apparently not addressed:</p>
<p class="p14"><br></p>
<p class="p13">http://dirksmetric.wordpress.com/2012/08/01/tutorial-eclipse-rcp-e4-with-3-x-views-like-project-explorer-properties-etc/</p>
<p class="p14"><br></p>
<p class="p13">This seems very broken to me, but perhaps there is some context I am not aware of.</p>
<p class="p14"><br></p>
<p class="p13">Ric</p>
</body>
</html>
Previous Topic:Upset
Next Topic:Default main menu items in RCP app
Goto Forum:
  


Current Time: Sun Dec 21 02:48:54 GMT 2014

Powered by FUDForum. Page generated in 0.01742 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software