當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。