use of com.intellij.uiDesigner.radComponents.RadContainer 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);
}
}
use of com.intellij.uiDesigner.radComponents.RadContainer in project intellij-community by JetBrains.
the class GridChangeUtilTest method test_split.
public void test_split() throws Exception {
final RadContainer grid = SampleGrid.create();
GridChangeUtil.splitColumn(grid, 1);
assertGridDimensions(grid, SampleGrid.ORIGINAL_ROWS, SampleGrid.ORIGINAL_COLUMNS + 1);
assertComponentCellAndSpan(grid, 0, 0, 4);
assertComponentCellAndSpan(grid, 1, 1, 4);
assertComponentCellAndSpan(grid, 2, 0, 5);
assertComponentCellAndSpan(grid, 3, 1, 2);
assertComponentCellAndSpan(grid, 4, 3, 3);
assertComponentCellAndSpan(grid, 5, 0, 1);
}
use of com.intellij.uiDesigner.radComponents.RadContainer in project intellij-community by JetBrains.
the class GridChangeUtilTest method createGrid.
private static RadContainer createGrid(final int rowCount, final int columnCount, final Insets margin, final int hGap, final int vGap) {
final RadContainer container = new RadContainer(null, "grid");
container.setLayout(new GridLayoutManager(rowCount, columnCount, margin, hGap, vGap));
return container;
}
use of com.intellij.uiDesigner.radComponents.RadContainer in project intellij-community by JetBrains.
the class GridChangeUtilTest method test_insert_last.
public void test_insert_last() throws Exception {
final RadContainer grid = SampleGrid.create();
GridChangeUtil.insertRowOrColumn(grid, SampleGrid.ORIGINAL_COLUMNS - 1, false, false);
assertGridDimensions(grid, SampleGrid.ORIGINAL_ROWS, SampleGrid.ORIGINAL_COLUMNS + 1);
// no component should change its cell or span
assertComponentCellAndSpan(grid, 0, SampleGrid.C0, SampleGrid.S0);
assertComponentCellAndSpan(grid, 1, SampleGrid.C1, SampleGrid.S1);
assertComponentCellAndSpan(grid, 2, SampleGrid.C2, SampleGrid.S2);
assertComponentCellAndSpan(grid, 3, SampleGrid.C3, SampleGrid.S3);
assertComponentCellAndSpan(grid, 4, SampleGrid.C4, SampleGrid.S4);
assertComponentCellAndSpan(grid, 5, SampleGrid.C5, SampleGrid.S5);
}
use of com.intellij.uiDesigner.radComponents.RadContainer in project intellij-community by JetBrains.
the class GridChangeUtilTest method testMoveRowDown.
public void testMoveRowDown() throws Exception {
final RadContainer grid = SampleGrid.create();
GridChangeUtil.moveCells(grid, true, new int[] { 3 }, 6);
assertEquals(5, grid.getComponent(3).getConstraints().getRow());
assertEquals(3, grid.getComponent(4).getConstraints().getRow());
assertEquals(4, grid.getComponent(5).getConstraints().getRow());
}
Aggregations