Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Creating org.eclipse.dltk.core.CompletionProposal

Hi Clemens,

CompletionProposal has static factory method:

public static CompletionProposal create(int kind, int completionOffset) {
	return new CompletionProposal(kind, completionOffset);
}

This is the method used by ScriptCompletionEngine.createProposal().

It should work for you.

Regards,
Alex

----- Original Message -----
From: "Clemens Anhuth" <clemens@xxxxxxxxxxxxx>
To: "DLTK Developer Discussions" <dltk-dev@xxxxxxxxxxx>
Sent: Thursday, April 30, 2009 7:00:17 PM GMT +06:00 Almaty, Novosibirsk
Subject: [Dltk-dev] Creating org.eclipse.dltk.core.CompletionProposal

Hello everyone.

I have a 
org.eclipse.dltk.ui.text.completion.ScriptCompletionProposalComputer to 
contribute additional completions.

In my ScriptCompletionProposal subclass I want to provide a getImage() 
implementation which uses the default icons for fields, members, etc.

I wanted to use this code for getting the respective images:

DLTKUIPlugin.getImageDescriptorRegistry().get(
  invocationContext.getLabelProvider()
    .createImageDescriptor(x));

But because x must be a org.eclipse.dltk.core.CompletionProposal, and 
its constructor is protected, I don't know how to create one of these.

I noticed ScriptCompletionEngine.createProposal(...), but I do not have 
my own ScriptCompletionEngine, since my code is "only" a contributor of 
proposals. I also looked for ways to get a reference to the 
ScriptCompletionEngine, didn't find something I could use.

Any help?



With best regards

Clemens Anhuth


-- 
www.froglogic.com - Squish - Multi-Platform GUI Testing

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top