• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
EOWidgetController actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EOWidgetController actions


  • Subject: EOWidgetController actions
  • From: Rob Caljouw <email@hidden>
  • Date: Mon, 24 Mar 2003 21:33:44 -0500

Hi,

I'm trying to add actions to a EOWidgetController.  I've been overriding
defaultActions and canPerformActionPerformed as described in Java Client
Desktop Applications (Adding Custom Actions to Controllers).

The widget works fine on the screen but no actions seem to be called.

This is the code I'm using:

public class CustomDateController extends EOWidgetController{

    public DatePicker dp;
    public EOXMLUnarchiver unarchiver;

    public CustomDateController(EOXMLUnarchiver unarchiver) {
        super(unarchiver);
        this.unarchiver = unarchiver;
    }
    protected JComponent newWidget() {
        dp = new DatePicker();
        return dp;
    }
    public NSArray defaultActions() {
        NSMutableArray actions = new NSMutableArray();
        actions.addObject(EOAction.actionForControllerHierarchy("setValue",
"Set Value", "Set Value", null, null, null, 300, 50, false));
        return EOAction.mergedActions(actions, super.defaultActions());
    }
    public void setValue() {
        EOGenericRecord theEntity = (EOGenericRecord)
unarchiver.decodeValueForKey("entity.name");
        theEntity.takeValueForKey((Object)dp.getDateString(),
(String)unarchiver.decodeValueForKey("attribute.name"));
    }
    public boolean canPerformActionNamed(String actionName) {
        return actionName.equals("setValue") ||
super.canPerformActionNamed(actionName);
    }
}

Thanks in advance for any suggestions.

- Rob
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: EOWidgetController (From: Rob Caljouw <email@hidden>)

  • Prev by Date: Timestamp.java 's setNanos()
  • Next by Date: Newbe question
  • Previous by thread: Re: EOWidgetController
  • Next by thread: Timestamp.java 's setNanos()
  • Index(es):
    • Date
    • Thread