Skip to main content


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 UserFriend
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 MegertFriend
Messages: 3802
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: Thu Apr 25 21:55:05 GMT 2024

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

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

Back to the top