Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mdt-papyrus.dev] Write access on applied Profile (ReadOnlyHandler mechanism)

Hi, Cedric,

From the JavaDoc of the IReadOnlyHandler2 interface:

/**
* Attempt to ensure that the resources identified by the given URIs are
* writable in any of the given {@code axes} of concern.
* @param axes
*        the set of axes on which to query read-only state
* @param uris
*            the URIs of resources to make writable (not all are
*            necessarily read-only)
* @return {@link Optional#absent() absent} if I do not know how to make
*         these resources writable and the next provider should be given a
*         chance, or a {@link Optional#isPresent() present} boolean
*         indicating that I made the resources writable ({@code true}) or
*         they cannot be made writable ({@code false})
*/
Optional<Boolean> makeWritable(Set<ReadOnlyAxis> axes, URI[] uris);

The pop-up type hierarchy on this method shows a bunch of implementations that can serve as examples.  In particular, ReferencedModelReadOnlyHandler class's implementation.

HTH,

Christian


On May 12, 2014, at 9:40 AM, Cedric Dumoulin <cedric.dumoulin@xxxxxxx> wrote:


LETAVERNIER Camille a écrit :
st this has initially been implemented this way).

But in Cédric's case, I think it should be done programmatically: the goal is to define "hidden" profiles, so the user shouldn't have to make the profile writable explicitly. So, the solution is to properly implement makeWritable in the AppliedProfileReadOnlyHandler, and call it when necessary. By default, all imported/referenced/applied resources are read-only.

AppliedProfileReadOnlyHandler.makeWritable() return false.
How can I change the behavior ? Is there some documentations or examples ?
Is there a documentation on the ReadOnly mechanism (a lot of Javadoc is missing !) ?

 Thanks,
  Cedric


_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev


Back to the top