Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Code Assist triggers for Java
Code Assist triggers for Java [message #245613] Thu, 12 July 2007 14:33 Go to next message
Eclipse UserFriend
I'm trying to get the content assist to show automatically as you type (in
MS Visual studio) instead of calling it with a shortkey. I figured that
entering all alphabetical characters in the "Avto activation triggers for
Java" preference field wold do the trick, but the input text field is
sadly (and strangely) limited to only 4 characters.
Is there a way to achieve this behaviour without editing the source code?

I managed to bypass the text box limitation in the Eclipse PDT plugin by
editing the source code. I used File -> Inport -> Plugins and Fragments.
Since PDT has a source folder I could edit a file named
ContentAssistSupport.java and change autoActivationTriggers =
PreferenceConstants.getPreferenceStore().getString(Preferenc eConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_PHP).trim().to CharArray();
to my custom char array. Then I exported the modified code as a Deployable
plugin.

The problem with JDT is that there is no source folder included in my
installation and I can't figure out a way to obtain the JDT source folder
that would enable me to use the technique I used for PDT.

I'm using eclipse europa.

I would appreciate any help in this matter.

Regards,
Matej
Re: Code Assist triggers for Java [message #245632 is a reply to message #245613] Fri, 13 July 2007 02:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jacek.pospychala.pl.ibm.com

Matej,

you can edit this preference directly in place, where JDT stores it, in
<WORKSPACE> \.metadata\.plugins\org.eclipse.core.runtime\.settings\org.e clipse.jdt.ui.prefs

and look for key: content_assist_autoactivation_triggers_java

Additionally, you can create a bug requrest to remove this 4 chars
limit. However, there may appear performance issues.

Matej wrote:
> I'm trying to get the content assist to show automatically as you type
> (in MS Visual studio) instead of calling it with a shortkey. I figured
> that entering all alphabetical characters in the "Avto activation
> triggers for Java" preference field wold do the trick, but the input
> text field is sadly (and strangely) limited to only 4 characters. Is
> there a way to achieve this behaviour without editing the source code?
>
> I managed to bypass the text box limitation in the Eclipse PDT plugin
> by editing the source code. I used File -> Inport -> Plugins and
> Fragments. Since PDT has a source folder I could edit a file named
> ContentAssistSupport.java and change autoActivationTriggers =
> PreferenceConstants.getPreferenceStore().getString(Preferenc eConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_PHP).trim().to CharArray();
> to my custom char array. Then I exported the modified code as a
> Deployable plugin.
> The problem with JDT is that there is no source folder included in my
> installation and I can't figure out a way to obtain the JDT source
> folder that would enable me to use the technique I used for PDT.
> I'm using eclipse europa.
>
> I would appreciate any help in this matter.
> Regards, Matej
>
Re: Code Assist triggers for Java [message #245733 is a reply to message #245632] Fri, 13 July 2007 10:16 Go to previous messageGo to next message
Eclipse UserFriend
That worked fine, thank you. There is one more problem though. I would
need the code proposals to NOT to be accepted when pressing the spacebar
key. Otherwise code completion gets in the way when declaring new entities
(for instance a new variable name). The problem is that if there is a
similarly named code proposal selected and you finish writing your
variable name it gets selected when you press the spacebar key and fills
in the selected proposal. Any suggestions how to fix this?

Jacek Pospychala wrote:

> Matej,

> you can edit this preference directly in place, where JDT stores it, in
>
<WORKSPACE> .metadata.pluginsorg.eclipse.core.runtime.settingsorg.eclips e.jdt.ui.prefs

> and look for key: content_assist_autoactivation_triggers_java

> Additionally, you can create a bug requrest to remove this 4 chars
> limit. However, there may appear performance issues.

> Matej wrote:
>> I'm trying to get the content assist to show automatically as you type
>> (in MS Visual studio) instead of calling it with a shortkey. I figured
>> that entering all alphabetical characters in the "Avto activation
>> triggers for Java" preference field wold do the trick, but the input
>> text field is sadly (and strangely) limited to only 4 characters. Is
>> there a way to achieve this behaviour without editing the source code?
>>
>> I managed to bypass the text box limitation in the Eclipse PDT plugin
>> by editing the source code. I used File -> Inport -> Plugins and
>> Fragments. Since PDT has a source folder I could edit a file named
>> ContentAssistSupport.java and change autoActivationTriggers =
>>
PreferenceConstants.getPreferenceStore().getString(Preferenc eConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_PHP).trim().to CharArray();
>> to my custom char array. Then I exported the modified code as a
>> Deployable plugin.
>> The problem with JDT is that there is no source folder included in my
>> installation and I can't figure out a way to obtain the JDT source
>> folder that would enable me to use the technique I used for PDT.
>> I'm using eclipse europa.
>>
>> I would appreciate any help in this matter.
>> Regards, Matej
>>
Re: Code Assist triggers for Java [message #245743 is a reply to message #245733] Fri, 13 July 2007 10:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jacek.pospychala.pl.ibm.com

Yes, i noticed the same, just after few minutes with these settings :)
I'll let you know if I find anything..


Matej wrote:
> That worked fine, thank you. There is one more problem though. I would
> need the code proposals to NOT to be accepted when pressing the
> spacebar key. Otherwise code completion gets in the way when declaring
> new entities (for instance a new variable name). The problem is that
> if there is a similarly named code proposal selected and you finish
> writing your variable name it gets selected when you press the
> spacebar key and fills in the selected proposal. Any suggestions how
> to fix this?
> Jacek Pospychala wrote:
>
>> Matej,
>
>> you can edit this preference directly in place, where JDT stores it, in
>>
> <WORKSPACE> .metadata.pluginsorg.eclipse.core.runtime.settingsorg.eclips e.jdt.ui.prefs
>
>
>> and look for key: content_assist_autoactivation_triggers_java
>
>> Additionally, you can create a bug requrest to remove this 4 chars
>> limit. However, there may appear performance issues.
>
>> Matej wrote:
>>> I'm trying to get the content assist to show automatically as you
>>> type (in MS Visual studio) instead of calling it with a shortkey. I
>>> figured that entering all alphabetical characters in the "Avto
>>> activation triggers for Java" preference field wold do the trick,
>>> but the input text field is sadly (and strangely) limited to only 4
>>> characters. Is there a way to achieve this behaviour without editing
>>> the source code?
>>>
>>> I managed to bypass the text box limitation in the Eclipse PDT
>>> plugin by editing the source code. I used File -> Inport -> Plugins
>>> and Fragments. Since PDT has a source folder I could edit a file
>>> named ContentAssistSupport.java and change autoActivationTriggers =
> PreferenceConstants.getPreferenceStore().getString(Preferenc eConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_PHP).trim().to CharArray();
>
>>> to my custom char array. Then I exported the modified code as a
>>> Deployable plugin.
>>> The problem with JDT is that there is no source folder included in
>>> my installation and I can't figure out a way to obtain the JDT
>>> source folder that would enable me to use the technique I used for PDT.
>>> I'm using eclipse europa.
>>>
>>> I would appreciate any help in this matter.
>>> Regards, Matej
>>>
>
Re: Code Assist triggers for Java [message #245781 is a reply to message #245743] Fri, 13 July 2007 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Here is a method that seems to work but you'll have to edit some jface
code.

The file to change is:
/org.eclipse.jface.text/src/org/eclipse/jface/text/contentas sist/CompletionProposalPopup.java

---
/Volumes/Documents/Users/matej/Desktop/old/org.eclipse.jface .text/src/org/eclipse/jface/text/contentassist/CompletionPro posalPopup.java
2007-05-09 08:15:10.000000000 +0200
+++
/Volumes/Documents/Users/matej/Desktop/new/org.eclipse.jface .text/src/org/eclipse/jface/text/contentassist/CompletionPro posalPopup.java
2007-07-13 23:59:46.000000000 +0200
@@ -1153,6 +1153,11 @@

// key != 0
switch (key) {
+ case 0x20: // Spce
+ e.doit= true;
+ hide();
+ break;
+
case 0x1B: // Esc
e.doit= false;
hide();


Jacek Pospychala wrote:
> Yes, i noticed the same, just after few minutes with these settings :)
> I'll let you know if I find anything..
>
>
> Matej wrote:
>> That worked fine, thank you. There is one more problem though. I would
>> need the code proposals to NOT to be accepted when pressing the
>> spacebar key. Otherwise code completion gets in the way when declaring
>> new entities (for instance a new variable name). The problem is that
>> if there is a similarly named code proposal selected and you finish
>> writing your variable name it gets selected when you press the
>> spacebar key and fills in the selected proposal. Any suggestions how
>> to fix this?
>> Jacek Pospychala wrote:
>>
>>> Matej,
>>
>>> you can edit this preference directly in place, where JDT stores it, in
>>>
>> <WORKSPACE> .metadata.pluginsorg.eclipse.core.runtime.settingsorg.eclips e.jdt.ui.prefs
>>
>>
>>> and look for key: content_assist_autoactivation_triggers_java
>>
>>> Additionally, you can create a bug requrest to remove this 4 chars
>>> limit. However, there may appear performance issues.
>>
>>> Matej wrote:
>>>> I'm trying to get the content assist to show automatically as you
>>>> type (in MS Visual studio) instead of calling it with a shortkey. I
>>>> figured that entering all alphabetical characters in the "Avto
>>>> activation triggers for Java" preference field wold do the trick,
>>>> but the input text field is sadly (and strangely) limited to only 4
>>>> characters. Is there a way to achieve this behaviour without editing
>>>> the source code?
>>>>
>>>> I managed to bypass the text box limitation in the Eclipse PDT
>>>> plugin by editing the source code. I used File -> Inport -> Plugins
>>>> and Fragments. Since PDT has a source folder I could edit a file
>>>> named ContentAssistSupport.java and change autoActivationTriggers =
>> PreferenceConstants.getPreferenceStore().getString(Preferenc eConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_PHP).trim().to CharArray();
>>
>>>> to my custom char array. Then I exported the modified code as a
>>>> Deployable plugin.
>>>> The problem with JDT is that there is no source folder included in
>>>> my installation and I can't figure out a way to obtain the JDT
>>>> source folder that would enable me to use the technique I used for PDT.
>>>> I'm using eclipse europa.
>>>>
>>>> I would appreciate any help in this matter.
>>>> Regards, Matej
>>>>
>>
Re: Code Assist triggers for Java [message #245810 is a reply to message #245613] Mon, 16 July 2007 02:40 Go to previous message
Eclipse UserFriend
Matej wrote:

> I'm trying to get the content assist to show automatically as you type
> (in MS Visual studio) instead of calling it with a shortkey. I figured
> that entering all alphabetical characters in the "Avto activation
> triggers for Java" preference field wold do the trick, but the input
> text field is sadly (and strangely) limited to only 4 characters. Is
> there a way to achieve this behaviour without editing the source code?

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=159157.

>
> I managed to bypass the text box limitation in the Eclipse PDT plugin
> by editing the source code. I used File -> Inport -> Plugins and
> Fragments. Since PDT has a source folder I could edit a file named
> ContentAssistSupport.java and change autoActivationTriggers =
> PreferenceConstants.getPreferenceStore().getString(Preferenc eConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_PHP).trim().to CharArray();
> to my custom char array. Then I exported the modified code as a
> Deployable plugin.
> The problem with JDT is that there is no source folder included in my
> installation and I can't figure out a way to obtain the JDT source
> folder that would enable me to use the technique I used for PDT.

Not sure what you mean here. Simply either import the org.eclipse.jdt.ui
source or load it via CVS (dev.eclipse.org).

Dani

> I'm using eclipse europa.
>
> I would appreciate any help in this matter.
> Regards, Matej
>
Previous Topic:Extend jdt editor to register a new IToggleBreakpointsTarget adapter
Next Topic:NLS key hyperlink navigation and java 5 static import (eclipse 3.2)
Goto Forum:
  


Current Time: Mon Jun 09 15:04:37 EDT 2025

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

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

Back to the top