Created
June 12, 2015 19:47
-
-
Save confile/9673bed1d6f7746d2ab1 to your computer and use it in GitHub Desktop.
BPlaceManagerImpl.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Generated by the J2ObjC translator. DO NOT EDIT! | |
// source: /Users/mg/Documents/Grails/GGTS3.6.3-SR1-2/buddyis-main/build/source/base/buddyis/core/prototype/navigation/BPlaceManagerImpl.java | |
// | |
#include "AbstractBEvent.h" | |
#include "BBackNavigationEvent.h" | |
#include "BEventBus.h" | |
#include "BHistoryUpdateEvent.h" | |
#include "BPlaceManagerImpl.h" | |
#include "BPlaceRequest.h" | |
#include "BPlaceRequestInternalEvent.h" | |
#include "BTimer.h" | |
#include "BTimerCallback.h" | |
#include "BTokenFormatter.h" | |
#include "J2ObjC_source.h" | |
#include "TokenFormatException.h" | |
#include "java/util/ArrayList.h" | |
#include "java/util/List.h" | |
#include "java/util/logging/Logger.h" | |
#pragma clang diagnostic push | |
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |
@interface BuddyisCorePrototypeNavigationBPlaceManagerImpl () { | |
@public | |
NSString *currentHistoryToken_; | |
jboolean hasRunningNavigation_; | |
CoreHelperTimerBTimer *releaseLokedNavigationTimer_; | |
BuddyisCorePrototypeEventBusBEventBus *eventBus_; | |
id<BuddyisCorePrototypeNavigationBTokenFormatter> tokenFormatter_; | |
id<JavaUtilList> placeHierarchy_; | |
} | |
- (void)startReleaseTimer; | |
/** | |
@brief Update the history stack with the history token. | |
@param historyToken | |
@param issueEvent | |
*/ | |
- (void)setBrowserHistoryTokenWithNSString:(NSString *)historyToken | |
withBoolean:(jboolean)issueEvent; | |
- (void)saveHistoryTokenWithNSString:(NSString *)historyToken; | |
@end | |
J2OBJC_FIELD_SETTER(BuddyisCorePrototypeNavigationBPlaceManagerImpl, currentHistoryToken_, NSString *) | |
J2OBJC_FIELD_SETTER(BuddyisCorePrototypeNavigationBPlaceManagerImpl, releaseLokedNavigationTimer_, CoreHelperTimerBTimer *) | |
J2OBJC_FIELD_SETTER(BuddyisCorePrototypeNavigationBPlaceManagerImpl, eventBus_, BuddyisCorePrototypeEventBusBEventBus *) | |
J2OBJC_FIELD_SETTER(BuddyisCorePrototypeNavigationBPlaceManagerImpl, tokenFormatter_, id<BuddyisCorePrototypeNavigationBTokenFormatter>) | |
J2OBJC_FIELD_SETTER(BuddyisCorePrototypeNavigationBPlaceManagerImpl, placeHierarchy_, id<JavaUtilList>) | |
__attribute__((unused)) static void BuddyisCorePrototypeNavigationBPlaceManagerImpl_startReleaseTimer(BuddyisCorePrototypeNavigationBPlaceManagerImpl *self); | |
__attribute__((unused)) static void BuddyisCorePrototypeNavigationBPlaceManagerImpl_setBrowserHistoryTokenWithNSString_withBoolean_(BuddyisCorePrototypeNavigationBPlaceManagerImpl *self, NSString *historyToken, jboolean issueEvent); | |
@interface BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer : NSObject < CoreHelperTimerBTimerCallback > { | |
@public | |
__weak BuddyisCorePrototypeNavigationBPlaceManagerImpl *this$0_; | |
} | |
- (void)run; | |
- (instancetype)initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl:(BuddyisCorePrototypeNavigationBPlaceManagerImpl *)outer$; | |
@end | |
J2OBJC_EMPTY_STATIC_INIT(BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer) | |
__attribute__((unused)) static void BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer *self, BuddyisCorePrototypeNavigationBPlaceManagerImpl *outer$); | |
__attribute__((unused)) static BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer *new_BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(BuddyisCorePrototypeNavigationBPlaceManagerImpl *outer$) NS_RETURNS_RETAINED; | |
J2OBJC_TYPE_LITERAL_HEADER(BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer) | |
@implementation BuddyisCorePrototypeNavigationBPlaceManagerImpl | |
- (instancetype)initWithBuddyisCorePrototypeEventBusBEventBus:(BuddyisCorePrototypeEventBusBEventBus *)eventBus | |
withBuddyisCorePrototypeNavigationBTokenFormatter:(id<BuddyisCorePrototypeNavigationBTokenFormatter>)tokenFormatter { | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_initWithBuddyisCorePrototypeEventBusBEventBus_withBuddyisCorePrototypeNavigationBTokenFormatter_(self, eventBus, tokenFormatter); | |
return self; | |
} | |
- (NSString *)buildHistoryTokenWithBuddyisCorePrototypeNavigationBPlaceRequest:(BuddyisCorePrototypeNavigationBPlaceRequest *)request { | |
return [((id<BuddyisCorePrototypeNavigationBTokenFormatter>) nil_chk(tokenFormatter_)) toPlaceTokenWithBuddyisCorePrototypeNavigationBPlaceRequest:request]; | |
} | |
- (void)revealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:(BuddyisCorePrototypeNavigationBPlaceRequest *)request { | |
[self revealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:request withBoolean:YES]; | |
} | |
- (void)revealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:(BuddyisCorePrototypeNavigationBPlaceRequest *)request | |
withBoolean:(jboolean)updateBrowserUrl { | |
JavaUtilLoggingLogger *logger = JavaUtilLoggingLogger_getLoggerWithNSString_(@"TEST"); | |
[((JavaUtilLoggingLogger *) nil_chk(logger)) infoWithNSString:JreStrcat("$Z", @"------------- revealPlace: hasRunningNavigation: ", hasRunningNavigation_)]; | |
if (!hasRunningNavigation_) { | |
hasRunningNavigation_ = YES; | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_startReleaseTimer(self); | |
[((id<JavaUtilList>) nil_chk(placeHierarchy_)) clear]; | |
[placeHierarchy_ addWithId:request]; | |
[self doRevealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:request withBoolean:updateBrowserUrl]; | |
} | |
} | |
- (void)startReleaseTimer { | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_startReleaseTimer(self); | |
} | |
- (void)doRevealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:(BuddyisCorePrototypeNavigationBPlaceRequest *)request | |
withBoolean:(jboolean)updateBrowserUrl { | |
BuddyisCorePrototypeNavigationBPlaceRequestInternalEvent *requestEvent = new_BuddyisCorePrototypeNavigationBPlaceRequestInternalEvent_initWithBuddyisCorePrototypeNavigationBPlaceRequest_withBoolean_(request, updateBrowserUrl); | |
[self fireEventWithBuddyisCorePrototypeEventBusAbstractBEvent:requestEvent]; | |
} | |
- (void)fireEventWithBuddyisCorePrototypeEventBusAbstractBEvent:(BuddyisCorePrototypeEventBusAbstractBEvent *)event { | |
[((BuddyisCorePrototypeEventBusBEventBus *) nil_chk([self getEventBus])) fireEventFromSourceWithBuddyisCorePrototypeEventBusBEvent:event withId:self]; | |
} | |
- (BuddyisCorePrototypeEventBusBEventBus *)getEventBus { | |
return eventBus_; | |
} | |
- (BuddyisCorePrototypeNavigationBPlaceRequest *)getCurrentPlaceRequest { | |
if ([((id<JavaUtilList>) nil_chk(placeHierarchy_)) size] > 0) { | |
return [placeHierarchy_ getWithInt:[placeHierarchy_ size] - 1]; | |
} | |
else { | |
return [new_BuddyisCorePrototypeNavigationBPlaceRequest_Builder_init() build]; | |
} | |
} | |
- (void)updateHistoryWithBuddyisCorePrototypeNavigationBPlaceRequest:(BuddyisCorePrototypeNavigationBPlaceRequest *)request | |
withBoolean:(jboolean)updateBrowserUrl { | |
@try { | |
NSAssert([((BuddyisCorePrototypeNavigationBPlaceRequest *) nil_chk(request)) hasSameNameTokenWithBuddyisCorePrototypeNavigationBPlaceRequest:[self getCurrentPlaceRequest]], @"Internal error J2OBJC_COMMA() PlaceRequest passed toupdateHistory doesn't match the tail of the place hierarchy."); | |
(void) [placeHierarchy_ setWithInt:[((id<JavaUtilList>) nil_chk(placeHierarchy_)) size] - 1 withId:request]; | |
if (updateBrowserUrl) { | |
NSString *historyToken = [((id<BuddyisCorePrototypeNavigationBTokenFormatter>) nil_chk(tokenFormatter_)) toHistoryTokenWithJavaUtilList:placeHierarchy_]; | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_setBrowserHistoryTokenWithNSString_withBoolean_(self, historyToken, NO); | |
} | |
} | |
@catch (BuddyisCorePrototypeNavigationTokenFormatException *e) { | |
} | |
} | |
- (void)setBrowserHistoryTokenWithNSString:(NSString *)historyToken | |
withBoolean:(jboolean)issueEvent { | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_setBrowserHistoryTokenWithNSString_withBoolean_(self, historyToken, issueEvent); | |
} | |
- (void)saveHistoryTokenWithNSString:(NSString *)historyToken { | |
currentHistoryToken_ = historyToken; | |
} | |
- (void)navigateBack { | |
BuddyisCorePrototypeNavigationBBackNavigationEvent *backEvent = new_BuddyisCorePrototypeNavigationBBackNavigationEvent_init(); | |
[self fireEventWithBuddyisCorePrototypeEventBusAbstractBEvent:backEvent]; | |
} | |
- (void)navigationComplete { | |
JavaUtilLoggingLogger *logger = JavaUtilLoggingLogger_getLoggerWithNSString_(@"TEST"); | |
[((JavaUtilLoggingLogger *) nil_chk(logger)) infoWithNSString:@"------------- navigationComplete"]; | |
hasRunningNavigation_ = NO; | |
} | |
+ (const J2ObjcClassInfo *)__metadata { | |
static const J2ObjcMethodInfo methods[] = { | |
{ "initWithBuddyisCorePrototypeEventBusBEventBus:withBuddyisCorePrototypeNavigationBTokenFormatter:", "BPlaceManagerImpl", NULL, 0x1, NULL, NULL }, | |
{ "buildHistoryTokenWithBuddyisCorePrototypeNavigationBPlaceRequest:", "buildHistoryToken", "Ljava.lang.String;", 0x1, NULL, NULL }, | |
{ "revealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:", "revealPlace", "V", 0x1, NULL, NULL }, | |
{ "revealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:withBoolean:", "revealPlace", "V", 0x1, NULL, NULL }, | |
{ "startReleaseTimer", NULL, "V", 0x2, NULL, NULL }, | |
{ "doRevealPlaceWithBuddyisCorePrototypeNavigationBPlaceRequest:withBoolean:", "doRevealPlace", "V", 0x4, NULL, NULL }, | |
{ "fireEventWithBuddyisCorePrototypeEventBusAbstractBEvent:", "fireEvent", "V", 0x1, NULL, NULL }, | |
{ "getEventBus", NULL, "Lbuddyis.core.prototype.eventBus.BEventBus;", 0x1, NULL, NULL }, | |
{ "getCurrentPlaceRequest", NULL, "Lbuddyis.core.prototype.navigation.BPlaceRequest;", 0x1, NULL, NULL }, | |
{ "updateHistoryWithBuddyisCorePrototypeNavigationBPlaceRequest:withBoolean:", "updateHistory", "V", 0x1, NULL, NULL }, | |
{ "setBrowserHistoryTokenWithNSString:withBoolean:", "setBrowserHistoryToken", "V", 0x2, NULL, NULL }, | |
{ "saveHistoryTokenWithNSString:", "saveHistoryToken", "V", 0x2, NULL, NULL }, | |
{ "navigateBack", NULL, "V", 0x1, NULL, NULL }, | |
{ "navigationComplete", NULL, "V", 0x1, NULL, NULL }, | |
}; | |
static const J2ObjcFieldInfo fields[] = { | |
{ "currentHistoryToken_", NULL, 0x2, "Ljava.lang.String;", NULL, NULL, }, | |
{ "hasRunningNavigation_", NULL, 0x2, "Z", NULL, NULL, }, | |
{ "releaseLokedNavigationTimer_", NULL, 0x2, "Lcore.helper.timer.BTimer;", NULL, NULL, }, | |
{ "eventBus_", NULL, 0x12, "Lbuddyis.core.prototype.eventBus.BEventBus;", NULL, NULL, }, | |
{ "tokenFormatter_", NULL, 0x12, "Lbuddyis.core.prototype.navigation.BTokenFormatter;", NULL, NULL, }, | |
{ "placeHierarchy_", NULL, 0x2, "Ljava.util.List;", NULL, "Ljava/util/List<Lbuddyis/core/prototype/navigation/BPlaceRequest;>;", }, | |
}; | |
static const char *inner_classes[] = {"Lbuddyis.core.prototype.navigation.BPlaceManagerImpl$TmpTimer;"}; | |
static const J2ObjcClassInfo _BuddyisCorePrototypeNavigationBPlaceManagerImpl = { 2, "BPlaceManagerImpl", "buddyis.core.prototype.navigation", NULL, 0x1, 14, methods, 6, fields, 0, NULL, 1, inner_classes, NULL, NULL }; | |
return &_BuddyisCorePrototypeNavigationBPlaceManagerImpl; | |
} | |
@end | |
void BuddyisCorePrototypeNavigationBPlaceManagerImpl_initWithBuddyisCorePrototypeEventBusBEventBus_withBuddyisCorePrototypeNavigationBTokenFormatter_(BuddyisCorePrototypeNavigationBPlaceManagerImpl *self, BuddyisCorePrototypeEventBusBEventBus *eventBus, id<BuddyisCorePrototypeNavigationBTokenFormatter> tokenFormatter) { | |
(void) NSObject_init(self); | |
self->currentHistoryToken_ = @""; | |
self->hasRunningNavigation_ = NO; | |
self->placeHierarchy_ = new_JavaUtilArrayList_init(); | |
self->eventBus_ = eventBus; | |
self->tokenFormatter_ = tokenFormatter; | |
} | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl *new_BuddyisCorePrototypeNavigationBPlaceManagerImpl_initWithBuddyisCorePrototypeEventBusBEventBus_withBuddyisCorePrototypeNavigationBTokenFormatter_(BuddyisCorePrototypeEventBusBEventBus *eventBus, id<BuddyisCorePrototypeNavigationBTokenFormatter> tokenFormatter) { | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl *self = [BuddyisCorePrototypeNavigationBPlaceManagerImpl alloc]; | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_initWithBuddyisCorePrototypeEventBusBEventBus_withBuddyisCorePrototypeNavigationBTokenFormatter_(self, eventBus, tokenFormatter); | |
return self; | |
} | |
void BuddyisCorePrototypeNavigationBPlaceManagerImpl_startReleaseTimer(BuddyisCorePrototypeNavigationBPlaceManagerImpl *self) { | |
if (self->releaseLokedNavigationTimer_ != nil) { | |
[self->releaseLokedNavigationTimer_ cancel]; | |
} | |
self->releaseLokedNavigationTimer_ = new_CoreHelperTimerBTimer_init(); | |
[self->releaseLokedNavigationTimer_ setRunWithCoreHelperTimerBTimerCallback:new_BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(self)]; | |
[self->releaseLokedNavigationTimer_ scheduleWithInt:500]; | |
} | |
void BuddyisCorePrototypeNavigationBPlaceManagerImpl_setBrowserHistoryTokenWithNSString_withBoolean_(BuddyisCorePrototypeNavigationBPlaceManagerImpl *self, NSString *historyToken, jboolean issueEvent) { | |
BuddyisCorePrototypeNavigationBHistoryUpdateEvent *event = new_BuddyisCorePrototypeNavigationBHistoryUpdateEvent_initWithNSString_(historyToken); | |
[self fireEventWithBuddyisCorePrototypeEventBusAbstractBEvent:event]; | |
} | |
J2OBJC_CLASS_TYPE_LITERAL_SOURCE(BuddyisCorePrototypeNavigationBPlaceManagerImpl) | |
@implementation BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer | |
- (void)run { | |
JavaUtilLoggingLogger *logger = JavaUtilLoggingLogger_getLoggerWithNSString_(@"TEST"); | |
[((JavaUtilLoggingLogger *) nil_chk(logger)) infoWithNSString:@"------------- release: hasRunningNavigation: !!!!!"]; | |
this$0_->hasRunningNavigation_ = NO; | |
} | |
- (instancetype)initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl:(BuddyisCorePrototypeNavigationBPlaceManagerImpl *)outer$ { | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(self, outer$); | |
return self; | |
} | |
- (void)__javaClone { | |
[super __javaClone]; | |
JreRelease(this$0_); | |
} | |
+ (const J2ObjcClassInfo *)__metadata { | |
static const J2ObjcMethodInfo methods[] = { | |
{ "run", NULL, "V", 0x1, NULL, NULL }, | |
{ "initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl:", "init", NULL, 0x0, NULL, NULL }, | |
}; | |
static const J2ObjcFieldInfo fields[] = { | |
{ "this$0_", NULL, 0x1012, "Lbuddyis.core.prototype.navigation.BPlaceManagerImpl;", NULL, NULL, }, | |
}; | |
static const J2ObjcClassInfo _BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer = { 2, "TmpTimer", "buddyis.core.prototype.navigation", "BPlaceManagerImpl", 0x2, 2, methods, 1, fields, 0, NULL, 0, NULL, NULL, NULL }; | |
return &_BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer; | |
} | |
@end | |
void BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer *self, BuddyisCorePrototypeNavigationBPlaceManagerImpl *outer$) { | |
self->this$0_ = outer$; | |
(void) NSObject_init(self); | |
} | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer *new_BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(BuddyisCorePrototypeNavigationBPlaceManagerImpl *outer$) { | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer *self = [BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer alloc]; | |
BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer_initWithBuddyisCorePrototypeNavigationBPlaceManagerImpl_(self, outer$); | |
return self; | |
} | |
J2OBJC_CLASS_TYPE_LITERAL_SOURCE(BuddyisCorePrototypeNavigationBPlaceManagerImpl_TmpTimer) | |
#pragma clang diagnostic pop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment