Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » SourceViewer.setEditable() or disabled EditorParts
SourceViewer.setEditable() or disabled EditorParts [message #536336] Thu, 27 May 2010 16:57 Go to next message
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 08:59 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
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 :(
Previous Topic:Unsupported Content Type for package-info.java
Next Topic:How to make a TextEditor know an external file is undo clean?
Goto Forum:
  


Current Time: Mon Sep 15 02:06:41 GMT 2014

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

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