Home » Eclipse Projects » GEF » Read-Only Editor
Read-Only Editor [message #118862] |
Mon, 23 February 2004 07:20  |
Eclipse User |
|
|
|
Originally posted by: phil.williams.toadmail.com
Is there a quick and easy way to open up a model in a read-only GEF
editor mode. The editor is going to be tied to an in-memory version of
my model and thus I can not simply set the read-only bit on the file.
What I was thinking of doing was adding a read-only bit to my model
elements and then upon creation of the various edit parts check the flag
and not install any edit policies if it is set.
I also am wondering if there is any way to hide the palette when I am in
a read-only mode.
Has anyone here implemented a read-only strategy for a GEF Editor and if
so, how did you approach it?
TIA,
Phil
|
|
| |
Re: Read-Only Editor [message #118926 is a reply to message #118888] |
Mon, 23 February 2004 10:39   |
Eclipse User |
|
|
|
Originally posted by: phil.williams.toadmail.com
This is a multi-part message in MIME format.
--------------050401040301030407050704
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
So I guess that the short answer was no. :-P
I will start the investigation at the edit domain level and let you all
know what, if anything I find.
What about the issue of hiding a palette? Is there an easy way to do
this? Not only do I not want to let the user modify the model, but I
also want to have the visual ques that it is not editable as well, i.e.
no palette.
Thanks,
Phil
Randy Hudson wrote:
>This is an interesting problem. I would suggest handling it at the
>EditDomain level. Mark the editdomain as read-only. Also, you could
>intercept CommandStack#execute and prevent any model changes from happening.
>Let us know how you solve this, and open any bugzillas if you have proposed
>changes to facilitate.
>
>
>"Phil Williams" <phil.williams@toadmail.com> wrote in message
>news:c1cqvg$n8n$1@eclipse.org...
>
>
>>Is there a quick and easy way to open up a model in a read-only GEF
>>editor mode. The editor is going to be tied to an in-memory version of
>>my model and thus I can not simply set the read-only bit on the file.
>>
>>What I was thinking of doing was adding a read-only bit to my model
>>elements and then upon creation of the various edit parts check the flag
>>and not install any edit policies if it is set.
>>
>>I also am wondering if there is any way to hide the palette when I am in
>>a read-only mode.
>>
>>Has anyone here implemented a read-only strategy for a GEF Editor and if
>>so, how did you approach it?
>>
>>TIA,
>>Phil
>>
>>
>
>
>
>
--------------050401040301030407050704
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body>
So I guess that the short answer was no. <span class="moz-smiley-s4"><span>
:-P </span></span><br>
<br>
I will start the investigation at the edit domain level and let you all
know what, if anything I find.<br>
<br>
What about the issue of hiding a palette? Is there an easy way to do
this? Not only do I not want to let the user modify the model, but I
also want to have the visual ques that it is not editable as well, i.e.
no palette.<br>
<br>
Thanks,<br>
Phil<br>
<br>
Randy Hudson wrote:<br>
<blockquote cite="midc1d62v$71r$1@eclipse.org" type="cite">
<pre wrap="">This is an interesting problem. I would suggest handling it at the
EditDomain level. Mark the editdomain as read-only. Also, you could
intercept CommandStack#execute and prevent any model changes from happening.
Let us know how you solve this, and open any bugzillas if you have proposed
changes to facilitate.
"Phil Williams" <a class="moz-txt-link-rfc2396E" href="mailto:phil.williams@toadmail.com"><phil.williams@toadmail.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:c1cqvg$n8n$1@eclipse.org">news:c1cqvg$n8n$1@eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Is there a quick and easy way to open up a model in a read-only GEF
editor mode. The editor is going to be tied to an in-memory version of
my model and thus I can not simply set the read-only bit on the file.
What I was thinking of doing was adding a read-only bit to my model
elements and then upon creation of the various edit parts check the flag
and not install any edit policies if it is set.
I also am wondering if there is any way to hide the palette when I am in
a read-only mode.
Has anyone here implemented a read-only strategy for a GEF Editor and if
so, how did you approach it?
TIA,
Phil
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
--------------050401040301030407050704--
|
|
|
Re: Read-Only Editor [message #118952 is a reply to message #118926] |
Mon, 23 February 2004 11:15   |
Eclipse User |
|
|
|
Originally posted by: phil.williams.toadmail.com
This is a multi-part message in MIME format.
--------------040105040709020404080806
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Randy,
OK, I would like to eat my words (a bit). The short answer to whether
there is an easy way to accomplish this is yes. :-) Following your
advice I have a ReadOnlyEditDomain that extends the default domain and
add a readonly flag. I also extended the CommandStack with a
ReadOnlyCommandStack that has a readOnly flag as well. When the flag is
true, the execute() method simply returns and therefore, the commands
are ignored.
The next pointer that I need some assitance with is how to turn off all
the visual ques that the user is getting. For instance, when the editor
is in readOnly mode and I attempt to click and drag something in my
editor, I still get the greybox during the drag. I also can still drag
things from the palette and get the "add" icon. Is there an easy way
via the edit domain perhaps, that I can turn off the visual ques?
Thanks again,
Phil
Phil Williams wrote:
> So I guess that the short answer was no. :-P
>
> I will start the investigation at the edit domain level and let you
> all know what, if anything I find.
>
> What about the issue of hiding a palette? Is there an easy way to do
> this? Not only do I not want to let the user modify the model, but I
> also want to have the visual ques that it is not editable as well,
> i.e. no palette.
>
> Thanks,
> Phil
>
> Randy Hudson wrote:
>
>>This is an interesting problem. I would suggest handling it at the
>>EditDomain level. Mark the editdomain as read-only. Also, you could
>>intercept CommandStack#execute and prevent any model changes from happening.
>>Let us know how you solve this, and open any bugzillas if you have proposed
>>changes to facilitate.
>>
>>
>>"Phil Williams" <phil.williams@toadmail.com> wrote in message
>>news:c1cqvg$n8n$1@eclipse.org...
>>
>>
>>>Is there a quick and easy way to open up a model in a read-only GEF
>>>editor mode. The editor is going to be tied to an in-memory version of
>>>my model and thus I can not simply set the read-only bit on the file.
>>>
>>>What I was thinking of doing was adding a read-only bit to my model
>>>elements and then upon creation of the various edit parts check the flag
>>>and not install any edit policies if it is set.
>>>
>>>I also am wondering if there is any way to hide the palette when I am in
>>>a read-only mode.
>>>
>>>Has anyone here implemented a read-only strategy for a GEF Editor and if
>>>so, how did you approach it?
>>>
>>>TIA,
>>>Phil
>>>
>>>
>>
>>
>>
>>
--------------040105040709020404080806
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body>
Randy,<br>
<br>
OK, I would like to eat my words (a bit). The short answer to whether
there is an easy way to accomplish this is yes. :-) Following your
advice I have a ReadOnlyEditDomain that extends the default domain and
add a readonly flag. I also extended the CommandStack with a
ReadOnlyCommandStack that has a readOnly flag as well. When the flag
is true, the execute() method simply returns and therefore, the
commands are ignored.<br>
<br>
The next pointer that I need some assitance with is how to turn off all
the visual ques that the user is getting. For instance, when the
editor is in readOnly mode and I attempt to click and drag something in
my editor, I still get the greybox during the drag. I also can still
drag things from the palette and get the "add" icon. Is there an easy
way via the edit domain perhaps, that I can turn off the visual ques?<br>
<br>
Thanks again,<br>
Phil<br>
<br>
Phil Williams wrote:<br>
<blockquote cite="midc1d6kp$7tl$1@eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
So I guess that the short answer was no. <span class="moz-smiley-s4"><span>
:-P </span></span><br>
<br>
I will start the investigation at the edit domain level and let you all
know what, if anything I find.<br>
<br>
What about the issue of hiding a palette? Is there an easy way to do
this? Not only do I not want to let the user modify the model, but I
also want to have the visual ques that it is not editable as well, i.e.
no palette.<br>
<br>
Thanks,<br>
Phil<br>
<br>
Randy Hudson wrote:<br>
<blockquote cite="midc1d62v$71r$1@eclipse.org" type="cite">
<pre wrap="">This is an interesting problem. I would suggest handling it at the
EditDomain level. Mark the editdomain as read-only. Also, you could
intercept CommandStack#execute and prevent any model changes from happening.
Let us know how you solve this, and open any bugzillas if you have proposed
changes to facilitate.
"Phil Williams" <a class="moz-txt-link-rfc2396E"
href="mailto:phil.williams@toadmail.com"><phil.williams@toadmail.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:c1cqvg$n8n$1@eclipse.org">news:c1cqvg$n8n$1@eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Is there a quick and easy way to open up a model in a read-only GEF
editor mode. The editor is going to be tied to an in-memory version of
my model and thus I can not simply set the read-only bit on the file.
What I was thinking of doing was adding a read-only bit to my model
elements and then upon creation of the various edit parts check the flag
and not install any edit policies if it is set.
I also am wondering if there is any way to hide the palette when I am in
a read-only mode.
Has anyone here implemented a read-only strategy for a GEF Editor and if
so, how did you approach it?
TIA,
Phil
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</blockquote>
</body>
</html>
--------------040105040709020404080806--
|
|
|
Re: Read-Only Editor [message #118991 is a reply to message #118952] |
Mon, 23 February 2004 11:34   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
This is a multi-part message in MIME format.
------=_NextPart_000_00B8_01C3FA01.06C1EEB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
You could have your editparts return the SelectEditPartTracker to only =
allow selection, and not dragging. They would have to query the domain =
flag.
As far as the palette, it is just an SWT canvas and you should be able =
to hide it using whatever techniques you want. Of course in 3.0 the =
palette will be a view, so I'm not sure what hiding will mean then. =
Hopefully there will be a programmatic way to hide views which aren't =
doing anything useful.
"Phil Williams" <phil.williams@toadmail.com> wrote in message =
news:c1d8nv$b22$1@eclipse.org...
Randy,
OK, I would like to eat my words (a bit). The short answer to whether =
there is an easy way to accomplish this is yes. :-) Following your =
advice I have a ReadOnlyEditDomain that extends the default domain and =
add a readonly flag. I also extended the CommandStack with a =
ReadOnlyCommandStack that has a readOnly flag as well. When the flag is =
true, the execute() method simply returns and therefore, the commands =
are ignored.
The next pointer that I need some assitance with is how to turn off =
all the visual ques that the user is getting. For instance, when the =
editor is in readOnly mode and I attempt to click and drag something in =
my editor, I still get the greybox during the drag. I also can still =
drag things from the palette and get the "add" icon. Is there an easy =
way via the edit domain perhaps, that I can turn off the visual ques?
Thanks again,
Phil
Phil Williams wrote:
So I guess that the short answer was no. :-P=20
I will start the investigation at the edit domain level and let you =
all know what, if anything I find.
What about the issue of hiding a palette? Is there an easy way to =
do this? Not only do I not want to let the user modify the model, but I =
also want to have the visual ques that it is not editable as well, i.e. =
no palette.
Thanks,
Phil
Randy Hudson wrote:
This is an interesting problem. I would suggest handling it at the
EditDomain level. Mark the editdomain as read-only. Also, you could
intercept CommandStack#execute and prevent any model changes from =
happening.
Let us know how you solve this, and open any bugzillas if you have =
proposed
changes to facilitate.
"Phil Williams" <phil.williams@toadmail.com> wrote in message
news:c1cqvg$n8n$1@eclipse.org...
Is there a quick and easy way to open up a model in a read-only GEF
editor mode. The editor is going to be tied to an in-memory version of
my model and thus I can not simply set the read-only bit on the file.
What I was thinking of doing was adding a read-only bit to my model
elements and then upon creation of the various edit parts check the flag
and not install any edit policies if it is set.
I also am wondering if there is any way to hide the palette when I am in
a read-only mode.
Has anyone here implemented a read-only strategy for a GEF Editor and if
so, how did you approach it?
TIA,
Phil
=20
------=_NextPart_000_00B8_01C3FA01.06C1EEB0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>You could have your editparts return =
the=20
SelectEditPartTracker to only allow selection, and not dragging. =
They=20
would have to query the domain flag.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>As far as the palette, it is just =
an SWT=20
canvas and you should be able to hide it using whatever techniques you=20
want. Of course in 3.0 the palette will be a view, so I'm not =
sure=20
what hiding will mean then. Hopefully there will be a programmatic =
way to=20
hide views which aren't doing anything useful.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>"Phil Williams" <<A=20
href=3D"mailto:phil.williams@toadmail.com">phil.williams@toadmail.com</A>=
>=20
wrote in message <A=20
href=3D"news:c1d8nv$b22$1@eclipse.org">news:c1d8nv$b22$1@eclipse.org</A>.=
...</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Randy,<BR><BR>OK,=20
I would like to eat my words (a bit). The short answer to =
whether there=20
is an easy way to accomplish this is yes. :-) Following your advice I =
have a=20
ReadOnlyEditDomain that extends the default domain and add a readonly=20
flag. I also extended the CommandStack with a =
ReadOnlyCommandStack that=20
has a readOnly flag as well. When the flag is true, the =
execute() method=20
simply returns and therefore, the commands are ignored.<BR><BR>The =
next=20
pointer that I need some assitance with is how to turn off all the =
visual ques=20
that the user is getting. For instance, when the editor is in =
readOnly=20
mode and I attempt to click and drag something in my editor, I still =
get the=20
greybox during the drag. I also can still drag things from the =
palette=20
and get the "add" icon. Is there an easy way via the edit domain =
perhaps, that I can turn off the visual ques?<BR><BR>Thanks=20
again,<BR>Phil<BR><BR>Phil Williams wrote:<BR>
<BLOCKQUOTE cite=3Dmidc1d6kp$7tl$1@eclipse.org type=3D"cite">So I =
guess that the=20
short answer was no. <SPAN class=3Dmoz-smiley-s4><SPAN>:-P=20
</SPAN></SPAN><BR><BR>I will start the investigation at the edit =
domain=20
level and let you all know what, if anything I find.<BR><BR>What =
about the=20
issue of hiding a palette? Is there an easy way to do =
this? Not=20
only do I not want to let the user modify the model, but I also want =
to have=20
the visual ques that it is not editable as well, i.e. no=20
palette.<BR><BR>Thanks,<BR>Phil<BR><BR>Randy Hudson wrote:<BR>
<BLOCKQUOTE cite=3Dmidc1d62v$71r$1@eclipse.org type=3D"cite"><PRE =
wrap=3D"">This is an interesting problem. I would suggest handling it =
at the
EditDomain level. Mark the editdomain as read-only. Also, you could
intercept CommandStack#execute and prevent any model changes from =
happening.
Let us know how you solve this, and open any bugzillas if you have =
proposed
changes to facilitate.
"Phil Williams" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:phil.williams@toadmail.com"><phil.williams@toadmail.com=
></A> wrote in message
<A class=3Dmoz-txt-link-freetext =
href=3D"news:c1cqvg$n8n$1@eclipse.org">news:c1cqvg$n8n$1@eclipse.org</A>.=
...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Is there a quick and easy =
way to open up a model in a read-only GEF
editor mode. The editor is going to be tied to an in-memory version of
my model and thus I can not simply set the read-only bit on the file.
What I was thinking of doing was adding a read-only bit to my model
elements and then upon creation of the various edit parts check the flag
and not install any edit policies if it is set.
I also am wondering if there is any way to hide the palette when I am in
a read-only mode.
Has anyone here implemented a read-only strategy for a GEF Editor and if
so, how did you approach it?
TIA,
Phil
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML >
------=_NextPart_000_00B8_01C3FA01.06C1EEB0--
|
|
|
Re: Read-Only Editor [message #119083 is a reply to message #118991] |
Mon, 23 February 2004 11:59  |
Eclipse User |
|
|
|
Originally posted by: phil.williams.toadmail.com
This is a multi-part message in MIME format.
--------------010701040206070209050008
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Thnx. I don't know if this is the best way to do things or not, but how
I solved the problem of dragging was to override the getActiveTool on my
new edit domain. If the tool was anything other than a selection tool I
just return null. If the active tool on the parent is a selection tool,
the I set the dragtracker of the tool to null. That way I isolate the
changes to my edit domain, which is what I am trying to accomplish. I
am hoping that I will not have to propagate lots of modifications down
to specific edit parts to make the model read only, and so far, that
seems to be working.
It will be awhile until I can move to 3.0 :( so for the time being I
will just simply hide the palette canvas.
Thank again,
Phil
Randy Hudson wrote:
> You could have your editparts return the SelectEditPartTracker to only
> allow selection, and not dragging. They would have to query the
> domain flag.
>
> As far as the palette, it is just an SWT canvas and you should be able
> to hide it using whatever techniques you want. Of course in 3.0 the
> palette will be a view, so I'm not sure what hiding will mean then.
> Hopefully there will be a programmatic way to hide views which aren't
> doing anything useful.
>
> "Phil Williams" <phil.williams@toadmail.com
> <mailto:phil.williams@toadmail.com>> wrote in message
> news:c1d8nv$b22$1@eclipse.org...
>
> Randy,
>
> OK, I would like to eat my words (a bit). The short answer to
> whether there is an easy way to accomplish this is yes. :-)
> Following your advice I have a ReadOnlyEditDomain that extends the
> default domain and add a readonly flag. I also extended the
> CommandStack with a ReadOnlyCommandStack that has a readOnly flag
> as well. When the flag is true, the execute() method simply
> returns and therefore, the commands are ignored.
>
> The next pointer that I need some assitance with is how to turn
> off all the visual ques that the user is getting. For instance,
> when the editor is in readOnly mode and I attempt to click and
> drag something in my editor, I still get the greybox during the
> drag. I also can still drag things from the palette and get the
> "add" icon. Is there an easy way via the edit domain perhaps,
> that I can turn off the visual ques?
>
> Thanks again,
> Phil
>
> Phil Williams wrote:
>
>> So I guess that the short answer was no. :-P
>>
>> I will start the investigation at the edit domain level and let
>> you all know what, if anything I find.
>>
>> What about the issue of hiding a palette? Is there an easy way
>> to do this? Not only do I not want to let the user modify the
>> model, but I also want to have the visual ques that it is not
>> editable as well, i.e. no palette.
>>
>> Thanks,
>> Phil
>>
>> Randy Hudson wrote:
>>
>>>This is an interesting problem. I would suggest handling it at the
>>>EditDomain level. Mark the editdomain as read-only. Also, you could
>>>intercept CommandStack#execute and prevent any model changes from happening.
>>>Let us know how you solve this, and open any bugzillas if you have proposed
>>>changes to facilitate.
>>>
>>>
>>>"Phil Williams" <phil.williams@toadmail.com> wrote in message
>>>news:c1cqvg$n8n$1@eclipse.org...
>>>
>>>
>>>>Is there a quick and easy way to open up a model in a read-only GEF
>>>>editor mode. The editor is going to be tied to an in-memory version of
>>>>my model and thus I can not simply set the read-only bit on the file.
>>>>
>>>>What I was thinking of doing was adding a read-only bit to my model
>>>>elements and then upon creation of the various edit parts check the flag
>>>>and not install any edit policies if it is set.
>>>>
>>>>I also am wondering if there is any way to hide the palette when I am in
>>>>a read-only mode.
>>>>
>>>>Has anyone here implemented a read-only strategy for a GEF Editor and if
>>>>so, how did you approach it?
>>>>
>>>>TIA,
>>>>Phil
>>>>
>>>>
>>>
>>>
>>>
>>>
--------------010701040206070209050008
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body>
Thnx. I don't know if this is the best way to do things or not, but
how I solved the problem of dragging was to override the getActiveTool
on my new edit domain. If the tool was anything other than a selection
tool I just return null. If the active tool on the parent is a
selection tool, the I set the dragtracker of the tool to null. That
way I isolate the changes to my edit domain, which is what I am trying
to accomplish. I am hoping that I will not have to propagate lots of
modifications down to specific edit parts to make the model read only,
and so far, that seems to be working.<br>
<br>
It will be awhile until I can move to 3.0 :( so for the time being I
will just simply hide the palette canvas.<br>
<br>
Thank again,<br>
Phil<br>
<br>
<br>
Randy Hudson wrote:<br>
<blockquote cite="midc1d9sn$co4$1@eclipse.org" type="cite">
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2800.1400" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">You could have your editparts return
the SelectEditPartTracker to only allow selection, and not dragging.
They would have to query the domain flag.</font></div>
<div> </div>
<div><font face="Arial" size="2">As far as the palette, it is just an
SWT canvas and you should be able to hide it using whatever techniques
you want. Of course in 3.0 the palette will be a view, so I'm not sure
what hiding will mean then. Hopefully there will be a programmatic way
to hide views which aren't doing anything useful.</font></div>
<div> </div>
<div>"Phil Williams" <<a href="mailto:phil.williams@toadmail.com">phil.williams@toadmail.com</a>>
wrote in message <a href="news:c1d8nv$b22$1@eclipse.org">news:c1d8nv$b22$1@eclipse.org</a>...</div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">Randy,<br>
<br>
OK, I would like to eat my words (a bit). The short answer to whether
there is an easy way to accomplish this is yes. :-) Following your
advice I have a ReadOnlyEditDomain that extends the default domain and
add a readonly flag. I also extended the CommandStack with a
ReadOnlyCommandStack that has a readOnly flag as well. When the flag
is true, the execute() method simply returns and therefore, the
commands are ignored.<br>
<br>
The next pointer that I need some assitance with is how to turn off all
the visual ques that the user is getting. For instance, when the
editor is in readOnly mode and I attempt to click and drag something in
my editor, I still get the greybox during the drag. I also can still
drag things from the palette and get the "add" icon. Is there an easy
way via the edit domain perhaps, that I can turn off the visual ques?<br>
<br>
Thanks again,<br>
Phil<br>
<br>
Phil Williams wrote:<br>
<blockquote cite="midc1d6kp$7tl$1@eclipse.org" type="cite">So I
guess that the short answer was no. <span class="moz-smiley-s4"><span>:-P
</span></span><br>
<br>
I will start the investigation at the edit domain level and let you all
know what, if anything I find.<br>
<br>
What about the issue of hiding a palette? Is there an easy way to do
this? Not only do I not want to let the user modify the model, but I
also want to have the visual ques that it is not editable as well, i.e.
no palette.<br>
<br>
Thanks,<br>
Phil<br>
<br>
Randy Hudson wrote:<br>
<blockquote cite="midc1d62v$71r$1@eclipse.org" type="cite">
<pre wrap="">This is an interesting problem. I would suggest handling it at the
EditDomain level. Mark the editdomain as read-only. Also, you could
intercept CommandStack#execute and prevent any model changes from happening.
Let us know how you solve this, and open any bugzillas if you have proposed
changes to facilitate.
"Phil Williams" <a class="moz-txt-link-rfc2396E"
href="mailto:phil.williams@toadmail.com"><phil.williams@toadmail.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:c1cqvg$n8n$1@eclipse.org">news:c1cqvg$n8n$1@eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Is there a quick and easy way to open up a model in a read-only GEF
editor mode. The editor is going to be tied to an in-memory version of
my model and thus I can not simply set the read-only bit on the file.
What I was thinking of doing was adding a read-only bit to my model
elements and then upon creation of the various edit parts check the flag
and not install any edit policies if it is set.
I also am wondering if there is any way to hide the palette when I am in
a read-only mode.
Has anyone here implemented a read-only strategy for a GEF Editor and if
so, how did you approach it?
TIA,
Phil
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>
--------------010701040206070209050008--
|
|
|
Goto Forum:
Current Time: Fri Jul 25 02:41:36 EDT 2025
Powered by FUDForum. Page generated in 0.05191 seconds
|