当前位置: 首页>>代码示例>>Java>>正文


Java IWorkbenchAdapter2类代码示例

本文整理汇总了Java中org.eclipse.ui.model.IWorkbenchAdapter2的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchAdapter2类的具体用法?Java IWorkbenchAdapter2怎么用?Java IWorkbenchAdapter2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IWorkbenchAdapter2类属于org.eclipse.ui.model包,在下文中一共展示了IWorkbenchAdapter2类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFont

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
@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;
    }

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:21,代码来源:CopiedWorkbenchLabelProvider.java

示例2: getColor

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
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;
    }

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:19,代码来源:CopiedWorkbenchLabelProvider.java

示例3: getFont

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
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));
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:14,代码来源:WorkbenchLabelProvider.java

示例4: getColor

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
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));
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:13,代码来源:WorkbenchLabelProvider.java

示例5: getAdapterFromActualObject

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
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);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:8,代码来源:WrappedResource.java

示例6: getAdapter2

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:10,代码来源:WorkbenchLabelProvider.java

示例7: getAdapter2

import org.eclipse.ui.model.IWorkbenchAdapter2; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:11,代码来源:CopiedWorkbenchLabelProvider.java


注:本文中的org.eclipse.ui.model.IWorkbenchAdapter2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。