CasViewerEclipsePlugin/uimaj-ep-casviewer-core/src/main/java/org/apache/uima/casviewer/ui/internal/style/ColoredTypeTreeLabelProvider.java [208:260]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public void dispose() {
		for (Iterator i = imageCache.values().iterator(); i.hasNext();) {
			((Image) i.next()).dispose();
		}
		imageCache.clear();
	}

	protected RuntimeException unknownElement(Object element) {
		return new RuntimeException("Unknown type of element in tree of type " + element.getClass().getName());
	}	
	
    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.getObject())
     */
    public Color getForeground (Object element) {
        if ( element instanceof TypeNode ) {
            int color = -1;
        	if (((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_LABEL_FEATURES) {
                color = SWT.COLOR_BLUE;
        		
        	} else if (((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_TYPE)  {
//                if (((TypeNode)element).getObject() != null) {
//            		int status = ((TypeDescription)((TypeNode)element).getObject()).getModificationAttribut();
//            		if (((TypeDescription)((TypeNode)element).getObject()).getValidityAttribut() != ItemAttributes.STATUS_VALID) { 
//                        color = SWT.COLOR_RED;
//                    } else if (status == ItemAttributes.MODIFICATION_UPDATE) {
//    	        		System.out.println("getForeground: COLOR_GREEN");
//                        color = SWT.COLOR_GREEN;
//    	        	}
//                }
            } else if (((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_FEATURE)  {
                
        	}
            if (color != -1) {
                return _viewer.getControl().getDisplay().getSystemColor(color);
            }
        }
        return null;
    }

    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.getObject())
     */
    public Color getBackground(Object element) {
        // System.out.println("getBackground: ");
        if ( element instanceof TypeNode ) {
            if ( ((TypeNode) element).getBgColor() != null ) {
                return (Color) ((TypeNode) element).getBgColor();
            }
        } else {
            // ((TreeViewer)_viewer).getTree().tes
        }
        return null; 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



CasViewerEclipsePlugin/uimaj-ep-casviewer-core/src/main/java/org/apache/uima/casviewer/ui/internal/type/TypesTreeLabelProvider.java [192:251]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public void dispose() {
		for (Iterator i = imageCache.values().iterator(); i.hasNext();) {
			((Image) i.next()).dispose();
		}
		imageCache.clear();
	}

	protected RuntimeException unknownElement(Object element) {
		return new RuntimeException("Unknown type of element in tree of type " + element.getClass().getName());
	}	
	
    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.getObject())
     */
    public Color getForeground (Object element) {
        if ( element instanceof TypeNode ) {
            int color = -1;
        	if (((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_LABEL_FEATURES) {
                color = SWT.COLOR_BLUE;
        		
        	} else if (((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_TYPE)  {
//                if (((TypeNode)element).getObject() != null) {
//            		int status = ((TypeDescription)((TypeNode)element).getObject()).getModificationAttribut();
//            		if (((TypeDescription)((TypeNode)element).getObject()).getValidityAttribut() != ItemAttributes.STATUS_VALID) { 
//                        color = SWT.COLOR_RED;
//                    } else if (status == ItemAttributes.MODIFICATION_UPDATE) {
//    	        		System.out.println("getForeground: COLOR_GREEN");
//                        color = SWT.COLOR_GREEN;
//    	        	}
//                }
            } else if (((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_FEATURE)  {
        	}
            if (color != -1) {
                return _viewer.getControl().getDisplay().getSystemColor(color);
            }
        }
        return null;
    }

    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.getObject())
     *
     * Note: Type's node BG color is get from the node field TypeNode.getBgColor()
     *       Type system style "typesystemStyle" is NOT used.
     *       The value of "TypeNode.getBgColor()" is set by CASViewControl.showTypeSystem()
     *       for types having annotations.
     */
    public Color getBackground(Object element) {
        if ( element instanceof TypeNode ) {
            if ( ((TypeNode) element).getBgColor() != null ) {
                return (Color) ((TypeNode) element).getBgColor();
//            } else {
//                // Try to get type's style by type name
//                if ( ((TypeNode)element).getObjectType() == IItemTypeConstants.ITEM_TYPE_TYPE) {
//                    return getTypeBackground ((TypeDescription)((TypeNode)element).getObject());
//                }
            }
        } else {
        }
        return null; 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



