use of com.intellij.openapi.actionSystem.DataProvider in project intellij-community by JetBrains.
the class NavigationItemListCellRenderer method getBackgroundColor.
protected static Color getBackgroundColor(@Nullable Object value) {
if (value instanceof PsiElement || value instanceof DataProvider) {
final PsiElement psiElement = value instanceof PsiElement ? (PsiElement) value : CommonDataKeys.PSI_ELEMENT.getData((DataProvider) value);
if (psiElement != null && psiElement.isValid()) {
VirtualFile virtualFile = PsiUtilCore.getVirtualFile(psiElement);
Color fileColor = virtualFile == null ? null : EditorTabbedContainer.calcTabColor(psiElement.getProject(), virtualFile);
if (fileColor != null) {
return fileColor;
}
}
}
return UIUtil.getListBackground();
}
use of com.intellij.openapi.actionSystem.DataProvider in project intellij-plugins by JetBrains.
the class IDEAFacade method getData.
public static Object getData(Component c, String dataId) {
Object result = null;
while (c != null) {
if (c instanceof DataProvider) {
DataProvider provider = (DataProvider) c;
Object data = provider.getData(dataId);
if (data != null) {
result = data;
break;
}
}
c = c.getParent();
}
return result;
}
Aggregations