|
|
|
|
|
|
|
Re: How to get a TextViewer from IEditorPart ? [message #252956 is a reply to message #252939] |
Thu, 24 April 2008 03:03  |
Eclipse User |
|
|
|
Originally posted by: reg.zhuce.163.com
Daniel Megert 写道:
> dazh wrote:
>> Daniel Megert 写道:
>>
>>> dazh wrote:
>>>
>>>> Daniel Megert 写道:
>>>>
>>>>
>>>>> dazh wrote:
>>>>>
>>>>>
>>>>>> dazh 写道:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> It's in the method:
>>>>>>> public void setActiveEditor(IAction action, IEditorPart targetEditor).
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> I know I can do like this:
>>>>>> ((JavaEditor)targetEditor).getViewer()
>>>>>> But it's told
>>>>>> "Discouraged access: The type JavaEditor is not accessible due to
>>>>>> restriction on
>>>>>> required library"
>>>>>> Is there any way alternative?
>>>>>>
>>>>>>
>>>>>>
>>>>> No. The viewer must not be accessed unless it is your own editor.
>>>>>
>>>>> Dani
>>>>>
>>>>>
>>>> Thanks
>>>> Then if I want to customize ContentAssistant which has to access viewer,
>>>> I must implement a editor?
>>>> That's terrible.
>>>>
>>>>
>>> No it is not. You can register a completion proposal computer via
>>> extension point.
>>>
>>> Dani
>>>
>> Really? That's exiting.
>> I tried a lot of extension points, such as
>> org.eclipse.jdt.ui.javaCompletionProposalComputer.
>> But it throws exceptions, and I do not know why at all.
>> How can I realize it via extension point? Would you give any details?
>>
> Just look how other do it, e.g. jdt.ui itself uses the extension point.
> So, I suggest you start there.
>
> Dani
Thank you for your suggestion.
In fact,I have looked lots of code before I asked here.
I have fixed the exception.
But it seems that the plug-in isn't loaded at all.
How can I trigger it?
What's more, how can I define other auto-activation-characters different
from the built-in ones, such as '#'?
|
|
|
Powered by
FUDForum. Page generated in 0.03079 seconds