Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Using IResource in RCp
Using IResource in RCp [message #434683] Fri, 05 August 2005 00:52 Go to next message
Charles H Martin is currently offline Charles H MartinFriend
Messages: 79
Registered: July 2009
Member
I have some basic questions about general RCP design
and the use of the Workspace and Resource notification
facilities in Eclipse

Please forgive me if this is the wrong forumn to ask these questions...

One can imagine a resource editor, such as an XML
editor, where the XML is presented in a Tree on the
left hand side, and as text on the right hand side.

More generally, one can imagine viewing and editing
any kind of data structure which has a natural (or almost)
natural view as a tree, and represent them in the
Eclipse framework as a tree in some kind of choose.

So I have few questions about some basic design issues.

(1) The Eclipse Resource framework seems to want to work
with general tree-like data structures, as opposed to,
say a Directed Acyclic Graph (DAG). Are there cases
where Eclipse is bring used to edit DAGs?

(2) Suppose one has a data structure to work with, maybe
an XML file, maybe some generic or specific composition of
objects, but these objects do not necessarily map to resources
like IFile, IFolder, or IProject

Is the general approach to associate your data structures with the
IProject/IFolder/IFile types? Or is it more accepted to use the
IContainer as a handle, and use the Resource notification mechanism

(3) Or is it just more common to ignore IResource, IResourceDelta,
etc, and simply use your own specific Events and your own EventListenerList
mechanism (like Swing uses?) . That is, create your own application
"Context" with some EventListenerList, and your own mechanism
for managing EventChanged, EventChangedDelta, etc?

Does anyone have any detailed examples and/or ideas on this?
I am, in particular, interested in examples that are outside
the scope of what are considered traditional IDE applications,
such as a News Reader (i.e: how do you think you would implement
RSSOwl, BitTorrent, or some other familiar applications as a Eclipse
3.1 RCP Plugin, using the RCP framework )
Re: Using IResource in RCp [message #434800 is a reply to message #434683] Fri, 05 August 2005 09:03 Go to previous messageGo to next message
Neil Greenwood is currently offline Neil GreenwoodFriend
Messages: 2
Registered: July 2009
Junior Member
Charles Martin wrote:
> I have some basic questions about general RCP design
> and the use of the Workspace and Resource notification facilities in
> Eclipse
>
> Please forgive me if this is the wrong forumn to ask these questions...
>
> One can imagine a resource editor, such as an XML
> editor, where the XML is presented in a Tree on the
> left hand side, and as text on the right hand side.
>
> More generally, one can imagine viewing and editing any kind of data
> structure which has a natural (or almost)
> natural view as a tree, and represent them in the
> Eclipse framework as a tree in some kind of choose.
>
> So I have few questions about some basic design issues.
>
> (1) The Eclipse Resource framework seems to want to work
> with general tree-like data structures, as opposed to,
> say a Directed Acyclic Graph (DAG). Are there cases where Eclipse is
> bring used to edit DAGs?
>
> (2) Suppose one has a data structure to work with, maybe
> an XML file, maybe some generic or specific composition of
> objects, but these objects do not necessarily map to resources
> like IFile, IFolder, or IProject
>
> Is the general approach to associate your data structures with the
> IProject/IFolder/IFile types? Or is it more accepted to use the
> IContainer as a handle, and use the Resource notification mechanism
>
> (3) Or is it just more common to ignore IResource, IResourceDelta,
> etc, and simply use your own specific Events and your own EventListenerList
> mechanism (like Swing uses?) . That is, create your own application
> "Context" with some EventListenerList, and your own mechanism
> for managing EventChanged, EventChangedDelta, etc?
>
> Does anyone have any detailed examples and/or ideas on this?
> I am, in particular, interested in examples that are outside
> the scope of what are considered traditional IDE applications, such as a
> News Reader (i.e: how do you think you would implement RSSOwl,
> BitTorrent, or some other familiar applications as a Eclipse
> 3.1 RCP Plugin, using the RCP framework )
>

I think you'll find that both RSSOwl and Azureus (a
BitTorrent client) are RCP applications. Have a look at
their source code...

Cheers,
Neil.
neil.greenwood.lists AT gmail DOT com
Re: Using IResource in RCp [message #434801 is a reply to message #434683] Fri, 05 August 2005 09:37 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
Charles Martin wrote:
> I have some basic questions about general RCP design
> and the use of the Workspace and Resource notification facilities in
> Eclipse
>
> Please forgive me if this is the wrong forumn to ask these questions...
>
> One can imagine a resource editor, such as an XML
> editor, where the XML is presented in a Tree on the
> left hand side, and as text on the right hand side.
>
> More generally, one can imagine viewing and editing any kind of data
> structure which has a natural (or almost)
> natural view as a tree, and represent them in the
> Eclipse framework as a tree in some kind of choose.
>
> So I have few questions about some basic design issues.
>
> (1) The Eclipse Resource framework seems to want to work
> with general tree-like data structures, as opposed to,
> say a Directed Acyclic Graph (DAG). Are there cases where Eclipse is
> bring used to edit DAGs?
>
> (2) Suppose one has a data structure to work with, maybe
> an XML file, maybe some generic or specific composition of
> objects, but these objects do not necessarily map to resources
> like IFile, IFolder, or IProject
>
> Is the general approach to associate your data structures with the
> IProject/IFolder/IFile types? Or is it more accepted to use the
> IContainer as a handle, and use the Resource notification mechanism
>
> (3) Or is it just more common to ignore IResource, IResourceDelta,
> etc, and simply use your own specific Events and your own EventListenerList
> mechanism (like Swing uses?) . That is, create your own application
> "Context" with some EventListenerList, and your own mechanism
> for managing EventChanged, EventChangedDelta, etc?
>
> Does anyone have any detailed examples and/or ideas on this?
> I am, in particular, interested in examples that are outside
> the scope of what are considered traditional IDE applications, such as a
> News Reader (i.e: how do you think you would implement RSSOwl,
> BitTorrent, or some other familiar applications as a Eclipse
> 3.1 RCP Plugin, using the RCP framework )
>
>
>
>
>
The navigator you are referring to is part of the JDT (Java Plugin to
RCP) and provides therefor a resource navigator that is most compliant
to resources on the filesystem. For your own RCP you would provide a
navigator which is most adapted to your data needs.
So it is up to you to use what ever you see fit!

Regards
Stefan
Re: Using IResource in RCp [message #434818 is a reply to message #434801] Fri, 05 August 2005 21:32 Go to previous messageGo to next message
Charles H Martin is currently offline Charles H MartinFriend
Messages: 79
Registered: July 2009
Member
Thanks for the feedback

I guess I was wondering to what extent the IResource paradigm
is useful outside of a traditional editor

I am continuing to read the source code you suggested

Charles
Re: Using IResource in RCp [message #434823 is a reply to message #434801] Fri, 05 August 2005 22:03 Go to previous messageGo to next message
Morten Moeller is currently offline Morten MoellerFriend
Messages: 4
Registered: July 2009
Junior Member
> The navigator you are referring to is part of the JDT (Java Plugin to
> RCP) and provides therefor a resource navigator that is most compliant
> to resources on the filesystem. For your own RCP you would provide a
> navigator which is most adapted to your data needs.
> So it is up to you to use what ever you see fit!
>
> Regards
> Stefan

Actually resources are a part of Platform and not JDT (like the whole
org.eclipse.core.resource* are). You can use it in RCP applications without
including any Java IDE parts (or even use Eclipse platform as a base).

There are plans it seems in 3.2 to unmarry the Eclipse IResource from files,
which will enable you to do some of the things you mention (look at bug
37723 and 106176). This would make the eclipse platform resource framework
more usable for RCP applications.


Stefan Langer wrote:

> Charles Martin wrote:
>> I have some basic questions about general RCP design
>> and the use of the Workspace and Resource notification facilities in
>> Eclipse
>>
>> Please forgive me if this is the wrong forumn to ask these questions...
>>
>> One can imagine a resource editor, such as an XML
>> editor, where the XML is presented in a Tree on the
>> left hand side, and as text on the right hand side.
>>
>> More generally, one can imagine viewing and editing any kind of data
>> structure which has a natural (or almost)
>> natural view as a tree, and represent them in the
>> Eclipse framework as a tree in some kind of choose.
>>
>> So I have few questions about some basic design issues.
>>
>> (1) The Eclipse Resource framework seems to want to work
>> with general tree-like data structures, as opposed to,
>> say a Directed Acyclic Graph (DAG). Are there cases where Eclipse is
>> bring used to edit DAGs?
>>
>> (2) Suppose one has a data structure to work with, maybe
>> an XML file, maybe some generic or specific composition of
>> objects, but these objects do not necessarily map to resources
>> like IFile, IFolder, or IProject
>>
>> Is the general approach to associate your data structures with the
>> IProject/IFolder/IFile types? Or is it more accepted to use the
>> IContainer as a handle, and use the Resource notification mechanism
>>
>> (3) Or is it just more common to ignore IResource, IResourceDelta,
>> etc, and simply use your own specific Events and your own
>> EventListenerList
>> mechanism (like Swing uses?) . That is, create your own application
>> "Context" with some EventListenerList, and your own mechanism
>> for managing EventChanged, EventChangedDelta, etc?
>>
>> Does anyone have any detailed examples and/or ideas on this?
>> I am, in particular, interested in examples that are outside
>> the scope of what are considered traditional IDE applications, such as a
>> News Reader (i.e: how do you think you would implement RSSOwl,
>> BitTorrent, or some other familiar applications as a Eclipse
>> 3.1 RCP Plugin, using the RCP framework )
>>
>>
>>
>>
>>
Re: Using IResource in RCp [message #434825 is a reply to message #434823] Sat, 06 August 2005 00:06 Go to previous messageGo to next message
Charles H Martin is currently offline Charles H MartinFriend
Messages: 79
Registered: July 2009
Member
Stefan

Thanks for the reference.

Eclipse sells itself as a general purpose platform, and I am
trying to explore just how farthis paradigm holds

Some other questions, if you don't mind. Again, forgive me
for not really knowing yet how to navigate the full Eclipse
knowledge space and newsgroups.

(1) It seems to me that even if one has a true file, can one
associate items to the components of a file (such as the
components in the outline view) , and not just the lines.
Now one can associate a Bookmark or a Task in an IFile at a specific
line "location". Can one likewise describe an XML file
as having "locations" which are specific Tags, and not necessarily
only specific line numbers. That is, could I add a Bookmark to
an XML tag in an XML file. Or can we add a Bookmark to a specific method
declaration in a java file ? I am also asking because the Bookmark column
header says location, which suggests that any (path-like or other)
location will do.

(2) Is there any plan to associate a File Fragment with a Resource?
For example, one can imagine a file as consisting of a list
of strings, XML fragments, etc (such as SQL queries),
and the fragments ( queries ) themselves might represent Resources.
We might want to display these resources in a tree or list view,
drag and drop them, etc. My current RCP does something like
this, but I don't use any of the IResource components...I just
have my own specific events, listeners, notifications, etc.


Any pointers on where to go would also be appreciated.

Charles
Re: Using IResource in RCp [message #434828 is a reply to message #434823] Sat, 06 August 2005 00:15 Go to previous messageGo to next message
Charles H Martin is currently offline Charles H MartinFriend
Messages: 79
Registered: July 2009
Member
I'll check the Bugzilla notes...these seem to be very descriptive
on this issue...thanks
Re: Using IResource in RCp [message #437539 is a reply to message #434683] Thu, 29 September 2005 20:29 Go to previous messageGo to next message
JavaJ Missing name is currently offline JavaJ Missing nameFriend
Messages: 45
Registered: July 2009
Member
Are you an expert on this subject now? I have lots of questions for you and was wondering if you’d help me out a little. Please respond to this post so I know you’re available to help.
Re: Using IResource in RCp [message #437620 is a reply to message #434800] Fri, 30 September 2005 07:56 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
RSSOwl and Azureus aren't RCP applications. They are Java applications that use SWT (and JFace, I believe). They don't, for example, deal with the plugin framework which is core to Eclipse (and therefore, don't have many of the org.eclipse.core.* classes used).

I'm working on an Eclipse RCP News reader as a way of showing off what Eclipse RCP can be used for (other than IDE applciations) with the goal of spawning off several types of non-IDE application. It's not ready for prime-time yet, but if you're interested you can find out more at the website http://www.rcpapps.org or follow the blog http://rcpapps.blogspot.com
Re: Using IResource in RCP [message #437621 is a reply to message #434825] Fri, 30 September 2005 08:13 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
The things associated with a linke are called Markers. There's a good article (if based on a slightly older version of Eclipse) at:

http://www.eclipse.org/articles/Article-Mark%20My%20Words/Ma rk%20My%20Words.html

Markers don't have to be associated with a line; they can also be associated with start/end regions. There are a number of standard attributes that you can set:

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/core/resources/IM arker.html

but you can also add your own attributes to a marker as well (think of it like a Map, but with pre-defined entries like LINE_NUMBER and PRIORITY that you can use).

Note that Markers are associated with a Resource, which implicitly has a location in the workspace. So you can't associate a marker with an external file without making it visible in the Eclipse workspace first (e.g. by linking or copying).

As for the file fragments, at present, the concept of an IResource is more strongly linked with IFile and IProject than is currently desirable; but there are enhancement requests (see the bug numbers above) to seperate out the two. As and when this happens, it should be possible to relate multiple Resources with the same File (e.g. for entries directly inside a Zip archive) but right now, it's not possible.
Previous Topic:Toolbar GroupMarker problem
Next Topic:Adding Views and Perspectives dynamically
Goto Forum:
  


Current Time: Sun Dec 08 22:08:11 GMT 2024

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

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

Back to the top