Live Templates

  • $className$,当前类的类名;
  • $CURSOR$,编辑器的光标;
  1. private static class $className$Handler extends Handler {
  2. private final WeakReference<$className$> ref ;
  3. public $className$Handler($className$ target) {
  4. this.ref = new WeakReference<$className$>(target);
  5. }
  6. @Override
  7. public void handleMessage(Message msg) {
  8. $className$ target = ref.get();
  9. if (null == target) {
  10. return ;
  11. }
  12. target.$CURSOR$();
  13. }
  14. }