Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Feedback from Model regading disallowed actions
Feedback from Model regading disallowed actions [message #159176] Tue, 23 November 2004 05:13 Go to next message
Eclipse UserFriend
Originally posted by: ranjit.notMyId.com

My model container class checks if a child can be added to it.
Is there any way I can reflect that in the front end so that the child
part doesn't get added to the container part on the GEF canvas and
preferably pops up an error message (which will be sent by the model class).

I am guessing that I will have to override the addChild of the
AbstractEditPart corresponding to the container model class. I can then
check the validity of the child addition and accordingly just ignore
calling the super.addChild if the add is not allowed.
But I am still not sure how can I show the error feedback.
Any suggestions for me?

Thanks
Re: Feedback from Model regading disallowed actions [message #159222 is a reply to message #159176] Tue, 23 November 2004 16:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You should prevent these interactions earlier. Return an unexecutable
command instead of the default create. The feedback will be the NOT cursor.

"Ranjit" <ranjit@notMyId.com> wrote in message
news:cnugsq$a7d$1@www.eclipse.org...
> My model container class checks if a child can be added to it.
> Is there any way I can reflect that in the front end so that the child
> part doesn't get added to the container part on the GEF canvas and
> preferably pops up an error message (which will be sent by the model
class).
>
> I am guessing that I will have to override the addChild of the
> AbstractEditPart corresponding to the container model class. I can then
> check the validity of the child addition and accordingly just ignore
> calling the super.addChild if the add is not allowed.
> But I am still not sure how can I show the error feedback.
> Any suggestions for me?
>
> Thanks
Re: Feedback from Model regading disallowed actions [message #159254 is a reply to message #159222] Tue, 23 November 2004 18:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ranjit.notMyId.com

Hi Randy,

Thanks for the reply.
However, the only way I can check if a child can get added is during
runtime.
The container model would check for existing children and the new child to
be added and then decide if it can take in the new child.
Can you please give me some more detail about the unexecutable
command/default create that you mentioned?

Thanks.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:cnvop3$p52$1@www.eclipse.org...
> You should prevent these interactions earlier. Return an unexecutable
> command instead of the default create. The feedback will be the NOT
> cursor.
>
> "Ranjit" <ranjit@notMyId.com> wrote in message
> news:cnugsq$a7d$1@www.eclipse.org...
>> My model container class checks if a child can be added to it.
>> Is there any way I can reflect that in the front end so that the child
>> part doesn't get added to the container part on the GEF canvas and
>> preferably pops up an error message (which will be sent by the model
> class).
>>
>> I am guessing that I will have to override the addChild of the
>> AbstractEditPart corresponding to the container model class. I can then
>> check the validity of the child addition and accordingly just ignore
>> calling the super.addChild if the add is not allowed.
>> But I am still not sure how can I show the error feedback.
>> Any suggestions for me?
>>
>> Thanks
>
>
Re: Feedback from Model regading disallowed actions [message #159270 is a reply to message #159254] Tue, 23 November 2004 19:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

The EditPart (container in this case) typically has access to the model,
and can query it to find out if the child is acceptable during command
creation.


Ranjit wrote:
> Hi Randy,
>
> Thanks for the reply.
> However, the only way I can check if a child can get added is during
> runtime.
> The container model would check for existing children and the new child to
> be added and then decide if it can take in the new child.
> Can you please give me some more detail about the unexecutable
> command/default create that you mentioned?
>
> Thanks.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:cnvop3$p52$1@www.eclipse.org...
>
>>You should prevent these interactions earlier. Return an unexecutable
>>command instead of the default create. The feedback will be the NOT
>>cursor.
>>
>>"Ranjit" <ranjit@notMyId.com> wrote in message
>>news:cnugsq$a7d$1@www.eclipse.org...
>>
>>>My model container class checks if a child can be added to it.
>>>Is there any way I can reflect that in the front end so that the child
>>>part doesn't get added to the container part on the GEF canvas and
>>>preferably pops up an error message (which will be sent by the model
>>
>>class).
>>
>>>I am guessing that I will have to override the addChild of the
>>>AbstractEditPart corresponding to the container model class. I can then
>>>check the validity of the child addition and accordingly just ignore
>>>calling the super.addChild if the add is not allowed.
>>>But I am still not sure how can I show the error feedback.
>>>Any suggestions for me?
>>>
>>>Thanks
>>
>>
>
>


--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber."

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
Re: Feedback from Model regading disallowed actions [message #159277 is a reply to message #159254] Tue, 23 November 2004 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

In your create command, override canExecute and run the checks on the
container. A good model should support checking whether or not something
can be added without actually calling add() and catching some exception.

"Ranjit" <ranjit@notMyId.com> wrote in message
news:cnvufs$6hf$1@www.eclipse.org...
> Hi Randy,
>
> Thanks for the reply.
> However, the only way I can check if a child can get added is during
> runtime.
> The container model would check for existing children and the new child to
> be added and then decide if it can take in the new child.
> Can you please give me some more detail about the unexecutable
> command/default create that you mentioned?
>
> Thanks.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:cnvop3$p52$1@www.eclipse.org...
> > You should prevent these interactions earlier. Return an unexecutable
> > command instead of the default create. The feedback will be the NOT
> > cursor.
> >
> > "Ranjit" <ranjit@notMyId.com> wrote in message
> > news:cnugsq$a7d$1@www.eclipse.org...
> >> My model container class checks if a child can be added to it.
> >> Is there any way I can reflect that in the front end so that the child
> >> part doesn't get added to the container part on the GEF canvas and
> >> preferably pops up an error message (which will be sent by the model
> > class).
> >>
> >> I am guessing that I will have to override the addChild of the
> >> AbstractEditPart corresponding to the container model class. I can then
> >> check the validity of the child addition and accordingly just ignore
> >> calling the super.addChild if the add is not allowed.
> >> But I am still not sure how can I show the error feedback.
> >> Any suggestions for me?
> >>
> >> Thanks
> >
> >
>
>
Re: Feedback from Model regading disallowed actions [message #159285 is a reply to message #159277] Wed, 24 November 2004 00:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ranjit.notMyId.com

Thanks for the precise answer.
Infact my container does have a method that will tell if it can accept a
child of a particular type I was just not sure where to call it.
Now I do :), thanks again.

Randy Hudson wrote:
> In your create command, override canExecute and run the checks on the
> container. A good model should support checking whether or not something
> can be added without actually calling add() and catching some exception.
>
> "Ranjit" <ranjit@notMyId.com> wrote in message
> news:cnvufs$6hf$1@www.eclipse.org...
>
>>Hi Randy,
>>
>>Thanks for the reply.
>>However, the only way I can check if a child can get added is during
>>runtime.
>>The container model would check for existing children and the new child to
>>be added and then decide if it can take in the new child.
>>Can you please give me some more detail about the unexecutable
>>command/default create that you mentioned?
>>
>>Thanks.
>>
>>"Randy Hudson" <none@us.ibm.com> wrote in message
>>news:cnvop3$p52$1@www.eclipse.org...
>>
>>>You should prevent these interactions earlier. Return an unexecutable
>>>command instead of the default create. The feedback will be the NOT
>>>cursor.
>>>
>>>"Ranjit" <ranjit@notMyId.com> wrote in message
>>>news:cnugsq$a7d$1@www.eclipse.org...
>>>
>>>>My model container class checks if a child can be added to it.
>>>>Is there any way I can reflect that in the front end so that the child
>>>>part doesn't get added to the container part on the GEF canvas and
>>>>preferably pops up an error message (which will be sent by the model
>>>
>>>class).
>>>
>>>>I am guessing that I will have to override the addChild of the
>>>>AbstractEditPart corresponding to the container model class. I can then
>>>>check the validity of the child addition and accordingly just ignore
>>>>calling the super.addChild if the add is not allowed.
>>>>But I am still not sure how can I show the error feedback.
>>>>Any suggestions for me?
>>>>
>>>>Thanks
>>>
>>>
>>
>
>
Re: Feedback from Model regading disallowed actions [message #159293 is a reply to message #159270] Wed, 24 November 2004 00:08 Go to previous message
Eclipse UserFriend
Originally posted by: ranjit.notMyId.com

In fact that was precisely what I was think but was not sure where to do
the check. I get that I should do it in the command creation. thanks for
the pointer.

CL [dnoyeb] Gilbert wrote:
> The EditPart (container in this case) typically has access to the model,
> and can query it to find out if the child is acceptable during command
> creation.
>
>
> Ranjit wrote:
>
>> Hi Randy,
>>
>> Thanks for the reply.
>> However, the only way I can check if a child can get added is during
>> runtime.
>> The container model would check for existing children and the new
>> child to be added and then decide if it can take in the new child.
>> Can you please give me some more detail about the unexecutable
>> command/default create that you mentioned?
>>
>> Thanks.
>>
>> "Randy Hudson" <none@us.ibm.com> wrote in message
>> news:cnvop3$p52$1@www.eclipse.org...
>>
>>> You should prevent these interactions earlier. Return an unexecutable
>>> command instead of the default create. The feedback will be the NOT
>>> cursor.
>>>
>>> "Ranjit" <ranjit@notMyId.com> wrote in message
>>> news:cnugsq$a7d$1@www.eclipse.org...
>>>
>>>> My model container class checks if a child can be added to it.
>>>> Is there any way I can reflect that in the front end so that the child
>>>> part doesn't get added to the container part on the GEF canvas and
>>>> preferably pops up an error message (which will be sent by the model
>>>
>>>
>>> class).
>>>
>>>> I am guessing that I will have to override the addChild of the
>>>> AbstractEditPart corresponding to the container model class. I can then
>>>> check the validity of the child addition and accordingly just ignore
>>>> calling the super.addChild if the add is not allowed.
>>>> But I am still not sure how can I show the error feedback.
>>>> Any suggestions for me?
>>>>
>>>> Thanks
>>>
>>>
>>>
>>
>>
>
>
Previous Topic:gef plugin requirements
Next Topic:Embedding Texteditor into GEF?
Goto Forum:
  


Current Time: Sat Oct 19 11:52:18 GMT 2024

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

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

Back to the top