use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.
the class EActivityHolder method setOnStop.
private void setOnStop() {
onStopMethod = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onStop");
onStopMethod.annotate(Override.class);
JBlock body = onStopMethod.body();
onStopBeforeSuperBlock = body.blockSimple();
body.invoke(_super(), onStopMethod);
}
use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.
the class EActivityHolder method setFindSupportFragmentByTag.
@Override
protected void setFindSupportFragmentByTag() {
JMethod method;
if (getProcessingEnvironment().getElementUtils().getTypeElement(CanonicalNameConstants.ANDROIDX_FRAGMENT) == null) {
method = getGeneratedClass().method(PRIVATE, getClasses().SUPPORT_V4_FRAGMENT, "findSupportFragmentByTag");
} else {
method = getGeneratedClass().method(PRIVATE, getClasses().ANDROIDX_FRAGMENT, "findSupportFragmentByTag");
}
JVar tagParam = method.param(getClasses().STRING, "tag");
JBlock body = method.body();
body._return(invoke("getSupportFragmentManager").invoke("findFragmentByTag").arg(tagParam));
findSupportFragmentByTag = method;
}
use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.
the class EActivityHolder method setOnConfigurationChanged.
private void setOnConfigurationChanged() {
JMethod method = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onConfigurationChanged");
method.annotate(Override.class);
AbstractJClass configurationClass = getClasses().CONFIGURATION;
onConfigurationChangedNewConfigParam = method.param(configurationClass, "newConfig");
JBlock body = method.body();
onConfigurationChangedBeforeSuperBlock = body.blockSimple();
body.invoke(_super(), method).arg(onConfigurationChangedNewConfigParam);
onConfigurationChangedAfterSuperBlock = body.blockSimple();
}
use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.
the class EActivityHolder method setOnResume.
private void setOnResume() {
JMethod method = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onResume");
method.annotate(Override.class);
JBlock body = method.body();
onResumeBeforeSuperBlock = body.blockSimple();
body.invoke(_super(), method);
onResumeAfterSuperBlock = body.blockSimple();
}
use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.
the class EFragmentHolder method setInjectArgs.
private void setInjectArgs() {
injectArgsMethod = generatedClass.method(PRIVATE, getCodeModel().VOID, "injectFragmentArguments" + generationSuffix());
JBlock injectExtrasBody = injectArgsMethod.body();
injectBundleArgs = injectExtrasBody.decl(getClasses().BUNDLE, "args_", invoke("getArguments"));
injectArgsBlock = injectExtrasBody._if(injectBundleArgs.ne(_null()))._then();
getInitBodyInjectionBlock().invoke(injectArgsMethod);
}
Aggregations