Search in sources :

Example 1 with SelectedIndexProperty

use of com.android.tools.idea.ui.properties.swing.SelectedIndexProperty in project android by JetBrains.

the class ChooseActivityStep method onWizardStarting.

@Override
protected void onWizardStarting(@NotNull final ModelWizard.Facade wizard) {
    myListeners.listen(new SelectedIndexProperty(myTargetActivityComboBox), new InvalidationListener() {

        @Override
        public void onInvalidated(@NotNull ObservableValue<?> sender) {
            ActivityTemplate targetTemplate = (ActivityTemplate) myTargetActivityComboBox.getSelectedItem();
            // Set the target template in the model immediately (instead of waiting until
            // onProceeding), since whether this is set or not affects if later steps show up.
            getModel().setTargetTemplate(targetTemplate);
            wizard.updateNavigationProperties();
        }
    });
    myTargetActivityComboBox.setSelectedItem(getModel().getTargetTemplate());
}
Also used : SelectedIndexProperty(com.android.tools.idea.ui.properties.swing.SelectedIndexProperty) InvalidationListener(com.android.tools.idea.ui.properties.InvalidationListener) ActivityTemplate(com.android.tools.idea.wizard.model.demo.npw.android.ActivityTemplate)

Aggregations

InvalidationListener (com.android.tools.idea.ui.properties.InvalidationListener)1 SelectedIndexProperty (com.android.tools.idea.ui.properties.swing.SelectedIndexProperty)1 ActivityTemplate (com.android.tools.idea.wizard.model.demo.npw.android.ActivityTemplate)1