Search in sources :

Example 6 with JMethod

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

the class OnSeekBarChangeListenerHolder method createOnProgressChanged.

private void createOnProgressChanged() {
    JMethod onProgressChangedMethod = listenerClass.method(JMod.PUBLIC, holder.getCodeModel().VOID, "onProgressChanged");
    onProgressChangedMethod.annotate(Override.class);
    onProgressChangedBody = onProgressChangedMethod.body();
    onProgressChangedSeekBarParam = onProgressChangedMethod.param(holder.getClasses().SEEKBAR, "seekBar");
    onProgressChangedProgressParam = onProgressChangedMethod.param(holder.getCodeModel().INT, "progress");
    onProgressChangedFromUserParam = onProgressChangedMethod.param(holder.getCodeModel().BOOLEAN, "fromUser");
}
Also used : JMethod(com.helger.jcodemodel.JMethod)

Example 7 with JMethod

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

the class OnSeekBarChangeListenerHolder method createOnStopTrackingTouch.

private void createOnStopTrackingTouch() {
    JMethod onStopTrackingTouchMethod = listenerClass.method(JMod.PUBLIC, holder.getCodeModel().VOID, "onStopTrackingTouch");
    onStopTrackingTouchMethod.annotate(Override.class);
    onStopTrackingTouchBody = onStopTrackingTouchMethod.body();
    onStopTrackingTouchSeekBarParam = onStopTrackingTouchMethod.param(holder.getClasses().SEEKBAR, "seekBar");
}
Also used : JMethod(com.helger.jcodemodel.JMethod)

Example 8 with JMethod

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

the class PageChangeHolder method createPageScroll.

private void createPageScroll() {
    JMethod method = listenerClass.method(JMod.PUBLIC, holder.getCodeModel().VOID, "onPageScrolled");
    method.annotate(Override.class);
    pageScrolledBody = method.body();
    JPrimitiveType intClass = holder.getCodeModel().INT;
    pageScrolledPositionParam = method.param(intClass, "position");
    pageScrolledPositionOffsetParam = method.param(holder.getCodeModel().FLOAT, "positionOffset");
    pageScrolledPositionOffsetPixelsParam = method.param(intClass, "positionOffsetPixels");
}
Also used : JPrimitiveType(com.helger.jcodemodel.JPrimitiveType) JMethod(com.helger.jcodemodel.JMethod)

Example 9 with JMethod

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

the class PageChangeHolder method createPageSelected.

private void createPageSelected() {
    JMethod method = listenerClass.method(JMod.PUBLIC, holder.getCodeModel().VOID, "onPageSelected");
    method.annotate(Override.class);
    pageSelectedBody = method.body();
    JPrimitiveType intClass = holder.getCodeModel().INT;
    pageSelectedPositionParam = method.param(intClass, "position");
}
Also used : JPrimitiveType(com.helger.jcodemodel.JPrimitiveType) JMethod(com.helger.jcodemodel.JMethod)

Example 10 with JMethod

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

the class PreferenceActivityDelegate method setOnBuildHeadersBlock.

private void setOnBuildHeadersBlock() {
    JMethod method = getGeneratedClass().method(PUBLIC, codeModel().VOID, "onBuildHeaders");
    method.annotate(Override.class);
    onBuildHeadersBlock = method.body();
    onBuildHeadersTargetParam = method.param(getClasses().LIST.narrow(getClasses().PREFERENCE_ACTIVITY_HEADER), "target");
}
Also used : JMethod(com.helger.jcodemodel.JMethod)

Aggregations

JMethod (com.helger.jcodemodel.JMethod)122 JBlock (com.helger.jcodemodel.JBlock)73 JVar (com.helger.jcodemodel.JVar)56 AbstractJClass (com.helger.jcodemodel.AbstractJClass)36 JInvocation (com.helger.jcodemodel.JInvocation)26 JDefinedClass (com.helger.jcodemodel.JDefinedClass)20 IJExpression (com.helger.jcodemodel.IJExpression)15 ExecutableElement (javax.lang.model.element.ExecutableElement)13 JFieldVar (com.helger.jcodemodel.JFieldVar)10 JConditional (com.helger.jcodemodel.JConditional)8 JTryBlock (com.helger.jcodemodel.JTryBlock)7 JTypeVar (com.helger.jcodemodel.JTypeVar)7 TypeMirror (javax.lang.model.type.TypeMirror)7 VariableElement (javax.lang.model.element.VariableElement)6 JFieldRef (com.helger.jcodemodel.JFieldRef)5 JPrimitiveType (com.helger.jcodemodel.JPrimitiveType)5 ArrayList (java.util.ArrayList)5 VisitorDefinition (com.github.sviperll.adt4j.model.config.VisitorDefinition)4 GenerationProcess (com.github.sviperll.adt4j.model.util.GenerationProcess)4 AbstractJType (com.helger.jcodemodel.AbstractJType)4