use of com.android.tools.idea.uibuilder.property.NlPropertyItem in project android by JetBrains.
the class IdAnalyzerTest method testConstraintLayout.
public void testConstraintLayout() {
ModelBuilder modelBuilder = createConstraintLayout();
NlModel model = modelBuilder.build();
NlComponent button2 = findById(model, "button3");
NlProperty property = new NlPropertyItem(ImmutableList.of(button2), AUTO_URI, new AttributeDefinition(ATTR_LAYOUT_TOP_TO_TOP_OF));
IdAnalyzer analyzer = new IdAnalyzer(property);
List<String> ids = analyzer.findIds();
assertEquals(ImmutableList.of("button4", "button5"), ids);
}
use of com.android.tools.idea.uibuilder.property.NlPropertyItem in project android by JetBrains.
the class IdAnalyzerTest method testRelativeLayout.
public void testRelativeLayout() {
ModelBuilder modelBuilder = createRelativeLayout();
NlModel model = modelBuilder.build();
NlComponent button2 = findById(model, "button3");
NlProperty property = new NlPropertyItem(ImmutableList.of(button2), ANDROID_URI, new AttributeDefinition(ATTR_LAYOUT_ALIGN_START));
IdAnalyzer analyzer = new IdAnalyzer(property);
List<String> ids = analyzer.findIds();
assertEquals(ImmutableList.of("button4", "button5", "group1"), ids);
}
use of com.android.tools.idea.uibuilder.property.NlPropertyItem in project android by JetBrains.
the class IdAnalyzerTest method testButton1.
public void testButton1() {
ModelBuilder modelBuilder = createRelativeLayout();
NlModel model = modelBuilder.build();
NlComponent button1 = findById(model, "button1");
NlProperty labelFor = new NlPropertyItem(ImmutableList.of(button1), ANDROID_URI, new AttributeDefinition(ATTR_LABEL_FOR));
IdAnalyzer analyzer = new IdAnalyzer(labelFor);
List<String> ids = analyzer.findIds();
assertEquals(ImmutableList.of("button2", "button3", "button4", "button5", "group1", "radio_button1", "radio_button2", "radio_button3", "text_view1"), ids);
}
use of com.android.tools.idea.uibuilder.property.NlPropertyItem in project android by JetBrains.
the class NlTableCellEditor method getDesignProperty.
@Nullable
public static NlProperty getDesignProperty(@NotNull JTable table, int row) {
NlPropertyItem currentProperty = getPropertyAt(table, row);
NlPropertyItem nextProperty = getPropertyAt(table, getNextPropertyRow(currentProperty, row));
if (currentProperty != null && nextProperty != null && nextProperty.getName().equals(currentProperty.getName()) && !TOOLS_URI.equals(currentProperty.getNamespace()) && TOOLS_URI.equals(nextProperty.getNamespace())) {
return nextProperty;
}
return null;
}
Aggregations