SourceViewer.setEditable() or disabled EditorParts [message #536336] |
Thu, 27 May 2010 12:57  |
Eclipse User |
|
|
|
Originally posted by: micha.on.the.road.web.de
Hi,
I have a problem respective IPartListener2 listeners and
SourceViewer.setEditable().
I add the listener and on activate or open I setEditable(false), also, I
disable CUT and PASTE. However, it does not work like expected. Usually
the menu point "paste" is still active after opening an editor but
usually it has no effect clicking it.
But if I work a moment, suddenly the variables gets reset and the copy
and paste is working again. Where comes this from?!? How to make an
editor (or even much better, generally, how to make EditorParts)
non-editable? Just simple code viewers ...
Btw. How can I attach the eclipse source code to eclipse?
I would appreciate a lot any help.
Regards
Michael
PS: Writing in the editor I intercept with a VerifyKeyListener without
problems, drag with a DragDetectFilter. But it seems to be impossible to
solve this cut and paste problem :(
|
|
|
Re: SourceViewer.setEditable() or disabled EditorParts [message #539900 is a reply to message #536336] |
Mon, 14 June 2010 04:59  |
Eclipse User |
|
|
|
Arbor wrote:
> Hi,
>
> I have a problem respective IPartListener2 listeners and
> SourceViewer.setEditable().
> I add the listener and on activate or open I setEditable(false), also,
> I disable CUT and PASTE. However, it does not work like expected.
> Usually the menu point "paste" is still active after opening an editor
> but usually it has no effect clicking it.
> But if I work a moment, suddenly the variables gets reset and the copy
> and paste is working again. Where comes this from?!? How to make an
> editor (or even much better, generally, how to make EditorParts)
> non-editable? Just simple code viewers ...
You need to make sure that the underlying editor input (e.g. the file)
is read-only since the state is queried from there.
>
> Btw. How can I attach the eclipse source code to eclipse?
You can import it via File > Import... > Plug-ins and Fragments or by
checking it out from the CVS repository.
Dani
>
> I would appreciate a lot any help.
>
> Regards
> Michael
>
>
>
> PS: Writing in the editor I intercept with a VerifyKeyListener without
> problems, drag with a DragDetectFilter. But it seems to be impossible
> to solve this cut and paste problem :(
|
|
|
Powered by
FUDForum. Page generated in 0.03366 seconds