Examples of UIEnvironment


Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  @Test
  public void testUsesShellAsReferenceForItem() {
    ToolBar toolBar = new ToolBar( shell, SWT.NONE );
    ToolItem item = new ToolItem( toolBar, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( item );

    Bounds parentBounds = environment.getParentBounds();

    assertEquals( BoundsUtil.getBounds( shell.getBounds() ), parentBounds );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  }


  @Test
  public void testUsesSystemFontForParentFontSizeWithoutParent() {
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( shell );

    int parentFontSize = environment.getParentFontSize();

    int height = shell.getDisplay().getSystemFont().getFontData()[ 0 ].getHeight();
    assertEquals( height, parentFontSize );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  }

  @Test
  public void testUsesParentForParentFontSizeForControl() {
    Composite composite = new Composite( shell, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( composite );

    int parentFontSize = environment.getParentFontSize();

    int height = shell.getFont().getFontData()[ 0 ].getHeight();
    assertEquals( height, parentFontSize );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

    UIEnvironmentFactory.createEnvironment( shell );
  }

  @Test
  public void testUsesDisplayAsReferenceForShell() {
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( shell );

    Bounds referenceBounds = environment.getReferenceBounds();

    assertEquals( BoundsUtil.getBounds( shell.getDisplay().getBounds() ), referenceBounds );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  }

  @Test
  public void testUsesShellAsReferenceForControl() {
    Composite composite = new Composite( shell, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( composite );

    Bounds referenceBounds = environment.getReferenceBounds();

    assertEquals( BoundsUtil.getBounds( shell.getBounds() ), referenceBounds );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  @Test
  public void testUsesDisplayAsReferenceForItem() {
    ToolBar toolBar = new ToolBar( shell, SWT.NONE );
    ToolItem item = new ToolItem( toolBar, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( item );

    Bounds referenceBounds = environment.getReferenceBounds();

    assertEquals( BoundsUtil.getBounds( shell.getDisplay().getBounds() ), referenceBounds );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

    assertEquals( BoundsUtil.getBounds( shell.getDisplay().getBounds() ), referenceBounds );
  }

  @Test
  public void testUsesDisplayAsParentForShell() {
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( shell );

    Bounds parentBounds = environment.getParentBounds();

    assertEquals( BoundsUtil.getBounds( shell.getDisplay().getBounds() ), parentBounds );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  }

  @Test
  public void testUsesParentAsParentForControl() {
    Composite composite = new Composite( shell, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( composite );

    Bounds parentBounds = environment.getParentBounds();

    assertEquals( BoundsUtil.getBounds( shell.getBounds() ), parentBounds );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.UIEnvironment

  private void apply() {
    for( Widget widget : widgets ) {
      whenNull( widget ).throwIllegalArgument( "Widget must not be null" );
      if( !widget.isDisposed() ) {
        UIEnvironment environment = createEnvironment( widget );
        InstructionExtractor extractor = new InstructionExtractor( environment );
        List<Instruction> instructions = extractor.extract( rules );
        applyInstructions( widget, instructions );
      }
    }
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.