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