Search in sources :

Example 81 with JBlock

use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.

the class EFragmentHolder method setOnDestroyView.

private void setOnDestroyView() {
    JMethod onDestroyView = generatedClass.method(PUBLIC, getCodeModel().VOID, "onDestroyView");
    onDestroyView.annotate(Override.class);
    JBlock body = onDestroyView.body();
    body.invoke(_super(), onDestroyView);
    body.assign(contentView, _null());
    onDestroyViewAfterSuperBlock = body.blockSimple();
}
Also used : JBlock(com.helger.jcodemodel.JBlock) JMethod(com.helger.jcodemodel.JMethod)

Example 82 with JBlock

use of com.helger.jcodemodel.JBlock 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));
}
Also used : JBlock(com.helger.jcodemodel.JBlock) JMethod(com.helger.jcodemodel.JMethod)

Example 83 with JBlock

use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.

the class EActivityHolder method setOnNewIntent.

private void setOnNewIntent() {
    onNewIntentMethod = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onNewIntent");
    onNewIntentMethod.annotate(Override.class);
    JVar intent = onNewIntentMethod.param(getClasses().INTENT, "intent");
    JBlock body = onNewIntentMethod.body();
    body.invoke(_super(), onNewIntentMethod).arg(intent);
    onNewIntentAfterSuperBlock = body.blockSimple();
}
Also used : JBlock(com.helger.jcodemodel.JBlock) JVar(com.helger.jcodemodel.JVar)

Example 84 with JBlock

use of com.helger.jcodemodel.JBlock in project androidannotations by androidannotations.

the class EActivityHolder method setOnDestroy.

private void setOnDestroy() {
    onDestroyMethod = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onDestroy");
    onDestroyMethod.annotate(Override.class);
    JBlock body = onDestroyMethod.body();
    onDestroyBeforeSuperBlock = body.blockSimple();
    body.invoke(_super(), onDestroyMethod);
    onDestroyAfterSuperBlock = body.blockSimple();
}
Also used : JBlock(com.helger.jcodemodel.JBlock)

Example 85 with JBlock

use of com.helger.jcodemodel.JBlock 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();
}
Also used : JBlock(com.helger.jcodemodel.JBlock) JMethod(com.helger.jcodemodel.JMethod)

Aggregations

JBlock (com.helger.jcodemodel.JBlock)148 JVar (com.helger.jcodemodel.JVar)81 JMethod (com.helger.jcodemodel.JMethod)73 JInvocation (com.helger.jcodemodel.JInvocation)37 AbstractJClass (com.helger.jcodemodel.AbstractJClass)35 IJExpression (com.helger.jcodemodel.IJExpression)31 ExecutableElement (javax.lang.model.element.ExecutableElement)25 JFieldRef (com.helger.jcodemodel.JFieldRef)19 JDefinedClass (com.helger.jcodemodel.JDefinedClass)15 VariableElement (javax.lang.model.element.VariableElement)15 TypeMirror (javax.lang.model.type.TypeMirror)13 JFieldVar (com.helger.jcodemodel.JFieldVar)11 JConditional (com.helger.jcodemodel.JConditional)10 JTryBlock (com.helger.jcodemodel.JTryBlock)9 JCatchBlock (com.helger.jcodemodel.JCatchBlock)4 TypeElement (javax.lang.model.element.TypeElement)3 PageChangeHolder (org.androidannotations.holder.PageChangeHolder)3 TextWatcherHolder (org.androidannotations.holder.TextWatcherHolder)3 AbstractJType (com.helger.jcodemodel.AbstractJType)2 IJAssignmentTarget (com.helger.jcodemodel.IJAssignmentTarget)2