本文整理汇总了Java中com.intellij.uiDesigner.lw.LwInspectionSuppression.getComponentId方法的典型用法代码示例。如果您正苦于以下问题:Java LwInspectionSuppression.getComponentId方法的具体用法?Java LwInspectionSuppression.getComponentId怎么用?Java LwInspectionSuppression.getComponentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.uiDesigner.lw.LwInspectionSuppression
的用法示例。
在下文中一共展示了LwInspectionSuppression.getComponentId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeInspectionSuppressions
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入方法依赖的package包/类
private void writeInspectionSuppressions(final XmlWriter writer) {
if (myInspectionSuppressions.size() > 0) {
writer.startElement(UIFormXmlConstants.ELEMENT_INSPECTION_SUPPRESSIONS);
for(LwInspectionSuppression suppression: myInspectionSuppressions) {
writer.startElement(UIFormXmlConstants.ELEMENT_SUPPRESS);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_INSPECTION, suppression.getInspectionId());
if (suppression.getComponentId() != null) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_ID, suppression.getComponentId());
}
writer.endElement();
}
writer.endElement();
}
}
示例2: suppressInspection
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入方法依赖的package包/类
public void suppressInspection(String inspectionId, @Nullable RadComponent component) {
for(int i=myInspectionSuppressions.size()-1; i >= 0; i--) {
LwInspectionSuppression suppression = myInspectionSuppressions.get(i);
if (suppression.getInspectionId().equals(inspectionId)) {
if (component != null && (component.getId().equals(suppression.getComponentId()) || suppression.getComponentId() == null)) {
return;
}
if (component == null && suppression.getComponentId() != null) {
myInspectionSuppressions.remove(i);
}
}
}
myInspectionSuppressions.add(new LwInspectionSuppression(inspectionId, component == null ? null : component.getId()));
}
示例3: isInspectionSuppressed
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入方法依赖的package包/类
public boolean isInspectionSuppressed(final String inspectionId, final String componentId) {
for(LwInspectionSuppression suppression: myInspectionSuppressions) {
if ((suppression.getComponentId() == null || suppression.getComponentId().equals(componentId)) &&
suppression.getInspectionId().equals(inspectionId)) {
return true;
}
}
return false;
}
示例4: createDescriptor
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入方法依赖的package包/类
@NotNull
public NodeDescriptor createDescriptor(final Object element,final NodeDescriptor parentDescriptor){
if(element==myRootElement){
return new RootDescriptor(parentDescriptor,myRootElement);
}
else if(element instanceof ComponentPtr){
return new ComponentPtrDescriptor(parentDescriptor,(ComponentPtr)element);
}
else if (element instanceof LwInspectionSuppression[]) {
return new SuppressionGroupDescriptor(parentDescriptor, (LwInspectionSuppression[]) element);
}
else if (element instanceof LwInspectionSuppression) {
final LwInspectionSuppression suppression = (LwInspectionSuppression)element;
RadComponent target = (RadComponent)(suppression.getComponentId() == null
? null
: FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()));
return new SuppressionDescriptor(parentDescriptor, target, suppression);
}
else if (element instanceof RadButtonGroup[]) {
return new ButtonGroupListDescriptor(parentDescriptor, (RadButtonGroup[]) element);
}
else if (element instanceof RadButtonGroup) {
return new ButtonGroupDescriptor(parentDescriptor, (RadButtonGroup) element);
}
else{
throw new IllegalArgumentException("unknown element: "+element);
}
}
示例5: getChildElements
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入方法依赖的package包/类
public Object[] getChildElements(final Object element){
if(element==myRootElement){
ArrayList<Object> elements = new ArrayList<Object>();
final RadRootContainer rootContainer=myEditor.getRootContainer();
elements.add(new ComponentPtr(myEditor, rootContainer));
final LwInspectionSuppression[] suppressions = rootContainer.getInspectionSuppressions();
if (suppressions.length > 0) {
elements.add(suppressions);
}
RadButtonGroup[] buttonGroups = rootContainer.getButtonGroups();
if (buttonGroups.length > 0) {
elements.add(buttonGroups);
}
return elements.toArray();
}
else if(element instanceof ComponentPtr){
final ComponentPtr ptr=(ComponentPtr)element;
LOG.assertTrue(ptr.isValid()); // pointer must be valid
final RadComponent component=ptr.getComponent();
if(component instanceof RadContainer){
final RadContainer container=(RadContainer)component;
final ComponentPtr[] ptrs=new ComponentPtr[container.getComponentCount()];
for(int i=0;i<ptrs.length;i++){
ptrs[i]=new ComponentPtr(myEditor,container.getComponent(i));
}
return ptrs;
}else{
return ourEmptyObjectArray;
}
}
else if (element instanceof LwInspectionSuppression[]) {
ArrayList<LwInspectionSuppression> result = new ArrayList<LwInspectionSuppression>();
for(LwInspectionSuppression suppression: (LwInspectionSuppression[]) element) {
if (suppression.getComponentId() == null ||
FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()) != null) {
result.add(suppression);
}
}
return ArrayUtil.toObjectArray(result);
}
else if (element instanceof RadButtonGroup[]) {
return (RadButtonGroup[]) element;
}
else if (element instanceof LwInspectionSuppression || element instanceof RadButtonGroup) {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
else{
throw new IllegalArgumentException("unknown element: "+element);
}
}