use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnCreateView.
private void setOnCreateView() {
JMethod onCreateView = generatedClass.method(PUBLIC, getClasses().VIEW, "onCreateView");
onCreateView.annotate(Override.class);
inflater = onCreateView.param(getClasses().LAYOUT_INFLATER, "inflater");
container = onCreateView.param(getClasses().VIEW_GROUP, "container");
JVar savedInstanceState = onCreateView.param(getClasses().BUNDLE, "savedInstanceState");
boolean forceInjection = getAnnotatedElement().getAnnotation(EFragment.class).forceLayoutInjection();
JBlock body = onCreateView.body();
if (!forceInjection) {
body.assign(contentView, _super().invoke(onCreateView).arg(inflater).arg(container).arg(savedInstanceState));
}
setContentViewBlock = body.blockSimple();
body._return(contentView);
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnDetach.
private void setOnDetach() {
JMethod onDetach = generatedClass.method(PUBLIC, getCodeModel().VOID, "onDetach");
onDetach.annotate(Override.class);
JBlock onDetachBody = onDetach.body();
onDetachBeforeSuperBlock = onDetachBody.blockSimple();
onDetachBody.invoke(_super(), onDetach);
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnStart.
private void setOnStart() {
JMethod onStart = generatedClass.method(PUBLIC, getCodeModel().VOID, "onStart");
onStart.annotate(Override.class);
JBlock onStartBody = onStart.body();
onStartBody.invoke(_super(), onStart);
onStartAfterSuperBlock = onStartBody.blockSimple();
}
use of com.helger.jcodemodel.JMethod in project androidannotations by androidannotations.
the class EFragmentHolder method setOnViewCreated.
private void setOnViewCreated() {
JMethod onViewCreated = generatedClass.method(PUBLIC, getCodeModel().VOID, "onViewCreated");
onViewCreated.annotate(Override.class);
JVar view = onViewCreated.param(getClasses().VIEW, "view");
JVar savedInstanceState = onViewCreated.param(getClasses().BUNDLE, "savedInstanceState");
JBlock onViewCreatedBody = onViewCreated.body();
onViewCreatedBody.invoke(_super(), onViewCreated).arg(view).arg(savedInstanceState);
viewNotifierHelper.invokeViewChanged(onViewCreatedBody);
}
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));
}
Aggregations