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


Java ReflectionUtil.getRawType方法代码示例

本文整理汇总了Java中com.intellij.util.ReflectionUtil.getRawType方法的典型用法代码示例。如果您正苦于以下问题:Java ReflectionUtil.getRawType方法的具体用法?Java ReflectionUtil.getRawType怎么用?Java ReflectionUtil.getRawType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.ReflectionUtil的用法示例。


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

示例1: shouldBeShown

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
protected boolean shouldBeShown(final Type type) {
  final Map<Class, Boolean> hiders = DomUtil.getFile(getDomElement()).getUserData(TREE_NODES_HIDERS_KEY);
  if (type == null || hiders == null || hiders.size() == 0) return true;

  final Class aClass = ReflectionUtil.getRawType(type);

  List<Class> allParents = new ArrayList<Class>();
  for (Map.Entry<Class, Boolean> entry : hiders.entrySet()) {
    if (entry.getKey().isAssignableFrom(aClass)) {
      allParents.add(entry.getKey());
    }
  }
  if (allParents.size() == 0) return false;

  Collections.sort(allParents, INHERITORS_COMPARATOR);

  return hiders.get(allParents.get(0)).booleanValue();

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AbstractDomElementNode.java

示例2: isMarkedType

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
protected boolean isMarkedType(Type type, Key<List<Class>> key) {
  if (type == null) {
    return false;
  }
  final List<Class> classes = DomUtil.getFile(getDomElement()).getUserData(key);
  if (classes != null) {
    Class clazz = ReflectionUtil.getRawType(type);
    return classes.contains(clazz);
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:BaseDomElementNode.java

示例3: getNodeIcon

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Override
  public Icon getNodeIcon() {
    Class clazz = ReflectionUtil.getRawType(myChildDescription.getType());
//        Class arrayClass = Array.newInstance(clazz, 0).getClass();
    ElementPresentationTemplate template = myChildDescription.getPresentationTemplate();
    if (template != null) {
      return template.createPresentation(null).getIcon();
    }
    return ElementPresentationManager.getIconForClass(clazz);
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DomElementsGroupNode.java

示例4: canNavigate

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Override
public boolean canNavigate(DomElement element) {
  final Class<DomElement> aClass = (Class<DomElement>)ReflectionUtil.getRawType(myChildDescription.getType());

  final DomElement domElement = element.getParentOfType(aClass, false);

  return domElement != null && myCollectionElements.contains(domElement);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DomCollectionControl.java

示例5: navigate

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Override
public void navigate(DomElement element) {
  final Class<DomElement> aClass = (Class<DomElement>)ReflectionUtil.getRawType(myChildDescription.getType());
  final DomElement domElement = element.getParentOfType(aClass, false);

  int index = myCollectionElements.indexOf(domElement);
  if (index < 0) index = 0;

  myCollectionPanel.getTable().setRowSelectionInterval(index, index);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DomCollectionControl.java

示例6: createGenericValueControl

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@NotNull
private static BaseControl createGenericValueControl(final Type type, final GenericDomValue<?> element, boolean commitOnEveryChange) {
  final DomStringWrapper stringWrapper = new DomStringWrapper(element);
  final Class rawType = ReflectionUtil.getRawType(type);
  if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
    return new ComboControl(stringWrapper, rawType);
  }
  if (DomElement.class.isAssignableFrom(rawType)) {
    final ComboControl control = new ComboControl(element);
    final Required annotation = element.getAnnotation(Required.class);
    if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
      control.setNullable(true);
    }
    return control;
  }

  final DomFixedWrapper wrapper = new DomFixedWrapper(element);
  if (type.equals(boolean.class) || type.equals(Boolean.class)) {
    return new BooleanControl(wrapper);
  }
  if (type.equals(String.class)) {
    return getDomUIFactory().createTextControl(wrapper, commitOnEveryChange);
  }

  final BaseControl customControl = getDomUIFactory().createCustomControl(type, stringWrapper, commitOnEveryChange);
  if (customControl != null) return customControl;

  return getDomUIFactory().createTextControl(stringWrapper, commitOnEveryChange);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:DomUIFactory.java

示例7: calcPresentationTemplate

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Nullable
private ElementPresentationTemplate calcPresentationTemplate() {
  Class clazz = ReflectionUtil.getRawType(getType());
  Presentation presentation = DomApplicationComponent.getInstance().getInvocationCache(clazz).getClassAnnotation(Presentation.class);
  return presentation == null ? null : new ElementPresentationTemplateImpl(presentation, clazz);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:AbstractDomChildDescriptionImpl.java

示例8: getColumnClass

import com.intellij.util.ReflectionUtil; //导入方法依赖的package包/类
@Override
public final Class<T> getColumnClass() {
  return (Class<T>)ReflectionUtil.getRawType(myChildDescription.getType());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ChildGenericValueColumnInfo.java


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