From: Keith D. <kd...@cs...> - 2004-05-18 23:59:26
|
=20 =20 -----Original Message----- From: Keith Donald [mailto:kd...@cs...]=20 Sent: Tuesday, May 18, 2004 7:59 PM To: 'Achleitner Thomas' Subject: RE: [Springframework-rcp-dev] Spring-RCP enhancement: ReflectionbasedVisualAction Thomas, The global save and delete actions would be dynamic targetable visual actions. They would have _local_ action handlers that should get = registered when a view becomes active (if that view supports save/delete.) The = local action handler provides the context about whether the global action = should be enabled/disabled. So for example, let's say your protected documents are displayed in a = tree, and the tree is a component displayed in the active view. The user then selects a protected document in the tree by clicking on it. The local = view encapsulating the tree would receive the selection event, and know to = update the actionHandler for save/delete as 'disabled', which would = automatically trigger updates back to the global actions (in all places they may be = added to the GUI (menu bar, tool bar, etc.) - which would cause them to be = greyed out. I hope this helps - I just committed a bunch of enhancements to the view management and = action framework. This includes the initial code to track the active view and = to automatically register global action handlers at the appropriate times = in a view's lifecycle (on activation.) I am coding heavy in this area and = will be committing a bunch over the next few days. Keith -----Original Message----- From: Achleitner Thomas [mailto:ac...@ec...]=20 Sent: Wednesday, May 05, 2004 2:11 AM To: Keith Donald Subject: AW: [Springframework-rcp-dev] Spring-RCP enhancement: ReflectionbasedVisualAction Keith, If i would like to enable/disable multiple different actions (e.g. save = and delete should be disabled when a protected document is opened) after an action, should each if these actions be registered with the currently executed action (in our example open file)? thomas > -----Urspr=FCngliche Nachricht----- > Von: Keith Donald [mailto:kd...@cs...] > Gesendet: Mittwoch, 28. April 2004 00:06 > An: Achleitner Thomas > Betreff: RE: [Springframework-rcp-dev] Spring-RCP > enhancement: ReflectionbasedVisualAction >=20 > Thomas, >=20 > I'm beginning work on this support now --- see "DynamicActionHandler"=20 > -- I just committed it to rcp.action. > Basically the visual action will subscribe to dynamic action=20 > handlers for change notifications - one of the notifications=20 > being enabled/disabled state. So the idea is the code that=20 > owns the logic that controls when a particular action is=20 > enabled or disabled based on context simply fires a change=20 > event, which then triggers the visual action to update, which=20 > triggers any view items to update. >=20 > Now it's time to track the current active view, so when a view is=20 > activated, all global action handlers are automatically registered and = > subscribed-to for dynamic updates on enabled state. >=20 > Let me know what you think - Keith >=20 > Btw - didn't know you knew Juergen! He was sayin you guys are like 40=20 > km a part over there in Austria. >=20 >=20 > -----Original Message----- > From: Achleitner Thomas [mailto:ac...@ec...] > Sent: Tuesday, April 27, 2004 11:37 AM > To: Keith Donald > Subject: AW: [Springframework-rcp-dev] Spring-RCP enhancement: > ReflectionbasedVisualAction >=20 >=20 > Although we had no performance issues so far, the Checker strategy=20 > should be observed carefully. Maybe there could be a less __verbose__=20 > strategy reducing Checker runs. >=20 > A strategy based on active views sounds good. >=20 > thomas >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Keith Donald [mailto:kd...@cs...] > > Gesendet: Dienstag, 27. April 2004 17:01 > > An: Achleitner Thomas > > Betreff: RE: [Springframework-rcp-dev] Spring-RCP enhancement:=20 > > ReflectionbasedVisualAction > >=20 > >=20 > > Thomas, > >=20 > > I just checked these in, thanks. > >=20 > > I made a few small changes to ReflectionbasedVisualAction -> mainly > > just clarifying the variable/method names for readability, and I > > renamed the > > class to ReflectiveVisualAction. > >=20 > > BTW, is performance a issue at all with the EnabledChecker executing > > on every mouse and keyboard event? One thing I am planning on > > implementing is > > enabled/guard logic only on actions that are supported by the=20 > > "active" view > > (panel) in the application. That way if stuff isn't active,=20 > > it won't even > > be considered for enabled/disabled state. Eclipse has this=20 > > concept; I just > > haven't gotten there yet. :-) > >=20 > > Thanks again for the contribution - Keith > >=20 > > -----Original Message----- > > From: Achleitner Thomas [mailto:ac...@ec...] > > Sent: Tuesday, April 27, 2004 9:37 AM > > To: Keith Donald > > Subject: AW: [Springframework-rcp-dev] Spring-RCP enhancement: > > ReflectionbasedVisualAction > >=20 > >=20 > > Keith, here is an updated version (refactored out an > > AbstractVisualAction) that should work. > >=20 > > thomas > >=20 > > > -----Urspr=FCngliche Nachricht----- > > > Von: Keith Donald [mailto:kd...@cs...] > > > Gesendet: Dienstag, 27. April 2004 15:28 > > > An: Achleitner Thomas > > > Betreff: RE: [Springframework-rcp-dev] Spring-RCP enhancement: > > > ReflectionbasedVisualAction > > >=20 > > >=20 > > > Thanks Thomas - > > > Will definitely see how I can integrate this. > > >=20 > > > Thanks a lot! > > > Keith > > > =20 > > >=20 > > >=20 > > > -----Original Message----- > > > From: spr...@li... > > > [mailto:spr...@li...] > > > On Behalf Of > > > Achleitner Thomas > > > Sent: Tuesday, April 27, 2004 2:56 AM > > > To: spr...@li... > > > Subject: [Springframework-rcp-dev] Spring-RCP enhancement:=20 > > > ReflectionbasedVisualAction > > >=20 > > >=20 > > > Hi Keith! > > >=20 > > > I had a closer look at ActionHandler and DefaultVisualAction. I=20 > > > compared it with our existing implementation, where we have a=20 > > > concrete Action class based on a pair of method names (action and > > > guard) that will be > > > executed on the action handler via reflection api. > > >=20 > > > What i did now was that i ported our code to a new class > > > org.springframework.rcp.action.ReflectionbasedVisualAction > > extending > > > DefaultVisualAction. > > >=20 > > > Class ReflectionbasedVisualAction provides a "call by name"=20 > > > mechanism for invoking methods and automatic checking of the=20 > > > isEnabled state by means of calling the guard actionMethod.=20 > > > Checking the isEnabled state of an action is > > > performed automatically in the background (triggered by=20 > > input events). > > >=20 > > > To get it working i had to create a public getter in > > > DefaultVisualAction: getActionHandler. > > >=20 > > > I attached the source file. Maybe you can make any use of > > it. For more > > > details see the class comment. > > >=20 > > > thomas > > >=20 > > >=20 > >=20 > >=20 >=20 >=20 >=20 |