本文整理汇总了Java中com.intellij.uiDesigner.lw.LwInspectionSuppression类的典型用法代码示例。如果您正苦于以下问题:Java LwInspectionSuppression类的具体用法?Java LwInspectionSuppression怎么用?Java LwInspectionSuppression使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LwInspectionSuppression类属于com.intellij.uiDesigner.lw包,在下文中一共展示了LwInspectionSuppression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteElement
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public void deleteElement(@NotNull DataContext dataContext) {
if (myEditor != null) {
LwInspectionSuppression[] suppressions = LW_INSPECTION_SUPPRESSION_ARRAY_DATA_KEY.getData(dataContext);
if (suppressions != null) {
if (!myEditor.ensureEditable()) return;
for(LwInspectionSuppression suppression: suppressions) {
myEditor.getRootContainer().removeInspectionSuppression(suppression);
}
myEditor.refreshAndSave(true);
}
else {
DeleteProvider baseProvider = (DeleteProvider) myEditor.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER.getName());
if (baseProvider != null) {
baseProvider.deleteElement(dataContext);
}
}
}
}
示例2: canDeleteElement
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
@Override
public boolean canDeleteElement(@NotNull DataContext dataContext)
{
if(myEditor != null)
{
LwInspectionSuppression[] suppressions = dataContext.getData(LW_INSPECTION_SUPPRESSION_ARRAY_DATA_KEY);
if(suppressions != null)
{
return true;
}
DeleteProvider baseProvider = myEditor.getDataUnchecked(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
if(baseProvider != null)
{
return baseProvider.canDeleteElement(dataContext);
}
}
return false;
}
示例3: 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();
}
}
示例4: 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()));
}
示例5: 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;
}
示例6: removeInspectionSuppression
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public void removeInspectionSuppression(final LwInspectionSuppression suppression) {
for(LwInspectionSuppression existing: myInspectionSuppressions) {
if (existing.getInspectionId().equals(suppression.getInspectionId()) &&
Comparing.equal(existing.getComponentId(), suppression.getComponentId())) {
myInspectionSuppressions.remove(existing);
break;
}
}
}
示例7: getParentElement
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public Object getParentElement(final Object element){
if (element instanceof ComponentTreeStructureRoot) {
return null;
}
else if (element instanceof LwInspectionSuppression[] || element instanceof RadButtonGroup[]) {
return myRootElement;
}
else if (element instanceof LwInspectionSuppression) {
return myEditor.getRootContainer().getInspectionSuppressions();
}
else if (element instanceof RadButtonGroup) {
return myEditor.getRootContainer().getButtonGroups();
}
else if (element instanceof ComponentPtr) { // RadContainer is also RadComponent
final ComponentPtr ptr = (ComponentPtr)element;
if (!ptr.isValid()) return myRootElement;
final RadComponent component = ptr.getComponent();
if (component instanceof RadRootContainer) {
return myRootElement;
}
else {
return component.getParent() != null ? new ComponentPtr(myEditor, component.getParent(), false) : null;
}
}
else {
throw new IllegalArgumentException("unknown element: " + element);
}
}
示例8: 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);
}
}
示例9: canDeleteElement
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public boolean canDeleteElement(@NotNull DataContext dataContext) {
if (myEditor != null) {
LwInspectionSuppression[] suppressions = LW_INSPECTION_SUPPRESSION_ARRAY_DATA_KEY.getData(dataContext);
if (suppressions != null) {
return true;
}
DeleteProvider baseProvider = (DeleteProvider) myEditor.getData(PlatformDataKeys.DELETE_ELEMENT_PROVIDER.getName());
if (baseProvider != null) {
return baseProvider.canDeleteElement(dataContext);
}
}
return false;
}
示例10: deleteElement
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
@Override
public void deleteElement(@NotNull DataContext dataContext)
{
if(myEditor != null)
{
LwInspectionSuppression[] suppressions = dataContext.getData(LW_INSPECTION_SUPPRESSION_ARRAY_DATA_KEY);
if(suppressions != null)
{
if(!myEditor.ensureEditable())
{
return;
}
for(LwInspectionSuppression suppression : suppressions)
{
myEditor.getRootContainer().removeInspectionSuppression(suppression);
}
myEditor.refreshAndSave(true);
}
else
{
DeleteProvider baseProvider = myEditor.getDataUnchecked(PlatformDataKeys.DELETE_ELEMENT_PROVIDER);
if(baseProvider != null)
{
baseProvider.deleteElement(dataContext);
}
}
}
}
示例11: getInspectionSuppressions
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public LwInspectionSuppression[] getInspectionSuppressions() {
return myInspectionSuppressions.toArray(new LwInspectionSuppression[myInspectionSuppressions.size()]);
}
示例12: setInspectionSuppressions
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public void setInspectionSuppressions(final LwInspectionSuppression[] inspectionSuppressions) {
myInspectionSuppressions.clear();
Collections.addAll(myInspectionSuppressions, inspectionSuppressions);
}
示例13: 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);
}
}
示例14: SuppressionDescriptor
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public SuppressionDescriptor(final NodeDescriptor parentDescriptor, final RadComponent target, final LwInspectionSuppression inspectionSuppression) {
super(null, parentDescriptor);
myTarget = target;
myInspectionSuppression = inspectionSuppression;
}
示例15: getSuppression
import com.intellij.uiDesigner.lw.LwInspectionSuppression; //导入依赖的package包/类
public LwInspectionSuppression getSuppression() {
return myInspectionSuppression;
}