Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » javaCompletionProposalComputer
javaCompletionProposalComputer [message #243234] Fri, 27 April 2007 00:19 Go to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

I am writing a JavaCompletionProposalComputer for the Dali project that
will help the user when typing in the settings for the various JPA annotations
(e.g. provide a list of all the database table names that could be used for
an entity's @Table.name annotation element). I have a few questions:

1. In the org.eclipse.jdt.ui.javaCompletionProposalComputer extension point,
what is the 'categoryId'?

2. Also in the org.eclipse.jdt.ui.javaCompletionProposalComputer extension point,
what is a 'partition'?

3. In org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer , what is
supposed to be returned by computeContextInformation(...)?

4. Where would I find the answers to the above questions, before bothering
this forum?

Thanks.
Brian
Re: javaCompletionProposalComputer [message #243238 is a reply to message #243234] Fri, 27 April 2007 03:51 Go to previous messageGo to next message
Eclipse UserFriend
Brian Vosburgh wrote:

> I am writing a JavaCompletionProposalComputer for the Dali project that
> will help the user when typing in the settings for the various JPA
> annotations
> (e.g. provide a list of all the database table names that could be
> used for
> an entity's @Table.name annotation element). I have a few questions:

> 1. In the org.eclipse.jdt.ui.javaCompletionProposalComputer extension
> point,
> what is the 'categoryId'?

You should defined your own category and give it a name. It will then
appear on the
Java > Editor > Content Assist Advanced preference page and users can
enable or
disable your proposal computer(s).

>
> 2. Also in the org.eclipse.jdt.ui.javaCompletionProposalComputer
> extension point,
> what is a 'partition'?

Java documents are split into different partitions and each partition
has a partition
(or better: document) type, e.g. code (i.e. default), Javadoc, string etc.

>
> 3. In org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer ,
> what is
> supposed to be returned by computeContextInformation(...)?

This is the parameter hint info - I guess you need to get a bit more
familiar with code assist ;-)

>
> 4. Where would I find the answers to the above questions, before
> bothering
> this forum?

See ICompletionProposal and best is to use how it is done in JDT UI itself.

Dani

>
> Thanks.
> Brian
Re: [message #243267 is a reply to message #243238] Fri, 27 April 2007 18:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: first.last.oracle.com

Thanks, Dani. Please let me ask you a few more questions:

>> 1. In the org.eclipse.jdt.ui.javaCompletionProposalComputer extension
>> point,
>> what is the 'categoryId'?
>
> You should defined your own category and give it a name. It will then
> appear on the
> Java > Editor > Content Assist Advanced preference page and users can
> enable or
> disable your proposal computer(s).

Where is this "category" defined? How would I know about this?

>> 2. Also in the org.eclipse.jdt.ui.javaCompletionProposalComputer
>> extension point,
>> what is a 'partition'?
>
> Java documents are split into different partitions and each partition
> has a partition
> (or better: document) type, e.g. code (i.e. default), Javadoc, string etc.

I see these are "defined" in IJavaPartitions; are these "partitions" the
part of a Java source file from which a computer is invoked? For example,
if I have only the "__java_string" partition defined, my computer would
only be invoked when the user requested assistance when the cursor is
inside of a Java String literal. Is that correct? Are these partitions
mutually exclusive? Or do they overlap? For example, does "__java_partitioning"
include all the other "__java_*" partitions?

>> 3. In org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer ,
>> what is
>> supposed to be returned by computeContextInformation(...)?
>
> This is the parameter hint info - I guess you need to get a bit more
> familiar with code assist ;-)

Ahh, I see now. I'm guessing I would not need this unless I were to insert
a partially completed string and I wanted to prompt the user to type in
some more stuff to complete the string. Is that correct?

>> 4. Where would I find the answers to the above questions, before
>> bothering
>> this forum?
>
> See ICompletionProposal and best is to use how it is done in JDT UI itself.

I guess my biggest barrier to following how JDT uses this stuff is my
inability to figure out how to get Eclipse to search the JDT source zips
for strings. Do you have any idea how I can go about doing that? A "File
Search" seems to search only my own source files when I tell it to search
the "Workspace"....

Thanks again.
Brian
Re: Re: [message #243272 is a reply to message #243267] Fri, 27 April 2007 18:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Brian Vosburgh" <first.last@oracle.com> wrote in message
news:f0ts9m$emt$1@build.eclipse.org...
> I guess my biggest barrier to following how JDT uses this stuff is my
> inability to figure out how to get Eclipse to search the JDT source zips
> for strings. Do you have any idea how I can go about doing that? A "File
> Search" seems to search only my own source files when I tell it to search
> the "Workspace"....

It's easiest to just bring jdt.ui into your own workspace. If you go to the
Plugins view, you can just right-click on it and "Import As -> Source
Project".

The only catch is that if you are working on an in-development version of
Eclipse (i.e. 3.3), you'll periodically need to delete and re-import that
project so as to have up-to-date code.
Re: [message #243865 is a reply to message #243267] Fri, 18 May 2007 11:38 Go to previous message
Eclipse UserFriend
Brian Vosburgh wrote:

> Thanks, Dani. Please let me ask you a few more questions:
>
>>> 1. In the org.eclipse.jdt.ui.javaCompletionProposalComputer
>>> extension point,
>>> what is the 'categoryId'?
>>
>>
>> You should defined your own category and give it a name. It will then
>> appear on the
>> Java > Editor > Content Assist Advanced preference page and users can
>> enable or
>> disable your proposal computer(s).
>
>
> Where is this "category" defined? How would I know about this?

You define this in your extension (plugin.xml).

>
>>> 2. Also in the org.eclipse.jdt.ui.javaCompletionProposalComputer
>>> extension point,
>>> what is a 'partition'?
>>
>>
>> Java documents are split into different partitions and each partition
>> has a partition
>> (or better: document) type, e.g. code (i.e. default), Javadoc, string
>> etc.
>
>
> I see these are "defined" in IJavaPartitions; are these "partitions" the
> part of a Java source file from which a computer is invoked? For example,
> if I have only the "__java_string" partition defined, my computer would
> only be invoked when the user requested assistance when the cursor is
> inside of a Java String literal. Is that correct?

Yes.

> Are these partitions
> mutually exclusive?

Yes.

> Or do they overlap? For example, does "__java_partitioning"
> include all the other "__java_*" partitions?
>
>>> 3. In org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer ,
>>> what is
>>> supposed to be returned by computeContextInformation(...)?
>>
>>
>> This is the parameter hint info - I guess you need to get a bit more
>> familiar with code assist ;-)
>
>
> Ahh, I see now. I'm guessing I would not need this unless I were to
> insert
> a partially completed string and I wanted to prompt the user to type in
> some more stuff to complete the string. Is that correct?

Not a prompt. Just the hints displayed on top of the method.

Dani

>
>>> 4. Where would I find the answers to the above questions, before
>>> bothering
>>> this forum?
>>
>>
>> See ICompletionProposal and best is to use how it is done in JDT UI
>> itself.
>
>
> I guess my biggest barrier to following how JDT uses this stuff is my
> inability to figure out how to get Eclipse to search the JDT source zips
> for strings. Do you have any idea how I can go about doing that? A "File
> Search" seems to search only my own source files when I tell it to search
> the "Workspace"....
>
> Thanks again.
> Brian
Previous Topic:any plan to make org.eclipse.jdt.internal.ui.actions.SelectionConverter public
Next Topic:Trying to update Javadoc tag via AST; space between tag and text is lost!
Goto Forum:
  


Current Time: Fri Jun 06 16:00:31 EDT 2025

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

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

Back to the top