org.eclipse.ui.model.IWorkbenchAdapter2源码实例Demo

类org.eclipse.ui.model.IWorkbenchAdapter2源码实例Demo

下面列出了org.eclipse.ui.model.IWorkbenchAdapter2 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Pydev   文件: CopiedWorkbenchLabelProvider.java
@Override
public Font getFont(Object element) {
    IWorkbenchAdapter2 adapter = getAdapter2(element);
    if (adapter == null) {
        return null;
    }

    FontData descriptor = adapter.getFont(element);
    if (descriptor == null) {
        return null;
    }

    try {
        return resourceManager.createFont(FontDescriptor.createFrom(descriptor));
    } catch (Exception e) {
        Log.log(e);
        return null;
    }

}
 
源代码2 项目: Pydev   文件: CopiedWorkbenchLabelProvider.java
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;
    }

    try {
        return resourceManager.createColor(ColorDescriptor.createFrom(descriptor));
    } catch (Exception e) {
        Log.log(e);
        return null;
    }

}
 
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));
}
 
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));
}
 
源代码5 项目: tmxeditor8   文件: WorkbenchLabelProvider.java
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));
}
 
源代码6 项目: tmxeditor8   文件: WorkbenchLabelProvider.java
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));
}
 
源代码7 项目: Pydev   文件: WrappedResource.java
public static <T> T getAdapterFromActualObject(IResource actualObject2, Class<T> adapter) {
    if (IDeferredWorkbenchAdapter.class.equals(adapter) || IWorkbenchAdapter2.class.equals(adapter)
            || IWorkbenchAdapter.class.equals(adapter)) {
        return null;
    }
    return actualObject2.getAdapter(adapter);
}
 
/**
 * Returns the implementation of IWorkbenchAdapter2 for the given object.
 * @param o
 *            the object to look up.
 * @return IWorkbenchAdapter2 or<code>null</code> if the adapter is not defined or the object is not adaptable.
 */
protected final IWorkbenchAdapter2 getAdapter2(Object o) {
	return (IWorkbenchAdapter2) Util.getAdapter(o, IWorkbenchAdapter2.class);
}
 
源代码9 项目: tmxeditor8   文件: WorkbenchLabelProvider.java
/**
 * Returns the implementation of IWorkbenchAdapter2 for the given object.
 * @param o
 *            the object to look up.
 * @return IWorkbenchAdapter2 or<code>null</code> if the adapter is not defined or the object is not adaptable.
 */
protected final IWorkbenchAdapter2 getAdapter2(Object o) {
	return (IWorkbenchAdapter2) Util.getAdapter(o, IWorkbenchAdapter2.class);
}
 
源代码10 项目: Pydev   文件: CopiedWorkbenchLabelProvider.java
/**
 * Returns the implementation of IWorkbenchAdapter2 for the given
 * object.
 * @param o the object to look up.
 * @return IWorkbenchAdapter2 or<code>null</code> if the adapter is not defined or the
 * object is not adaptable.
 */
protected final IWorkbenchAdapter2 getAdapter2(Object o) {
    return utilGetAdapter(o, IWorkbenchAdapter2.class);
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法