use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnOptionsItemSelected.
private void setOnOptionsItemSelected() {
JMethod method = generatedClass.method(JMod.PUBLIC, getCodeModel().BOOLEAN, "onOptionsItemSelected");
method.annotate(Override.class);
JBlock methodBody = method.body();
onOptionsItemSelectedItem = method.param(getClasses().MENU_ITEM, "item");
onOptionsItemSelectedItemId = methodBody.decl(getCodeModel().INT, "itemId_", onOptionsItemSelectedItem.invoke("getItemId"));
onOptionsItemSelectedMiddleBlock = methodBody.blockSimple();
methodBody._return(invoke(_super(), method).arg(onOptionsItemSelectedItem));
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnCreate.
private void setOnCreate() {
JMethod onCreate = generatedClass.method(PUBLIC, getCodeModel().VOID, "onCreate");
onCreate.annotate(Override.class);
JVar onCreateSavedInstanceState = onCreate.param(getClasses().BUNDLE, "savedInstanceState");
JBlock onCreateBody = onCreate.body();
JVar previousNotifier = viewNotifierHelper.replacePreviousNotifier(onCreateBody);
setFindViewById();
onCreateBody.invoke(getInit()).arg(onCreateSavedInstanceState);
onCreateBody.invoke(_super(), onCreate).arg(onCreateSavedInstanceState);
onCreateAfterSuperBlock = onCreateBody.blockSimple();
viewNotifierHelper.resetPreviousNotifier(onCreateBody, previousNotifier);
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setFindViewById.
private void setFindViewById() {
JMethod findViewById = generatedClass.method(PUBLIC, getClasses().VIEW, "findViewById");
findViewById.annotate(Override.class);
JVar idParam = findViewById.param(getCodeModel().INT, "id");
JBlock body = findViewById.body();
JFieldVar contentView = getContentView();
//
body._if(contentView.eq(_null()))._then()._return(_null());
body._return(contentView.invoke(findViewById).arg(idParam));
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnCreateOptionsMenu.
private void setOnCreateOptionsMenu() {
JMethod method = generatedClass.method(PUBLIC, getCodeModel().VOID, "onCreateOptionsMenu");
method.annotate(Override.class);
JBlock methodBody = method.body();
onCreateOptionsMenuMenuParam = method.param(getClasses().MENU, "menu");
onCreateOptionsMenuMenuInflaterVar = method.param(getClasses().MENU_INFLATER, "inflater");
onCreateOptionsMenuMethodInflateBody = methodBody.blockSimple();
onCreateOptionsMenuMethodBody = methodBody.blockSimple();
methodBody.invoke(_super(), method).arg(onCreateOptionsMenuMenuParam).arg(onCreateOptionsMenuMenuInflaterVar);
getInitBody().invoke("setHasOptionsMenu").arg(JExpr.TRUE);
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EActivityHolder method setOnStart.
// CHECKSTYLE:OFF
private void setOnStart() {
JMethod method = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onStart");
method.annotate(Override.class);
JBlock body = method.body();
onStartBeforeSuperBlock = body.blockSimple();
body.invoke(_super(), method);
onStartAfterSuperBlock = body.blockSimple();
}
Aggregations