Home » Eclipse Projects » GEF » How can I enable/disable certain parts of my editor ?
| How can I enable/disable certain parts of my editor ? [message #83495] |
Wed, 11 June 2003 17:57  |
Eclipse User |
|
|
|
Originally posted by: DjShark.softhome.net
Hello again good people,
My editor extends GraphicalEditorWithPalette and I also use a toolbar of
supported actions. Some of my actions run certain tests on my models in the
editor, and therefore I wish to cause some of the actions (such as adding
new nodes, connections or deleting them) both from the palette and the
toolbar - to be disabled during those tests (and enabled when the tests are
done). In other words, what is the best way to cause my editor to be
"read-only" at certain times ?
Thanks in advance,
Dj Shark
|
|
| |
| Re: How can I enable/disable certain parts of my editor ? [message #83978 is a reply to message #83811] |
Mon, 16 June 2003 14:35   |
Eclipse User |
|
|
|
Originally posted by: DjShark.softhome.net
Hello again Eric,
Thanks for the tips, I did manage to disable/enable the needed actions in
the toolbar, however I still face two problems:
1. During the mentioned tests, I wish to cause my whole Graphical Editor to
be "read-only" -> no Drag n' drop allowed and no modifying the current
editparts (like changing their location or size), what method should be
called (possibly from the graphical editor itself) to acheive this ?
2. I did manage to "reach" the pallete - but I can only get the tool
entries, and not the tools themselves - I tried all the methods that exist
in the tool entries classes (like setVisable, or
setUserModificationPermission) but the tools themselves are still enabled (I
can create new nodes and connections).
Perhaps if I were to be able to force my graphical editor to be "read-only",
then the tools themselves wouldn't work. Or maybe there is a way to get the
tool from the tool entry ?
Thanks again for all your help,
Dj Shark
"Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
news:bcd3n4$op3$2@rogue.oti.com...
> One thing you can do is show a progress monitor during the operation that
blocks
> on your test. The downside to this is the entire workbench will be
unavailable.
>
> Maybe there's a way to get the ActionRegistry and disable the actions
before
> running the test and then enabling them afterwards. As for the palette,
I'd
> have to look into it more.
>
> How about putting a boolean in your model that can turn the read/write
state on
> and off?
>
> This is just me throwing out ideas. I'm not sure what the best way would
be.
> If I come across something, I'll post another reply.
>
> Eric
>
>
> Dj Shark wrote:
>
> > Hello again good people,
> > My editor extends GraphicalEditorWithPalette and I also use a toolbar of
> > supported actions. Some of my actions run certain tests on my models in
the
> > editor, and therefore I wish to cause some of the actions (such as
adding
> > new nodes, connections or deleting them) both from the palette and the
> > toolbar - to be disabled during those tests (and enabled when the tests
are
> > done). In other words, what is the best way to cause my editor to be
> > "read-only" at certain times ?
> >
> > Thanks in advance,
> >
> > Dj Shark
> >
> >
>
|
|
|
| Re: How can I enable/disable certain parts of my editor ? [message #83993 is a reply to message #83978] |
Mon, 16 June 2003 16:28   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
"Dj Shark" <DjShark@softhome.net> wrote in message
news:bckv64$isd$1@rogue.oti.com...
> Hello again Eric,
>
> Thanks for the tips, I did manage to disable/enable the needed actions in
> the toolbar, however I still face two problems:
>
> 1. During the mentioned tests, I wish to cause my whole Graphical Editor
to
> be "read-only" -> no Drag n' drop allowed and no modifying the current
> editparts (like changing their location or size), what method should be
> called (possibly from the graphical editor itself) to acheive this ?
Maybe you could do this centrally by extending EditDomain to have
isReadOnly(), and add the necessary checks everywhere.
Or by telling the CommandStack not to execute any commands.
> 2. I did manage to "reach" the pallete - but I can only get the tool
> entries, and not the tools themselves - I tried all the methods that exist
> in the tool entries classes (like setVisable, or
> setUserModificationPermission) but the tools themselves are still enabled
(I
> can create new nodes and connections).
> Perhaps if I were to be able to force my graphical editor to be
"read-only",
> then the tools themselves wouldn't work. Or maybe there is a way to get
the
> tool from the tool entry ?
You can disable the entire SWT Control by calling Control.setEnabled(false).
I'm just wondering, if you are running a test, why do expect someone to be
clicking the mouse?
>
> Thanks again for all your help,
>
> Dj Shark
>
> "Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
> news:bcd3n4$op3$2@rogue.oti.com...
> > One thing you can do is show a progress monitor during the operation
that
> blocks
> > on your test. The downside to this is the entire workbench will be
> unavailable.
> >
> > Maybe there's a way to get the ActionRegistry and disable the actions
> before
> > running the test and then enabling them afterwards. As for the palette,
> I'd
> > have to look into it more.
> >
> > How about putting a boolean in your model that can turn the read/write
> state on
> > and off?
> >
> > This is just me throwing out ideas. I'm not sure what the best way
would
> be.
> > If I come across something, I'll post another reply.
> >
> > Eric
> >
> >
> > Dj Shark wrote:
> >
> > > Hello again good people,
> > > My editor extends GraphicalEditorWithPalette and I also use a toolbar
of
> > > supported actions. Some of my actions run certain tests on my models
in
> the
> > > editor, and therefore I wish to cause some of the actions (such as
> adding
> > > new nodes, connections or deleting them) both from the palette and the
> > > toolbar - to be disabled during those tests (and enabled when the
tests
> are
> > > done). In other words, what is the best way to cause my editor to be
> > > "read-only" at certain times ?
> > >
> > > Thanks in advance,
> > >
> > > Dj Shark
> > >
> > >
> >
>
>
|
|
|
| Re: How can I enable/disable certain parts of my editor ? [message #84008 is a reply to message #83993] |
Mon, 16 June 2003 18:05  |
Eclipse User |
|
|
|
Originally posted by: DjShark.softhome.net
Hello Randy,
Unfortunately, extending EditDomain is not an option.
In addition, since I do not see any public method in class CommandStack that
allows me to disable the commands (like: canExecute(false)) - I assume your
solution is the same principle as the solution of extending EditDomain, and
therefore it too isn't an option.
Regarding Control.setEnabled(false) - I tried that doing the following from
my graphical editor: I get the editor's graphical viewer, from it I get the
control and to that control I do disable.
It works fine (it "freezes" the entire canvas area); Though, I am a little
greedy: Is there a way to disable all editing actions/tools, but still allow
those which are non-editing such as the scroll pane to be active ? Or even
allow the user to select any of the nodes and connections - but not change
any of their properties like size, location, etc. Or delete them, or copy &
paste, etc. ?
Btw, Even after the "freeze" I'm still able to use my outline for
navigation - which is desired, since it's a non-editing action...
Regarding the tests -> These tests are actions on a special bar that "my
client" can run when he or she wants to. I assume I have an adversary
client, who may wish to delibrately try to edit whilst running the tests,
thus causing instability or worse...(Example: a test that checks if all
nodes are alligned - the test is run in animation (You see the editor
highlight each node it passes - this shows that test's progress), if the
user can still move the nodes while the test progresses, then that test is
useless. On the other hand, I do want the user to
see the animation (and not just progress bar...).
Thanks for all the help,
Dj Shark
"Randy Hudson" <none@us.ibm.com> wrote in message
news:bcl9ad$s01$1@rogue.oti.com...
>
> "Dj Shark" <DjShark@softhome.net> wrote in message
> news:bckv64$isd$1@rogue.oti.com...
> > Hello again Eric,
> >
> > Thanks for the tips, I did manage to disable/enable the needed actions
in
> > the toolbar, however I still face two problems:
> >
> > 1. During the mentioned tests, I wish to cause my whole Graphical Editor
> to
> > be "read-only" -> no Drag n' drop allowed and no modifying the current
> > editparts (like changing their location or size), what method should be
> > called (possibly from the graphical editor itself) to acheive this ?
>
> Maybe you could do this centrally by extending EditDomain to have
> isReadOnly(), and add the necessary checks everywhere.
> Or by telling the CommandStack not to execute any commands.
>
> > 2. I did manage to "reach" the pallete - but I can only get the tool
> > entries, and not the tools themselves - I tried all the methods that
exist
> > in the tool entries classes (like setVisable, or
> > setUserModificationPermission) but the tools themselves are still
enabled
> (I
> > can create new nodes and connections).
> > Perhaps if I were to be able to force my graphical editor to be
> "read-only",
> > then the tools themselves wouldn't work. Or maybe there is a way to get
> the
> > tool from the tool entry ?
>
> You can disable the entire SWT Control by calling
Control.setEnabled(false).
> I'm just wondering, if you are running a test, why do expect someone to be
> clicking the mouse?
>
> >
> > Thanks again for all your help,
> >
> > Dj Shark
> >
> > "Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
> > news:bcd3n4$op3$2@rogue.oti.com...
> > > One thing you can do is show a progress monitor during the operation
> that
> > blocks
> > > on your test. The downside to this is the entire workbench will be
> > unavailable.
> > >
> > > Maybe there's a way to get the ActionRegistry and disable the actions
> > before
> > > running the test and then enabling them afterwards. As for the
palette,
> > I'd
> > > have to look into it more.
> > >
> > > How about putting a boolean in your model that can turn the read/write
> > state on
> > > and off?
> > >
> > > This is just me throwing out ideas. I'm not sure what the best way
> would
> > be.
> > > If I come across something, I'll post another reply.
> > >
> > > Eric
> > >
> > >
> > > Dj Shark wrote:
> > >
> > > > Hello again good people,
> > > > My editor extends GraphicalEditorWithPalette and I also use a
toolbar
> of
> > > > supported actions. Some of my actions run certain tests on my models
> in
> > the
> > > > editor, and therefore I wish to cause some of the actions (such as
> > adding
> > > > new nodes, connections or deleting them) both from the palette and
the
> > > > toolbar - to be disabled during those tests (and enabled when the
> tests
> > are
> > > > done). In other words, what is the best way to cause my editor to be
> > > > "read-only" at certain times ?
> > > >
> > > > Thanks in advance,
> > > >
> > > > Dj Shark
> > > >
> > > >
> > >
> >
> >
>
>
|
|
|
| Re: How can I enable/disable certain parts of my editor ? [message #84022 is a reply to message #84008] |
Mon, 16 June 2003 17:16  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Why can't you extend EditDomain or the CommandStack?
"Dj Shark" <DjShark@softhome.net> wrote in message
news:bclbep$u1p$1@rogue.oti.com...
> Hello Randy,
> Unfortunately, extending EditDomain is not an option.
> In addition, since I do not see any public method in class CommandStack
that
> allows me to disable the commands (like: canExecute(false)) - I assume
your
> solution is the same principle as the solution of extending EditDomain,
and
> therefore it too isn't an option.
>
> Regarding Control.setEnabled(false) - I tried that doing the following
from
> my graphical editor: I get the editor's graphical viewer, from it I get
the
> control and to that control I do disable.
> It works fine (it "freezes" the entire canvas area); Though, I am a little
> greedy: Is there a way to disable all editing actions/tools, but still
allow
> those which are non-editing such as the scroll pane to be active ? Or even
> allow the user to select any of the nodes and connections - but not change
> any of their properties like size, location, etc. Or delete them, or copy
&
> paste, etc. ?
>
> Btw, Even after the "freeze" I'm still able to use my outline for
> navigation - which is desired, since it's a non-editing action...
>
> Regarding the tests -> These tests are actions on a special bar that "my
> client" can run when he or she wants to. I assume I have an adversary
> client, who may wish to delibrately try to edit whilst running the tests,
> thus causing instability or worse...(Example: a test that checks if all
> nodes are alligned - the test is run in animation (You see the editor
> highlight each node it passes - this shows that test's progress), if the
> user can still move the nodes while the test progresses, then that test
is
> useless. On the other hand, I do want the user to
> see the animation (and not just progress bar...).
>
> Thanks for all the help,
> Dj Shark
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:bcl9ad$s01$1@rogue.oti.com...
> >
> > "Dj Shark" <DjShark@softhome.net> wrote in message
> > news:bckv64$isd$1@rogue.oti.com...
> > > Hello again Eric,
> > >
> > > Thanks for the tips, I did manage to disable/enable the needed actions
> in
> > > the toolbar, however I still face two problems:
> > >
> > > 1. During the mentioned tests, I wish to cause my whole Graphical
Editor
> > to
> > > be "read-only" -> no Drag n' drop allowed and no modifying the current
> > > editparts (like changing their location or size), what method should
be
> > > called (possibly from the graphical editor itself) to acheive this ?
> >
> > Maybe you could do this centrally by extending EditDomain to have
> > isReadOnly(), and add the necessary checks everywhere.
> > Or by telling the CommandStack not to execute any commands.
> >
> > > 2. I did manage to "reach" the pallete - but I can only get the tool
> > > entries, and not the tools themselves - I tried all the methods that
> exist
> > > in the tool entries classes (like setVisable, or
> > > setUserModificationPermission) but the tools themselves are still
> enabled
> > (I
> > > can create new nodes and connections).
> > > Perhaps if I were to be able to force my graphical editor to be
> > "read-only",
> > > then the tools themselves wouldn't work. Or maybe there is a way to
get
> > the
> > > tool from the tool entry ?
> >
> > You can disable the entire SWT Control by calling
> Control.setEnabled(false).
> > I'm just wondering, if you are running a test, why do expect someone to
be
> > clicking the mouse?
> >
> > >
> > > Thanks again for all your help,
> > >
> > > Dj Shark
> > >
> > > "Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
> > > news:bcd3n4$op3$2@rogue.oti.com...
> > > > One thing you can do is show a progress monitor during the operation
> > that
> > > blocks
> > > > on your test. The downside to this is the entire workbench will be
> > > unavailable.
> > > >
> > > > Maybe there's a way to get the ActionRegistry and disable the
actions
> > > before
> > > > running the test and then enabling them afterwards. As for the
> palette,
> > > I'd
> > > > have to look into it more.
> > > >
> > > > How about putting a boolean in your model that can turn the
read/write
> > > state on
> > > > and off?
> > > >
> > > > This is just me throwing out ideas. I'm not sure what the best way
> > would
> > > be.
> > > > If I come across something, I'll post another reply.
> > > >
> > > > Eric
> > > >
> > > >
> > > > Dj Shark wrote:
> > > >
> > > > > Hello again good people,
> > > > > My editor extends GraphicalEditorWithPalette and I also use a
> toolbar
> > of
> > > > > supported actions. Some of my actions run certain tests on my
models
> > in
> > > the
> > > > > editor, and therefore I wish to cause some of the actions (such as
> > > adding
> > > > > new nodes, connections or deleting them) both from the palette and
> the
> > > > > toolbar - to be disabled during those tests (and enabled when the
> > tests
> > > are
> > > > > done). In other words, what is the best way to cause my editor to
be
> > > > > "read-only" at certain times ?
> > > > >
> > > > > Thanks in advance,
> > > > >
> > > > > Dj Shark
> > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
| Re: How can I enable/disable certain parts of my editor ? [message #84037 is a reply to message #84008] |
Mon, 16 June 2003 17:19  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> Regarding the tests -> These tests are actions on a special bar that "my
> client" can run when he or she wants to. I assume I have an adversary
> client, who may wish to delibrately try to edit whilst running the tests,
> thus causing instability or worse...(Example: a test that checks if all
> nodes are alligned - the test is run in animation (You see the editor
> highlight each node it passes - this shows that test's progress), if the
> user can still move the nodes while the test progresses, then that test
is
> useless. On the other hand, I do want the user to
> see the animation (and not just progress bar...).
Test could add itself as a listener to the CommandStack. If the user does
anything, the test will be notified of the change. I don't think you can do
any better, given the presence of popup menus, toolbar actions, and key
accelerators.
|
|
|
Goto Forum:
Current Time: Fri Nov 07 14:17:04 EST 2025
Powered by FUDForum. Page generated in 0.04312 seconds
|