use of com.intellij.uiDesigner.inspections.EditorQuickFixProvider in project intellij-community by JetBrains.
the class I18nFormInspection method checkStringDescriptor.
@Override
protected void checkStringDescriptor(final Module module, final IComponent component, final IProperty prop, final StringDescriptor descriptor, final FormErrorCollector collector) {
if (isHardCodedStringDescriptor(descriptor)) {
if (isPropertyDescriptor(prop)) {
if (isSetterNonNls(module.getProject(), GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module), component.getComponentClassName(), prop.getName())) {
return;
}
}
EditorQuickFixProvider provider;
if (prop.getName().equals(BorderProperty.NAME)) {
provider = new EditorQuickFixProvider() {
@Override
public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
return new I18nizeFormBorderQuickFix(editor, UIDesignerBundle.message("i18n.quickfix.border.title"), (RadContainer) component);
}
};
} else if (prop.getName().equals(ITabbedPane.TAB_TITLE_PROPERTY) || prop.getName().equals(ITabbedPane.TAB_TOOLTIP_PROPERTY)) {
provider = new EditorQuickFixProvider() {
@Override
public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
return new I18nizeTabTitleQuickFix(editor, UIDesignerBundle.message("i18n.quickfix.tab.title", prop.getName()), component, prop.getName());
}
};
} else {
provider = new EditorQuickFixProvider() {
@Override
public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
return new I18nizeFormPropertyQuickFix(editor, UIDesignerBundle.message("i18n.quickfix.property", prop.getName()), component, (IntrospectedProperty) prop);
}
};
}
collector.addError(getID(), component, prop, UIDesignerBundle.message("inspection.i18n.message.in.form", descriptor.getValue()), provider);
}
}
Aggregations