Search in sources :

Example 1 with StringToDoubleAdapterProperty

use of com.android.tools.idea.ui.properties.adapters.StringToDoubleAdapterProperty in project android by JetBrains.

the class ConfigureDeviceOptionsStep method onWizardStarting.

@Override
protected void onWizardStarting(@NotNull ModelWizard.Facade wizard) {
    myDeviceTypeComboBox.setModel(new CollectionComboBoxModel<>(AvdWizardUtils.ALL_DEVICE_TAGS));
    myDeviceTypeComboBox.setRenderer(new ListCellRendererWrapper<IdDisplay>() {

        @Override
        public void customize(JList list, IdDisplay value, int index, boolean selected, boolean hasFocus) {
            if (value == null || SystemImage.DEFAULT_TAG.equals(value)) {
                setText(DEFAULT_DEVICE_TYPE_LABEL);
            } else {
                setText(value.getDisplay());
            }
        }
    });
    myScrollPane.getVerticalScrollBar().setUnitIncrement(10);
    myHelpAndErrorLabel.setBackground(JBColor.background());
    myHelpAndErrorLabel.setForeground(JBColor.foreground());
    myHelpAndErrorLabel.setBorder(BorderFactory.createEmptyBorder(15, 15, 10, 10));
    myDiagScreenSizeAdapter = new StringToDoubleAdapterProperty(new TextProperty(myDiagonalScreenSize), 1, 2);
    myScreenResWidthAdapter = new StringToIntAdapterProperty(new TextProperty(myScreenResolutionWidth));
    myScreenResHeightAdapter = new StringToIntAdapterProperty(new TextProperty(myScreenResolutionHeight));
    attachBindingsAndValidators();
}
Also used : IdDisplay(com.android.sdklib.repository.IdDisplay) StringToIntAdapterProperty(com.android.tools.idea.ui.properties.adapters.StringToIntAdapterProperty) StringToDoubleAdapterProperty(com.android.tools.idea.ui.properties.adapters.StringToDoubleAdapterProperty) TextProperty(com.android.tools.idea.ui.properties.swing.TextProperty)

Aggregations

IdDisplay (com.android.sdklib.repository.IdDisplay)1 StringToDoubleAdapterProperty (com.android.tools.idea.ui.properties.adapters.StringToDoubleAdapterProperty)1 StringToIntAdapterProperty (com.android.tools.idea.ui.properties.adapters.StringToIntAdapterProperty)1 TextProperty (com.android.tools.idea.ui.properties.swing.TextProperty)1