4632N/A [appMenu insertItem:[NSMenuItem separatorItem] atIndex:index + 1]; // Add the following separator
4632N/A return [[[[self objectForInfoDictionaryKey:@"Java"] objectForKey:@"EAWTOverride"] objectForKey:key] boolValue];
4632N/A // don't install the EAWT delegate if another kind of NSApplication is installed, like say, Safari
4632N/A return sApplicationDelegate;
4632N/A if (prefsAvailable) {
4632N/A if (prefsEnabled) {
4632N/A if (aboutAvailable) {
4632N/A if (aboutEnabled) {
4632N/A fHandlesDocumentTypes = [bundle objectForInfoDictionaryKey:@"CFBundleDocumentTypes"] != nil || [bundle _hasEAWTOverride:@"DocumentHandler"];
4632N/A fHandlesURLTypes = [bundle objectForInfoDictionaryKey:@"CFBundleURLTypes"] != nil || [bundle _hasEAWTOverride:@"URLHandler"];
4632N/A if (fHandlesURLTypes) {
4632N/A BOOL aboutEnabled = (aboutAvailable && [self.fAboutMenu isEnabled] && ([self.fAboutMenu target] != nil));
4632N/A BOOL prefsEnabled = (prefsAvailable && [self.fPreferencesMenu isEnabled] && ([self.fPreferencesMenu target] != nil));
4632N/A static JNF_STATIC_MEMBER_CACHE(sjm_initMenuStates, sjc_AppMenuBarHandler, "initMenuStates", "(ZZZZ)V");
4632N/A JNFCallStaticVoidMethod(env, sjm_initMenuStates, aboutAvailable, aboutEnabled, prefsAvailable, prefsEnabled);
4632N/A [ctr addObserver:clz selector:@selector(_willFinishLaunching) name:NSApplicationWillFinishLaunchingNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_systemWillPowerOff) name:NSWorkspaceWillPowerOffNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_appDidActivate) name:NSApplicationDidBecomeActiveNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_appDidDeactivate) name:NSApplicationDidResignActiveNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_appDidHide) name:NSApplicationDidHideNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_appDidUnhide) name:NSApplicationDidUnhideNotification object:nil];
4632N/A- (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
4632N/A if (!fHandlesURLTypes) return;
4632N/A static JNF_STATIC_MEMBER_CACHE(jm_handleOpenURI, sjc_AppEventHandler, "handleOpenURI", "(Ljava/lang/String;)V");
4632N/A jobject jFileNamesArray = JNFNewObject(env, jm_ArrayList_ctor, (jint)[filenames count]); // AWT_THREADING Safe (known object)
4632N/A return jFileNamesArray;
4632N/A if (!fHandlesDocumentTypes) {
4632N/A // if these files were opened from a Spotlight query, try to get the search text from the current AppleEvent
4632N/A NSAppleEventDescriptor *currentEvent = [[NSAppleEventManager sharedAppleEventManager] currentAppleEvent];
4632N/A NSString *searchString = [[currentEvent paramDescriptorForKeyword:keyAESearchText] stringValue];
4632N/A static JNF_STATIC_MEMBER_CACHE(jm_handleOpenFiles, sjc_AppEventHandler, "handleOpenFiles", "(Ljava/util/List;Ljava/lang/String;)V");
4632N/A- (NSApplicationPrintReply)application:(NSApplication *)application printFiles:(NSArray *)fileNames withSettings:(NSDictionary *)printSettings showPrintPanels:(BOOL)showPrintPanels {
4632N/A static JNF_STATIC_MEMBER_CACHE(jm_handlePrintFile, sjc_AppEventHandler, "handlePrintFiles", "(Ljava/util/List;)V");
4632N/A JNFCallStaticVoidMethod(env, jm_handlePrintFile, jFileNamesArray); // AWT_THREADING Safe (event)
4632N/A return NSPrintingSuccess;
4632N/A static JNF_STATIC_MEMBER_CACHE(jm_handleNativeNotification, sjc_AppEventHandler, "handleNativeNotification", "(I)V");
4632N/A JNFCallStaticVoidMethod(env, jm_handleNativeNotification, notificationType); // AWT_THREADING Safe (event)
4632N/A- (void)_aboutMenuHandler {
4632N/A- (void)_preferencesMenuHandler {
4632N/A+ (void)_willFinishLaunching {
4632N/A- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag {
4632N/A return NSTerminateLater;
4632N/A+ (void)_systemWillPowerOff {
4632N/A+ (void)_appDidActivate {
4632N/A+ (void)_appDidDeactivate {
4632N/A+ (void)_appDidHide {
4632N/A+ (void)_appDidUnhide {
4632N/A+ (void)_sessionDidActivate {
4632N/A+ (void)_sessionDidDeactivate {
4632N/A+ (void)_screenDidSleep {
4632N/A+ (void)_screenDidWake {
4632N/A+ (void)_systemDidSleep {
4632N/A+ (void)_systemDidWake {
4632N/A switch (notificationType) {
4632N/A [ctr addObserver:clz selector:@selector(_sessionDidActivate) name:NSWorkspaceSessionDidBecomeActiveNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_sessionDidDeactivate) name:NSWorkspaceSessionDidResignActiveNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_screenDidSleep) name:NSWorkspaceScreensDidSleepNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_screenDidWake) name:NSWorkspaceScreensDidWakeNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_systemDidSleep) name:NSWorkspaceWillSleepNotification object:nil];
4632N/A [ctr addObserver:clz selector:@selector(_systemDidWake) name:NSWorkspaceDidWakeNotification object:nil];