|
|
Re: Make diagram readonly and hide pallet [message #1718921 is a reply to message #1718615] |
Sat, 02 January 2016 14:14 |
Koen Staal Messages: 70 Registered: October 2014 |
Member |
|
|
Esteban thanks for the tip.
By activating readonly on the ReadonlyPermissionAuthority, the whole editingsession becomes readonly and can not even be cancelled.
Im wondering if i should extend ReadonlyPermissionAuthority to fit my needs but comments in there says i should not.
Another way is to intercept all changes/commands and check somehow if the representation should not be edited.
I found that the DDiagramEditor also has a palettemanager but it does not have a hide or show which i did expect.
[Updated on: Sun, 03 January 2016 12:11] Report message to a moderator
|
|
|
Re: Make diagram readonly and hide pallet [message #1718997 is a reply to message #1718921] |
Mon, 04 January 2016 10:36 |
|
Hello Koen
Le 02/01/2016 15:14, Koen Staal a écrit :
> Esteban thanks for the tip.
>
> By activating readonly on the ReadonlyPermissionAuthority, the whole
> editingsession becomes and can not even be cancelled.
>
> Im wondering if i should extend ReadonlyPermissionAuthority to fit my
> needs but comments in there says i should not.
Yes, you can provide your own permissionAuthority extending
ReadonlyPermissionAuthority and overloading checkApproval method
In addition to what Esteban said, you can provide this
PermissionAuthority also using the following extension point:
org.eclipse.sirius.ecore.extender.PermissionProvider
>
> Another way is to intercept all changes/commands and check if the editor
> is in my readonly.
>
>
>
> I found that the DDiagramEditor also has a palettemanager but it does
> not have a hide or show which i did expect.
>
The palette can be emptied but not hidden.
Regards
Laurent
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Make diagram readonly and hide pallet [message #1720981 is a reply to message #1720403] |
Fri, 22 January 2016 09:35 |
|
Le 18/01/2016 13:54, Koen Staal a écrit :
> It seems that when i return LockStatus.NOT_LOCKED from
> getLockStatus(EObject element) the locks no longer are show. For the
> same object i aslo return 'false' for canEdit, canCreate, canDelete etc.
> Can this cause any problems?
It should not. It's perfectly legitimate for these operations to be
disabled for other reasons than a lock on the element. For example if
the underlying resource is read-only, or the corresponding feature is
not changeable in the metamodel definition.
Regards,
Pierre-Charles.
--
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03981 seconds