Package org.eclipse.emf.edit.provider

Examples of org.eclipse.emf.edit.provider.IItemColorProvider


    return null;
  }

  void applyItemProviderColor(Object item, Cell<?> cell, AdapterFactory adapterFactory) {
    IItemColorProvider colorProvider = (IItemColorProvider) adapterFactory.adapt(item, IItemColorProvider.class);
    if (colorProvider != null) {
      Color foreground = colorFromObject(colorProvider.getForeground(item));
      if (foreground != null)
        cell.setTextFill(foreground);

      String background = cssColorFromObject(colorProvider.getBackground(item));
      if (background != null)
        cell.setStyle("-fx-background-color: " + background);
    }
  }
View Full Code Here


    assertEquals(graphic, cell.getGraphic());
  }
 
  @Test
  public void applyItemProviderColor() {
    IItemColorProvider colorProvider = mock(IItemColorProvider.class);
    Object item = new Object();
    URI foregroundColorURI = URI.createURI("color://rgb/255/0/0");
    URI backgroundColorURI = URI.createURI("color://rgb/0/255/0");
    when(colorProvider.getForeground(item)).thenReturn(foregroundColorURI);
    when(colorProvider.getBackground(item)).thenReturn(backgroundColorURI);
    when(adapterFactory.adapt(item, IItemColorProvider.class)).thenReturn(colorProvider);

    Cell<?> cell = new Cell<>();
    cellFactory.applyItemProviderColor(item, cell, adapterFactory);
   
View Full Code Here

TOP

Related Classes of org.eclipse.emf.edit.provider.IItemColorProvider

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.