Search in sources :

Example 86 with JBlock

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

Example 87 with JBlock

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

the class EActivityHolder method setSetIntent.

private void setSetIntent() {
    setIntent = generatedClass.method(PUBLIC, getCodeModel().VOID, "setIntent");
    setIntent.annotate(Override.class);
    JVar methodParam = setIntent.param(getClasses().INTENT, "newIntent");
    JBlock setIntentBody = setIntent.body();
    setIntentBody.invoke(_super(), setIntent).arg(methodParam);
}
Also used : JBlock(com.helger.jcodemodel.JBlock) JVar(com.helger.jcodemodel.JVar)

Example 88 with JBlock

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

the class EActivityHolder method setOnContentChanged.

private void setOnContentChanged() {
    onContentChanged = generatedClass.method(JMod.PUBLIC, getCodeModel().VOID, "onContentChanged");
    onContentChanged.annotate(Override.class);
    JBlock body = onContentChanged.body();
    body.invoke(_super(), onContentChanged);
    onContentChangedAfterSuperBlock = body.blockSimple();
}
Also used : JBlock(com.helger.jcodemodel.JBlock)

Example 89 with JBlock

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

Example 90 with JBlock

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

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