本文整理汇总了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;
}
}
示例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;
}
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}