use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EActivityHolder method setOnCreateOptionsMenu.
private void setOnCreateOptionsMenu() {
JMethod method = generatedClass.method(PUBLIC, getCodeModel().BOOLEAN, "onCreateOptionsMenu");
method.annotate(Override.class);
JBlock methodBody = method.body();
onCreateOptionsMenuMenuParam = method.param(getClasses().MENU, "menu");
onCreateOptionsMenuMenuInflaterVar = methodBody.decl(getClasses().MENU_INFLATER, "menuInflater", invoke("getMenuInflater"));
onCreateOptionsMenuMethodInflateBody = methodBody.blockSimple();
onCreateOptionsMenuMethodBody = methodBody.blockSimple();
methodBody._return(_super().invoke(method).arg(onCreateOptionsMenuMenuParam));
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EActivityHolder method setOnPause.
private void setOnPause() {
JMethod method = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onPause");
method.annotate(Override.class);
JBlock body = method.body();
onPauseBeforeSuperBlock = body.blockSimple();
body.invoke(_super(), method);
onPauseAfterSuperBlock = body.blockSimple();
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EActivityHolder method setFindSupportFragmentById.
@Override
protected void setFindSupportFragmentById() {
JMethod method = generatedClass.method(PRIVATE, getClasses().SUPPORT_V4_FRAGMENT, "findSupportFragmentById");
JVar idParam = method.param(getCodeModel().INT, "id");
JBlock body = method.body();
body._return(invoke("getSupportFragmentManager").invoke("findFragmentById").arg(idParam));
findSupportFragmentById = method;
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EActivityHolder method setOnRestart.
private void setOnRestart() {
JMethod method = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onRestart");
method.annotate(Override.class);
JBlock body = method.body();
onRestartBeforeSuperBlock = body.blockSimple();
body.invoke(_super(), method);
onRestartAfterSuperBlock = body.blockSimple();
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EActivityHolder method setFindNativeFragmentById.
@Override
protected void setFindNativeFragmentById() {
JMethod method = generatedClass.method(PRIVATE, getClasses().FRAGMENT, "findNativeFragmentById");
JVar idParam = method.param(getCodeModel().INT, "id");
JBlock body = method.body();
body._return(invoke("getFragmentManager").invoke("findFragmentById").arg(idParam));
findNativeFragmentById = method;
}
Aggregations