Skip to main content



      Home
Home » Eclipse Projects » GEF » Routing Requests _ help needed
Routing Requests _ help needed [message #165456] Tue, 25 January 2005 09:30 Go to next message
Eclipse UserFriend
Originally posted by: swaroop_rks.rediffmail.com

Hi ,

I understand that Request class being a normal java class can be
programmaticaly generated .I am interested in knowing the mechanism using
which a Request is passed on to the EditPolicy or EditPart concerned. I
would like to know the order of precedence (whether policy comes first or
part acts first).
Re: Routing Requests _ help needed [message #165489 is a reply to message #165456] Tue, 25 January 2005 10:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

EditPolicies use the not-yet-famous "pool of responsibility" pattern. All
policies have a chance to participate, in the order in which their keys were
added to the editpart.

"swaroop" <swaroop_rks@rediffmail.com> wrote in message
news:ct5l5f$mf7$1@www.eclipse.org...
> Hi ,
>
> I understand that Request class being a normal java class can be
> programmaticaly generated .I am interested in knowing the mechanism using
> which a Request is passed on to the EditPolicy or EditPart concerned. I
> would like to know the order of precedence (whether policy comes first or
> part acts first).
>
>
>
>
>
Re: Routing Requests _ help needed [message #165524 is a reply to message #165489] Tue, 25 January 2005 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kevinlouisnospam.hotmail.com

Is there any article about this "Pool of Responsibility" pattern?

Thanks,

Kevin

"Randy Hudson" <none@us.ibm.com> wrote in message
news:ct5prf$cs2$1@www.eclipse.org...
> EditPolicies use the not-yet-famous "pool of responsibility" pattern. All
> policies have a chance to participate, in the order in which their keys
were
> added to the editpart.
>
> "swaroop" <swaroop_rks@rediffmail.com> wrote in message
> news:ct5l5f$mf7$1@www.eclipse.org...
> > Hi ,
> >
> > I understand that Request class being a normal java class can be
> > programmaticaly generated .I am interested in knowing the mechanism
using
> > which a Request is passed on to the EditPolicy or EditPart concerned. I
> > would like to know the order of precedence (whether policy comes first
or
> > part acts first).
> >
> >
> >
> >
> >
>
>
Re: Routing Requests _ help needed [message #165540 is a reply to message #165524] Tue, 25 January 2005 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

No, I was just alluding to the "Chain of Responsibility" pattern in the GoF
book. The code (i.e. getCommand) is the best documentation.

"Kevin" <kevinlouisnospam@hotmail.com> wrote in message
news:ct60bj$efo$1@www.eclipse.org...
> Is there any article about this "Pool of Responsibility" pattern?
>
> Thanks,
>
> Kevin
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:ct5prf$cs2$1@www.eclipse.org...
>> EditPolicies use the not-yet-famous "pool of responsibility" pattern.
>> All
>> policies have a chance to participate, in the order in which their keys
> were
>> added to the editpart.
>>
>> "swaroop" <swaroop_rks@rediffmail.com> wrote in message
>> news:ct5l5f$mf7$1@www.eclipse.org...
>> > Hi ,
>> >
>> > I understand that Request class being a normal java class can be
>> > programmaticaly generated .I am interested in knowing the mechanism
> using
>> > which a Request is passed on to the EditPolicy or EditPart concerned. I
>> > would like to know the order of precedence (whether policy comes first
> or
>> > part acts first).
>> >
>> >
>> >
>> >
>> >
>>
>>
>
>
Re: Routing Requests _ help needed - question elaborated [message #165858 is a reply to message #165540] Thu, 27 January 2005 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: swaroop_rks.rediffmail.com

Thanks for replying,

I would like to elaborate my requirement ,so that i would be more
benifitted from the form .

We have a editor which requires a figure(lets call MyTabcontrol ) which is
similar to TabFolder of SWT. there is a minor modification in that the
MyTabcontrol is a dynamic one , the addition and deletion of tabpanes is
supported .We have implemented all this.(explained below at the end).

We have a problem while switching between tabs , though the tab required
is getting shown - the corresponding part is not being highlighted
(selected) (the highlighting behaviour is provided by overridding
SelectionEditPolicy).

Is there any mechanism to do this ?,
I intially thought activating the editpart would be sufficient , but i was
proven wrong(Note: i installed my editpolicies,and have'nt taken care of
activating or erasing editpolicies as we do with propertyListeners on
actiavate()/deactivate() .may be partly due to the fact that the mouse
cursor is present on some other part so a Selection Request is being
raised on that figure , but still there is no indication of showSelected()
of EditPolicy being triggered

Now the only thing that comes to my mind is to generate a Selection
Request and use the same in a programmatic way (i do'nt know how user
action on editor get translated to requests , but should i really know
them ! :) I thought it was intended to be transparent ), Now that a
Request is available how should i pass it over to editpart or editpolicy
of the concerned MyTabControl ?.

Description of MyTabControl:

Please read this if you need , the major problem is already given to you ,
this is the description of context in which i perceived the need

It has a (base)RectangularFigure with two constituent (child
Figures)RectangularFigures as children,

the first child figure has a toolbarlayout with horizontal orientation and
acts as a buttonHolder (takes customised Buttons extending Button
figure).The buttons do'nt have model or editparts they are figures alone

the second figure has a stacklayout ,
All the figures corresponding to the child parts are added over here ,(I
have overridden the addFigure() method of MyTabControlFigure to achieve
this).

The user adds(drags )a certain part(or Model I am not sure) on to the
MyTabcontrol from palette .this generates Request and the added
(part)Figure is shown as selected , (shown as per the Selection EditPolicy)

automatically i add a button figure in button holder rectangle of
base.(done programatically).It gives a look and feel of something close to
Tabcontrol

A no: of such Tabs can be added.when a button in Button Figure holder is
clicked the corresponding Tabfigure is shown on top in the StackHolder
(only this Tab part is made active others are deactivated).

Though the switching is successfully carried out the selection is not
being shown as in the case of part addition for the first time,(only
difference being that no new additions are done to model's children and
hence no new part is generated , but some exisitng part is activated and
corresponding figure is added ,(after removing old figure ofCourse). The
other change we have done is to call add and removeNotify() on editparts
while activating and deactivitaing ,so that connectionFigures don't
persist.

when i clilck onthe button Mousepointer is present on MyTabcontrol part
not on new case that is activated, here i need the new part to be
activated so that the user can see which part is active and if needed can
delete it using the delete Action

Uuuhhhh...........pretty long ,lengthy (and cumbersome !) , Please correct
me if i am wrong any where or whther there are any better alternatives to
the above.Thanks in advance for patiently reading this.
Re: Routing Requests _ help needed - DONE ! [message #165875 is a reply to message #165456] Thu, 27 January 2005 06:18 Go to previous message
Eclipse UserFriend
Originally posted by: swaroop_rks.rediffmail.com

randy and others ,thanks for responding ,

I got through my requirement by using the selected(EditPart) of the
EditPartviewer , No need to mess with Request objects, I think i was
thinking on wrong lines , It was far more simply done
Previous Topic:applet
Next Topic:Rendering AWT graphics in a Figure
Goto Forum:
  


Current Time: Fri Jun 20 22:05:20 EDT 2025

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

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

Back to the top