本文整理匯總了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);
}