Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Help please, ContentAssist with HTML support !(CreateInformationControl si never call in an exported XTEXT RCP)
Help please, ContentAssist with HTML support ! [message #771188] Mon, 26 December 2011 15:48 Go to next message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Hi, i am desperate with this problem.

I have a RCP made with the info in http://kthoms.wordpress.com/2010/11/12/setting-up-a-rcp-product-for-a-dsl/. My rcp work great when I run it from "Launch an eclipse application" in the .product/overview panel, however, when I export this rcp and i run it from the exe, the content assist that contain the additional info of my functions never appear.

In my xtext project I have extended the class "AbstractMyDSLProposalProvider" and have overrided "doCreateProposal"

protected ConfigurableCompletionProposal doCreateProposal(String proposal,
StyledString displayString, Image image, int replacementOffset,int replacementLength) {
       return new MydslConfigurableCompletionProposal(proposal,      replacementOffset,replacementLength,displayString, image);
}


And :

public class MyDSLCompletionProposal extends ConfigurableCompletionProposal {

public ConfigurableCompletionProposal(....){
   super(....);
}

public IInformationControl getInformationControlCreator(){
System.out.println("getInformationControlCreator");
return new IInformationControlCreator() {
  @Override
  public IInformationControl createInformationControl (Shell parent){
     System.out.println("broswer");
     BrowserInformationControl browser = new BrowserInformationControl(parent, null,  false);
     return browser;
  }
}
}


And there is no more significant code for show us.

When I start my rcp from eclipse ide, the first and second print appear in the console, and everything work properly, but when i start from the exported product the second print is never appear. So, createInformationControl is never call.

IInformationControlCreator never is null.

If I delete the function getInformationControlCreator(), everything work properly but the html tags not work.

I am using XTEXT 2.1 and Eclipse Indigo last version.

So I have a very big confussion, where is the problem ?..

Product Export ?
Xtext ?
InformationControl ?

Please somebody provide me some help, something for do, some suggestion, whatever will be help.

Thanks.


[Updated on: Mon, 26 December 2011 17:09]

Report message to a moderator

Re: Help please, ContentAssist with HTML support ! [message #771273 is a reply to message #771188] Mon, 26 December 2011 20:52 Go to previous messageGo to next message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
I dont know if it is a bug, but IInformationControlCreator not work in a exported product, so after researching a lot of time i found :

public IInformationControlCreator getInformationControlCreator() {
	return new AbstractReusableInformationControlCreator() {
                 public IInformationControl doCreateInformationControl(Shell parent) {
		         return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, false);
	         }
        };
}


and work Very Happy

I found the solution in ->

http://grepcode.com/file/repository.grepcode.com/java/eclipse.org/3.6.1/org.eclipse.pde/ui/3.6.1/org/eclipse/pde/internal/ui/editor/contentassist/TypeCompletionProposal.java
Re: Help please, ContentAssist with HTML support ! [message #771318 is a reply to message #771188] Tue, 27 December 2011 00:04 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
If it works as expected when running from within the IDE, then your RCP
is either just missing some bundles, or you are doing something
different/wrong in the configuration of the basic RCP product.

I know that is not very specific, but I hope it helps you in some way.
To understand what is needed, I usually use a launch configuration. I
start by removing everything, then add my bundles (i.e any model
bundles, the dsl bundle, the dsl ui bundle, etc.) and then use the "add
all required". I then test. What is then probably missing are some of
the import package dependencies and some of the optional ones. You will
get runtime errors for those.

You are then armed with a list of bundles that are required in your RCP.

- henrik

On 2011-26-12 16:48, Federico Sellanes wrote:
> Hi, i am desperate with this problem.
>
> I have a RCP made with the info in
> http://kthoms.wordpress.com/2010/11/12/setting-up-a-rcp-product-for-a-dsl/.
> My rcp work great when I run it from "Launch an eclipse application" in
> the .product/overview panel, however, when I export this rcp and i run
> it from the exe, the content assist of my functions never appear.
>
> In my xtext project I have extended the class
> "AbstractMyDSLProposalProvider" and have overrided "doCreateProposal"
>
>
> protected ConfigurableCompletionProposal doCreateProposal(String proposal,
> StyledString displayString, Image image, int replacementOffset,int
> replacementLength) {
> return new MydslConfigurableCompletionProposal(proposal,
> replacementOffset,replacementLength,displayString, image);
> }
>
>
> And :
>
>
> public class MyDSLCompletionProposal extends
> ConfigurableCompletionProposal {
>
> public ConfigurableCompletionProposal(....){
> super(....);
> }
>
> public IInformationControl getInformationControlCreator(){
> System.out.println("getInformationControlCreator");
> return new IInformationControlCreator() {
> @Override
> public IInformationControl createInformationControl (Shell parent){
> System.out.println("broswer");
> BrowserInformationControl browser = new
> BrowserInformationControl(parent, null, false);
> return browser;
> }
> }
> }
>
>
> And there is no more significant code for show us.
>
> When I start my rcp from eclipse ide, the first and second print appear
> in the console, and everything work properly, but when i start from the
> exported product the second print is never appear. So,
> createInformationControl is never call.
>
> IInformationControlCreator never is null.
>
> If I delete the function getInformationControlCreator(), everything work
> properly but the html tags not work.
>
> I am using XTEXT 2.1 and Eclipse Indigo last version.
>
> So I have a very big confussion, where is the problem ?..
> Product Export ?
> Xtext ?
> InformationControl ?
>
> Please somebody provide me some help, something for do, some suggestion,
> whatever will be help.
>
> Thanks.
>
>
>
Re: Help please, ContentAssist with HTML support ! [message #771320 is a reply to message #771318] Tue, 27 December 2011 00:08 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Sorry, did not see that you figured it out before I posted...

- henrik

On 2011-27-12 1:04, Henrik Lindberg wrote:
> If it works as expected when running from within the IDE, then your RCP
> is either just missing some bundles, or you are doing something
> different/wrong in the configuration of the basic RCP product.
>
> I know that is not very specific, but I hope it helps you in some way.
> To understand what is needed, I usually use a launch configuration. I
> start by removing everything, then add my bundles (i.e any model
> bundles, the dsl bundle, the dsl ui bundle, etc.) and then use the "add
> all required". I then test. What is then probably missing are some of
> the import package dependencies and some of the optional ones. You will
> get runtime errors for those.
>
> You are then armed with a list of bundles that are required in your RCP.
>
> - henrik
>
> On 2011-26-12 16:48, Federico Sellanes wrote:
>> Hi, i am desperate with this problem.
>>
>> I have a RCP made with the info in
>> http://kthoms.wordpress.com/2010/11/12/setting-up-a-rcp-product-for-a-dsl/.
>>
>> My rcp work great when I run it from "Launch an eclipse application" in
>> the .product/overview panel, however, when I export this rcp and i run
>> it from the exe, the content assist of my functions never appear.
>>
>> In my xtext project I have extended the class
>> "AbstractMyDSLProposalProvider" and have overrided "doCreateProposal"
>>
>>
>> protected ConfigurableCompletionProposal doCreateProposal(String
>> proposal,
>> StyledString displayString, Image image, int replacementOffset,int
>> replacementLength) {
>> return new MydslConfigurableCompletionProposal(proposal,
>> replacementOffset,replacementLength,displayString, image);
>> }
>>
>>
>> And :
>>
>>
>> public class MyDSLCompletionProposal extends
>> ConfigurableCompletionProposal {
>>
>> public ConfigurableCompletionProposal(....){
>> super(....);
>> }
>>
>> public IInformationControl getInformationControlCreator(){
>> System.out.println("getInformationControlCreator");
>> return new IInformationControlCreator() {
>> @Override
>> public IInformationControl createInformationControl (Shell parent){
>> System.out.println("broswer");
>> BrowserInformationControl browser = new
>> BrowserInformationControl(parent, null, false);
>> return browser;
>> }
>> }
>> }
>>
>>
>> And there is no more significant code for show us.
>>
>> When I start my rcp from eclipse ide, the first and second print appear
>> in the console, and everything work properly, but when i start from the
>> exported product the second print is never appear. So,
>> createInformationControl is never call.
>>
>> IInformationControlCreator never is null.
>>
>> If I delete the function getInformationControlCreator(), everything work
>> properly but the html tags not work.
>>
>> I am using XTEXT 2.1 and Eclipse Indigo last version.
>>
>> So I have a very big confussion, where is the problem ?..
>> Product Export ?
>> Xtext ?
>> InformationControl ?
>>
>> Please somebody provide me some help, something for do, some suggestion,
>> whatever will be help.
>>
>> Thanks.
>>
>>
>>
>
Re: Help please, ContentAssist with HTML support ! [message #771508 is a reply to message #771320] Tue, 27 December 2011 13:25 Go to previous message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Thanks for you answer, was a very rare issue, after i used AbstractReusableControlCreator with success i tried again IInformationControlCreator and magically worked... so, then confused me even more. So i think was maybe a problem with the font o who knows ^^). Now both of the options work well, i will try it in other pc and i will clearing my doubts.


[Updated on: Tue, 27 December 2011 13:46]

Report message to a moderator

Previous Topic:grammar archives anywhere?
Next Topic:arbitrary number of parantheses
Goto Forum:
  


Current Time: Fri Apr 26 19:43:43 GMT 2024

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

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

Back to the top