当前位置: 首页>>代码示例>>Java>>正文


Java OnEvent.KEEP属性代码示例

本文整理汇总了Java中com.github.czyzby.autumn.annotation.OnEvent.KEEP属性的典型用法代码示例。如果您正苦于以下问题:Java OnEvent.KEEP属性的具体用法?Java OnEvent.KEEP怎么用?Java OnEvent.KEEP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.github.czyzby.autumn.annotation.OnEvent的用法示例。


在下文中一共展示了OnEvent.KEEP属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEvent

@OnEvent(VersionUpdateCheckEvent.class) boolean onEvent(VersionUpdateCheckEvent event) {
        switch (event.getAction()) {
            case CHECK_STARTED:
            case CHECK_FINISHED:
                return OnEvent.KEEP;
            case FINISHED_ERROR:
            case FINISHED_UP_TO_DATE:
                return OnEvent.REMOVE;
            case FINISHED_UPDATE_AVAILABLE:
//                toastManager.show
                return OnEvent.REMOVE;
            default:
                // Should never happen
                throw new IllegalStateException("Unexpected version check event: " + event.getAction());
        }
    }
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:16,代码来源:MainController.java

示例2: processEvent

@Override
public boolean processEvent(final Object event) {
    replaceParameters(event);
    try {
        final Object result = invoke();
        if (removeAfterInvocation) {
            return OnEvent.REMOVE;
        } else if (result instanceof Boolean) {
            return ((Boolean) result).booleanValue();
        }
        return OnEvent.KEEP;
    } catch (final Exception exception) {
        if (strict) {
            // Gdx applications seem to ignore exceptions in posted runnables. This is bad.
            Gdx.app.error("ERROR", "Exception occured on event listener.", exception);
            throw new GdxRuntimeException("Unable to invoke event listener.", exception);
        }
        return OnEvent.KEEP;
    }
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn,代码行数:20,代码来源:ReflectionEventListener.java

示例3: processMessage

@Override
public boolean processMessage() {
    replaceParameters();
    try {
        final Object result = invoke();
        if (removeAfterInvocation) {
            return OnEvent.REMOVE;
        } else if (result instanceof Boolean) {
            return ((Boolean) result).booleanValue();
        }
        return OnEvent.KEEP;
    } catch (final Exception exception) {
        if (strict) {
            // Gdx applications seem to ignore exceptions in posted runnables. This is bad.
            Gdx.app.error("ERROR", "Exception occured on message listener.", exception);
            throw new GdxRuntimeException("Unable to invoke message listener.", exception);
        }
        return OnEvent.KEEP;
    }
}
 
开发者ID:gdx-libs,项目名称:gdx-autumn,代码行数:20,代码来源:ReflectionMessageListener.java

示例4: onEvent

@OnEvent(VersionUpdateCheckEvent.class) boolean onEvent(VersionUpdateCheckEvent event) {
    switch (event.getAction()) {
        case FINISHED_ERROR:
        case FINISHED_UP_TO_DATE:
            // Everything appears to be fine, stop listening for updates
            return OnEvent.REMOVE;
        case FINISHED_UPDATE_AVAILABLE:
            showUpdateNotification(event.getLatestVersion());
            return OnEvent.REMOVE;
    }
    return OnEvent.KEEP;
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:12,代码来源:InitialUpdateCheckService.java

示例5: processEvent

@Override
public boolean processEvent(final MyEvent event) {
    LOGGER.info("I detected a MyEvent: {0}.", event.getMessage());
    return OnEvent.KEEP; // If you change this to OnEvent.REMOVE, listener would be removed after first event.
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:MyEventHandler.java


注:本文中的com.github.czyzby.autumn.annotation.OnEvent.KEEP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。