Package com.eclipsesource.tabris.passepartout.internal.condition

Examples of com.eclipsesource.tabris.passepartout.internal.condition.MaxWidthCondition


  public void testNotifiesMultipleValidListenerActivated() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryListener listener2 = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    Query query2 = new QueryImpl( new AlwaysTrueContidtion() ).and( new MaxWidthCondition( px( 99 ) ) );
    notifier.addQueryListener( query, listener );
    notifier.addQueryListener( query2, listener2 );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 90, 0 ) ) );
View Full Code Here


  @Test
  public void testDeactivatesListenerOnQueryChange() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new MaxWidthCondition( px( 100 ) ) );
    notifier.addQueryListener( query, listener );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 99, 0 ) ) );
    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 199, 0 ) ) );
View Full Code Here

  @Test
  public void testDeactivatesListenerOnQueryChangeAndActivatesValidOne() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryListener listener2 = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new MaxWidthCondition( px( 100 ) ) );
    QueryImpl query2 = new QueryImpl( new MinWidthCondition( px( 101 ) ) );
    notifier.addQueryListener( query, listener );
    notifier.addQueryListener( query2, listener2 );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 99, 0 ) ) );
View Full Code Here

   * </p>
   *
   * @param maxWidth the maximum width for the {@link Condition} to become valid. Must not be <code>null</code>.
   */
  public static Condition maxWidth( Unit maxWidth ) {
    return new MaxWidthCondition( maxWidth );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.passepartout.internal.condition.MaxWidthCondition

Copyright © 2018 www.massapicom. 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.