Examples of NSMutableDictionary


Examples of org.rococoa.cocoa.foundation.NSMutableDictionary

       
        check(dictionary);
    }

    @Test public void testMutableDictionary() {
        NSMutableDictionary dictionary = NSMutableDictionary.dictionaryWithCapacity(5);
        assertEquals(0, dictionary.count());
       
        dictionary.setValue_forKey(
                NSString.stringWithString("string value"), NSString.stringWithString("string key"));
        dictionary.setValue_forKey(
                NSNumber.CLASS.numberWithInt(42), "int key");

        check(dictionary);
    }
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSMutableDictionary

     * @param inIdentifier       Notification identifier for coalescing. This can be null.
     * @throws IllegalArgumentException When a notification is not known
     */
    public void postNotification(String inNotificationName, NSImage inIcon, String inTitle, String inDescription,
                                 NSDictionary inExtraInfo, boolean inSticky, String inIdentifier) {
        NSMutableDictionary noteDict = NSMutableDictionary.dictionaryWithCapacity(0);

        if (!allNotes.contains(inNotificationName)) {
            throw new IllegalArgumentException("Undefined Notification attempted: " + inNotificationName);
        }

        noteDict.setValue_forKey(NSString.stringWithString(inNotificationName), GROWL_NOTIFICATION_NAME);
        noteDict.setValue_forKey(inTitle != null ? NSString.stringWithString(inTitle) : null, GROWL_NOTIFICATION_TITLE);
        noteDict.setValue_forKey(inDescription != null ? NSString.stringWithString(inDescription) : null, GROWL_NOTIFICATION_DESCRIPTION);
        noteDict.setValue_forKey(NSString.stringWithString(appName), GROWL_APP_NAME);
        if (inIcon != null) {
            noteDict.setValue_forKey(inIcon.TIFFRepresentation(), GROWL_NOTIFICATION_ICON);
        }

        if (inSticky) {
            noteDict.setValue_forKey(NSNumber.CLASS.numberWithInt(1), GROWL_NOTIFICATION_STICKY);
        }

        if (inIdentifier != null) {
            noteDict.setValue_forKey(NSString.stringWithString(inIdentifier), GROWL_NOTIFICATION_IDENTIFIER);
        }

        if (inExtraInfo != null) {
            noteDict.addEntriesFromDictionary(inExtraInfo);
        }

        theCenter.postNotification(GROWL_NOTIFICATION, null, noteDict, true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.