Examples of postNotification()


Examples of com.webobjects.foundation.NSNotificationCenter.postNotification()

   *
   * @param session
   */
  protected void postNotification(ERXSession session) {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    nc.postNotification(MODERNIZR_UPDATED_NOTIFICATION, session);
  }
}
View Full Code Here

Examples of ns.foundation.NSNotificationCenter.postNotification()

  public void testPostNotificationNSNotification() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    TestObserver observer = new TestObserver();
    nc.addObserver(observer, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
    NSNotification notification = new NSNotification("test", null);
    nc.postNotification(notification);
    assertTrue(observer.invoked);
  }

  public void testPostNotificationStringObject() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
View Full Code Here

Examples of ns.foundation.NSNotificationCenter.postNotification()

  public void testPostNotificationStringObject() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    TestObserver observer = new TestObserver();
    nc.addObserver(observer, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
    nc.postNotification("test", this);
    assertTrue(observer.invoked);
  }

  public void testPostNotificationStringObjectNSDictionaryOfStringObject() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
View Full Code Here

Examples of ns.foundation.NSNotificationCenter.postNotification()

  public void testPostNotificationStringObjectNSDictionaryOfStringObject() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    TestObserver observer = new TestObserver();
    nc.addObserver(observer, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
    NSDictionary<String, Object> userInfo = new NSDictionary<String, Object>("value", "key");
    nc.postNotification("test", this, userInfo);
    assertTrue(observer.invoked);
    assertEquals(userInfo, observer.userInfo);
  }

  public void testRemoveObserverObject() {
View Full Code Here

Examples of ns.foundation.NSNotificationCenter.postNotification()

  public void testRemoveObserverObject() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
    TestObserver observer = new TestObserver();
    nc.addObserver(observer, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
    nc.removeObserver(observer);
    nc.postNotification("test", this);
    assertFalse(observer.invoked);
  }

  public void testRemoveObserverObjectStringObject() {
    NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
View Full Code Here

Examples of ns.foundation.NSNotificationCenter.postNotification()

    TestObserver observer1 = new TestObserver();
    TestObserver observer2 = new TestObserver();
    nc.addObserver(observer1, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
    nc.addObserver(observer2, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
    nc.removeObserver(observer2, "test", null);
    nc.postNotification("test", this);
    assertTrue(observer1.invoked);
    assertFalse(observer2.invoked);
  }

}
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSNotificationCenter.postNotification()

                null);

        NSNotification notification = NSNotification.CLASS.notificationWithName_object("MyNotification", null);
       
        assertNull(implementor.arg);
        notificationCentre.postNotification(notification);            
        assertEquals(notification, implementor.arg);
        notificationCentre.removeObserver(observer);
    }
   
    @Test public void testMemoryManagement() {
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSNotificationCenter.postNotification()

                null);
        pool.drain();
        pool = NSAutoreleasePool.new_();

        NSNotification notification = NSNotification.CLASS.notificationWithName_object("MyNotification", null);       
        notificationCentre.postNotification(notification);
        notificationCentre.removeObserver(observer);
    }
   
}
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.