use of com.intellij.ui.AncestorListenerAdapter in project intellij-community by JetBrains.
the class StudyNewProjectPanel method initListeners.
private void initListeners() {
myRefreshButton.addActionListener(new RefreshActionListener());
myCoursesComboBox.addActionListener(new CourseSelectedListener());
setupBrowseButton();
addAncestorListener(new AncestorListenerAdapter() {
@Override
public void ancestorMoved(AncestorEvent event) {
if (!isComboboxInitialized && isVisible()) {
isComboboxInitialized = true;
initCoursesCombobox();
}
CourseInfo selectedCourse = (CourseInfo) myCoursesComboBox.getSelectedItem();
if (selectedCourse == null || selectedCourse.equals(CourseInfo.INVALID_COURSE)) {
setError(CONNECTION_ERROR);
}
}
});
}
use of com.intellij.ui.AncestorListenerAdapter in project android by JetBrains.
the class SdkUpdaterConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
myChannelChangedCallback = new Runnable() {
@Override
public void run() {
Channel channel = StudioSettingsController.getInstance().getChannel();
if (myCurrentChannel == null) {
myCurrentChannel = channel;
}
if (!Objects.equal(channel, myCurrentChannel)) {
myCurrentChannel = channel;
myPanel.refresh();
}
}
};
myPanel = new SdkUpdaterConfigPanel(myChannelChangedCallback, new StudioDownloader(), StudioSettingsController.getInstance(), this);
JComponent component = myPanel.getComponent();
component.addAncestorListener(new AncestorListenerAdapter() {
@Override
public void ancestorAdded(AncestorEvent event) {
myChannelChangedCallback.run();
}
});
return myPanel.getComponent();
}
Aggregations