use of com.android.tools.idea.editors.theme.ParentThemesListModel in project android by JetBrains.
the class ParentRendererEditor method getRendererComponent.
@Override
public Component getRendererComponent(JTable table, ConfiguredThemeEditorStyle value, boolean isSelected, boolean hasFocus, int row, int column) {
final TableModel model = table.getModel();
final ConfiguredThemeEditorStyle parent = value.getParent();
Font font = table.getFont();
Font scaledFont = ThemeEditorUtils.scaleFontForAttribute(font);
myParentComboBox.setFont(scaledFont);
myLabel.setFont(scaledFont);
myParentComboBox.setEnabled(model.isCellEditable(row, column));
if (parent == null) {
myParentComboBox.setModel(NO_PARENT_MODEL);
myItem = null;
} else {
ImmutableList<String> defaultThemeNames = ThemeEditorUtils.getDefaultThemeNames(myContext.getThemeResolver());
myParentComboBox.setModel(new ParentThemesListModel(defaultThemeNames, parent.getQualifiedName()));
myItem = value;
}
updateVariantsCombo();
return myPanel;
}
use of com.android.tools.idea.editors.theme.ParentThemesListModel in project android by JetBrains.
the class ParentRendererEditor method getEditorComponent.
@Override
public Component getEditorComponent(JTable table, ConfiguredThemeEditorStyle value, boolean isSelected, int row, int column) {
Font font = table.getFont();
Font scaledFont = ThemeEditorUtils.scaleFontForAttribute(font);
myParentComboBox.setFont(scaledFont);
myLabel.setFont(scaledFont);
ConfiguredThemeEditorStyle parent = value.getParent();
ImmutableList<String> defaultThemeNames = ThemeEditorUtils.getDefaultThemeNames(myContext.getThemeResolver());
myParentComboBox.setModel(new ParentThemesListModel(defaultThemeNames, parent.getQualifiedName()));
myResultValue = parent.getQualifiedName();
myItem = value;
updateVariantsCombo();
return myPanel;
}
Aggregations