Search in sources :

Example 1 with IWorkbenchAdapter2

use of org.eclipse.ui.model.IWorkbenchAdapter2 in project translationstudio8 by heartsome.

the class WorkbenchLabelProvider method getColor.

private Color getColor(Object element, boolean forground) {
    IWorkbenchAdapter2 adapter = getAdapter2(element);
    if (adapter == null) {
        return null;
    }
    RGB descriptor = forground ? adapter.getForeground(element) : adapter.getBackground(element);
    if (descriptor == null) {
        return null;
    }
    return (Color) getResourceManager().get(ColorDescriptor.createFrom(descriptor));
}
Also used : Color(org.eclipse.swt.graphics.Color) IWorkbenchAdapter2(org.eclipse.ui.model.IWorkbenchAdapter2) RGB(org.eclipse.swt.graphics.RGB)

Example 2 with IWorkbenchAdapter2

use of org.eclipse.ui.model.IWorkbenchAdapter2 in project translationstudio8 by heartsome.

the class WorkbenchLabelProvider method getFont.

/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
	 */
public Font getFont(Object element) {
    IWorkbenchAdapter2 adapter = getAdapter2(element);
    if (adapter == null) {
        return null;
    }
    FontData descriptor = adapter.getFont(element);
    if (descriptor == null) {
        return null;
    }
    return (Font) getResourceManager().get(FontDescriptor.createFrom(descriptor));
}
Also used : FontData(org.eclipse.swt.graphics.FontData) IWorkbenchAdapter2(org.eclipse.ui.model.IWorkbenchAdapter2) Font(org.eclipse.swt.graphics.Font)

Aggregations

IWorkbenchAdapter2 (org.eclipse.ui.model.IWorkbenchAdapter2)2 Color (org.eclipse.swt.graphics.Color)1 Font (org.eclipse.swt.graphics.Font)1 FontData (org.eclipse.swt.graphics.FontData)1 RGB (org.eclipse.swt.graphics.RGB)1