Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Error Marking and Content Assistance
Error Marking and Content Assistance [message #464215] Tue, 27 February 2007 14:03 Go to next message
Eclipse UserFriend
I am developing an XML editor in RCP. I started with RCP Text Editor
Example. I also went thru an excellent example at
http://www.realsolve.co.uk/site/tech/jface-text.php, which shows how to
enhance XML editor but uses ide plugins. I am trying to do the same in
RCP, but not able to get the Error Marking and Content Assistance work.
Error Marking uses IFile concept(which only works for workspace files).
Can anyone let me know how can error marking and content assistance be
incorparated onto the exisiting RCP Text Editor Example?
MasterDetailsBlock and so on: How to use it [message #464217 is a reply to message #464215] Tue, 27 February 2007 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi

I want to use the Form API for my application and I read something about
a pattern called MasterDetailsBlock/-Page. I am using a FormEditor with
several pages. I also read that it is a good idea to create kind of a
framework which automatically sets the page to dirty and notifies listeners.

Can someone explain this to me somehow?

Best regards
-- Marc
Re: MasterDetailsBlock and so on: How to use it [message #464219 is a reply to message #464217] Tue, 27 February 2007 15:27 Go to previous messageGo to next message
Eclipse UserFriend
The article at
http://www.eclipse.org/articles/Article-Forms/article.html contains an
overview of MasterDetailsBlock



> Hi
>
> I want to use the Form API for my application and I read something about
> a pattern called MasterDetailsBlock/-Page. I am using a FormEditor with
> several pages. I also read that it is a good idea to create kind of a
> framework which automatically sets the page to dirty and notifies listeners.
>
> Can someone explain this to me somehow?
>
> Best regards
> -- Marc
Re: Error Marking and Content Assistance [message #464240 is a reply to message #464215] Wed, 28 February 2007 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Anil wrote:

> I am developing an XML editor in RCP. I started with RCP Text Editor
> Example. I also went thru an excellent example at
> http://www.realsolve.co.uk/site/tech/jface-text.php, which shows how
> to enhance XML editor but uses ide plugins. I am trying to do the same
> in RCP, but not able to get the Error Marking and Content Assistance
> work. Error Marking uses IFile concept(which only works for workspace
> files). Can anyone let me know how can error marking and content
> assistance be incorparated onto the exisiting RCP Text Editor Example?

Would those errors only be transient i.e. computed each time you open
the editor? Content assist should not be a problem - what's not working
for you?

Dani
Re: Error Marking and Content Assistance [message #464252 is a reply to message #464240] Wed, 28 February 2007 17:04 Go to previous messageGo to next message
Eclipse UserFriend
It would be nice if the error is computed each time the editor is opened
with an xml file, and when the xml file is saved after modification.
Content Assist : Is there an example as to how to implement this in RCP?
Re: Error Marking and Content Assistance [message #464267 is a reply to message #464252] Thu, 01 March 2007 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Anil wrote:

> It would be nice if the error is computed each time the editor is
> opened with an xml file, and when the xml file is saved after
> modification.
> Content Assist : Is there an example as to how to implement this in RCP?

You can take a look at one of the Platform Text tutorials:
http://www.eclipse.org/eclipse/platform-text/development/dev .php

Dani
Re: MasterDetailsBlock and so on: How to use it [message #464287 is a reply to message #464219] Thu, 01 March 2007 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, I read this article already before but the part about this
pattern is quite short and I still don't get it.

What is the block responsible for and where do the details come into
play? I heard that it is a good idea to create a framework
(AbstractMasterDetailsBlock) to save some work in other projects...but I
don't know how.

Thanks again

Steve Blass schrieb:
> The article at
> http://www.eclipse.org/articles/Article-Forms/article.html contains an
> overview of MasterDetailsBlock
Re: MasterDetailsBlock and so on: How to use it [message #464305 is a reply to message #464287] Thu, 01 March 2007 18:46 Go to previous messageGo to next message
Eclipse UserFriend
comments follow in line...

Marc Schlegel wrote:
> Thanks, I read this article already before but the part about this
> pattern is quite short and I still don't get it.

I struggled with that too.

>
> What is the block responsible for and where do the details come into
> play?

The MasterDetailsBlock sets up the sash form that displays the master
part on the left and the details part on the right for you along with
some useful plumbing. The details come into play when a selection
change occurs in the Master part you create in the createMasterPart
method you implement when you extend MasterDetailsBlock. For example
you can put a tree viewer in the master part and add a selection
listener that calls the fireSelectionChanged method on the ManagedForm
that was input as a parameter to the createMasterPart method. The
fireSelectionChanged method is part of the provided plumbing and looks
to see what details page to show based on what you defined in the
registerPages method you created in the class you extended from
MasterDetailsBlock. The tutorial has a registerPages method that looks like

protected
void registerPages(DetailsPart detailsPart) {
detailsPart.registerPage(Object.class, new ObjectDetailsPage());
detailsPart.registerPage(TypeTwo.class, new TypeTwoDetailsPage());
}

and the tutorial talks briefly about using a DetailsPageProvider instead
of registering pages for every object. When I use that the
registerPages method looks like this

protected
void registerPages(DetailsPart detailsPart) {
detailsPart.setPageProvider(myDetailsPageProvider);
}

Without much documentation you can still declare that your class
implements IDetailsPageProvider and let quick fix guide the way to which
methods you need to implement, getPageKey(Object object) and
getPage(Object key). You can simply return the object from getPageKey
for starters. getPage is where the details page actually gets called up
for display. Like so maybe
public IDetailsPage getPage(Object key) {
return new ObjectDetailsPage(key,ourEditor);
}

This is where you get to build a form to display information about the
object selected back in the master part. You can declare that your
detailspage class implements IDetailsPage and let quick fix guide your
hand. You will need to implement a createContents method to build your
details form.


> I heard that it is a good idea to create a framework
> (AbstractMasterDetailsBlock) to save some work in other projects...but I
> don't know how.

I don't know what that is. When I look up AbstractMasterDetailsBlock I
see some posts on EclipseZone about something somebody was building for
their own editor but nothing in the Eclipse help or documentation about it.



>
> Thanks again
>
> Steve Blass schrieb:
>> The article at
>> http://www.eclipse.org/articles/Article-Forms/article.html contains an
>> overview of MasterDetailsBlock
Re: Error Marking and Content Assistance [message #464309 is a reply to message #464267] Thu, 01 March 2007 19:25 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Daniel. What i understand is that error marking for a xml file
opened from outside the workspace is still not possible. is that correct?
That can only be done with IFile which applies for files opened from
within the workspace.
Re: Error Marking and Content Assistance [message #464330 is a reply to message #464309] Fri, 02 March 2007 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Anil wrote:

> Thanks Daniel. What i understand is that error marking for a xml file
> opened from outside the workspace is still not possible. is that
> correct? That can only be done with IFile which applies for files
> opened from within the workspace.

It is possible: you can write an editor that opens an external file and
then generate the error annotations.

Dani
Re: MasterDetailsBlock and so on: How to use it [message #464419 is a reply to message #464305] Sat, 03 March 2007 07:02 Go to previous message
Eclipse UserFriend
Thank you very much for this great explanation

Now I got it :-)

Steve Blass schrieb:
> comments follow in line...
>
> Marc Schlegel wrote:
>> Thanks, I read this article already before but the part about this
>> pattern is quite short and I still don't get it.
>
> I struggled with that too.
>
>>
>> What is the block responsible for and where do the details come into
>> play?
>
> The MasterDetailsBlock sets up the sash form that displays the master
> part on the left and the details part on the right for you along with
> some useful plumbing. The details come into play when a selection
> change occurs in the Master part you create in the createMasterPart
> method you implement when you extend MasterDetailsBlock. For example
> you can put a tree viewer in the master part and add a selection
> listener that calls the fireSelectionChanged method on the ManagedForm
> that was input as a parameter to the createMasterPart method. The
> fireSelectionChanged method is part of the provided plumbing and looks
> to see what details page to show based on what you defined in the
> registerPages method you created in the class you extended from
> MasterDetailsBlock. The tutorial has a registerPages method that looks
> like
>
> protected
> void registerPages(DetailsPart detailsPart) {
> detailsPart.registerPage(Object.class, new ObjectDetailsPage());
> detailsPart.registerPage(TypeTwo.class, new TypeTwoDetailsPage());
> }
>
> and the tutorial talks briefly about using a DetailsPageProvider instead
> of registering pages for every object. When I use that the
> registerPages method looks like this
>
> protected
> void registerPages(DetailsPart detailsPart) {
> detailsPart.setPageProvider(myDetailsPageProvider);
> }
>
> Without much documentation you can still declare that your class
> implements IDetailsPageProvider and let quick fix guide the way to which
> methods you need to implement, getPageKey(Object object) and
> getPage(Object key). You can simply return the object from getPageKey
> for starters. getPage is where the details page actually gets called up
> for display. Like so maybe
> public IDetailsPage getPage(Object key) {
> return new ObjectDetailsPage(key,ourEditor);
> }
>
> This is where you get to build a form to display information about the
> object selected back in the master part. You can declare that your
> detailspage class implements IDetailsPage and let quick fix guide your
> hand. You will need to implement a createContents method to build your
> details form.
>
>
>> I heard that it is a good idea to create a framework
>> (AbstractMasterDetailsBlock) to save some work in other projects...but I
>> don't know how.
>
> I don't know what that is. When I look up AbstractMasterDetailsBlock I
> see some posts on EclipseZone about something somebody was building for
> their own editor but nothing in the Eclipse help or documentation about it.
Previous Topic:KeyBinding
Next Topic:JFace DataBinding
Goto Forum:
  


Current Time: Fri Mar 21 20:30:17 EDT 2025

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

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

Back to the top