package net.sabi.pester; import danger.app.Event; import danger.ui.DateTimeEditor; import danger.util.DEBUG; public class AlarmTimeEditor extends DateTimeEditor implements Resources, Commands { public void takeFocus(boolean inFromAbove) { DEBUG.p("taking focus" + (inFromAbove ? " in from above" : "")); super.takeFocus(inFromAbove); } // XXX this is not working because we gain/lose focus moving through fields public void loseFocus() { DEBUG.p("losing focus"); if (isFocused()) DEBUG.p("had focus"); DEBUG.p("parent leaf was " + getParentContainer().getFocusedLeaf()); DEBUG.p("my leaf was " + getFocusedLeaf()); super.loseFocus(); if (isFocused()) DEBUG.p("still have focus"); DEBUG.p("parent leaf is " + getParentContainer().getFocusedLeaf()); DEBUG.p("my leaf is " + getFocusedLeaf()); DEBUG.p("sibling is " + getSibling()); Event event = getEvent(); event.type = EVENT_TIME_EDITOR_LOST_FOCUS; event.sendToTarget(); } }