use of com.android.tools.idea.uibuilder.property.ptable.PTableModel in project android by JetBrains.
the class NlTableCellEditor method removeDesignProperty.
public static void removeDesignProperty(@NotNull JTable table, int row) {
NlPropertyItem designProperty = getPropertyAt(table, row);
assert designProperty != null && TOOLS_URI.equals(designProperty.getNamespace());
int previousRow = getPreviousPropertyRow(designProperty, table, row);
PTableModel model = (PTableModel) table.getModel();
designProperty.setValue(null);
designProperty.delete();
model.collapse(row);
model.deleteRow(row);
//noinspection SSBasedInspection
SwingUtilities.invokeLater(() -> table.editCellAt(previousRow, 1));
}
use of com.android.tools.idea.uibuilder.property.ptable.PTableModel in project android by JetBrains.
the class NlTableCellEditor method addDesignProperty.
public static void addDesignProperty(@NotNull JTable table, int row) {
NlPropertyItem property = getPropertyAt(table, row);
assert property != null && !TOOLS_URI.equals(property.getNamespace());
assert getDesignProperty(table, row) == null;
PTableModel model = (PTableModel) table.getModel();
int nextRow = getNextPropertyRow(property, row);
model.insertRow(nextRow, property.getDesignTimeProperty());
if (property.isExpanded()) {
model.expand(nextRow);
}
//noinspection SSBasedInspection
SwingUtilities.invokeLater(() -> table.editCellAt(row + 1, 1));
}
Aggregations