本文整理汇总了Java中com.intellij.util.xml.GenericDomValue.getAnnotation方法的典型用法代码示例。如果您正苦于以下问题:Java GenericDomValue.getAnnotation方法的具体用法?Java GenericDomValue.getAnnotation怎么用?Java GenericDomValue.getAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.xml.GenericDomValue
的用法示例。
在下文中一共展示了GenericDomValue.getAnnotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGenericValueControl
import com.intellij.util.xml.GenericDomValue; //导入方法依赖的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);
}