@Override @NotNull public Iterator<Library> getLibraryIterator() { FilteringIterator<OrderEntry, LibraryOrderEntry> filteringIterator = new FilteringIterator<OrderEntry, LibraryOrderEntry>(myRootModel.getOrderIterator(), MODULE_LIBRARY_ORDER_ENTRY_FILTER); return new ConvertingIterator<LibraryOrderEntry, Library>(filteringIterator, ORDER_ENTRY_TO_LIBRARY_CONVERTOR); }
public String expandSilentMarcos(String str, boolean firstQueueExpand, DataContext dataContext) throws Macro.ExecutionCancelledException { final Convertor<Macro, Macro> convertor = new Convertor<Macro, Macro>() { @Override public Macro convert(Macro macro) { if (macro instanceof PromptingMacro) { return new Macro.Silent(macro, ""); } return macro; } }; return expandMacroSet( str, firstQueueExpand, dataContext, ConvertingIterator.create(getMacros().iterator(), convertor) ); }
RunWithAntBinding(JRadioButton useDefaultAnt, JRadioButton useCustomAnt, ComboboxWithBrowseButton ants, final GlobalAntConfiguration antConfiguration) { myAntConfiguration = antConfiguration; myComponents.add(useDefaultAnt); myUseCustomAnt = useCustomAnt; myComponents.add(myUseCustomAnt); myAnts = ants; myUseDefaultAnt = useDefaultAnt; ButtonGroup group = new ButtonGroup(); group.add(useDefaultAnt); group.add(myUseCustomAnt); myUseCustomAnt.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { updateEnableCombobox(); if (myUseCustomAnt.isSelected() && !myLoadingValues) myAnts.getComboBox().requestFocusInWindow(); } }); myAntsController = new ChooseAndEditComboBoxController<AntReference, AntReference>(myAnts, new ConvertingIterator.IdConvertor<AntReference>(), AntReference.COMPARATOR) { public Iterator<AntReference> getAllListItems() { return antConfiguration.getConfiguredAnts().keySet().iterator(); } public AntReference openConfigureDialog(AntReference reference, JComponent parent) { AntSetPanel antSetPanel = new AntSetPanel(); AntInstallation installation = myAntConfiguration.getConfiguredAnts().get(reference); if (installation == null) installation = myAntConfiguration.getConfiguredAnts().get(AntReference.BUNDLED_ANT); antSetPanel.reset(); antSetPanel.setSelection(installation); AntInstallation antInstallation = antSetPanel.showDialog(parent); return antInstallation != null ? antInstallation.getReference() : null; } }; myAntsController.setRenderer(new AntUIUtil.AntReferenceRenderer(myAntConfiguration)); }
@Override @Nonnull public Iterator<Library> getLibraryIterator() { FilteringIterator<OrderEntry, LibraryOrderEntry> filteringIterator = new FilteringIterator<OrderEntry, LibraryOrderEntry>(myRootLayer.getOrderIterator(), MODULE_LIBRARY_ORDER_ENTRY_FILTER); return new ConvertingIterator<LibraryOrderEntry, Library>(filteringIterator, ORDER_ENTRY_TO_LIBRARY_CONVERTOR); }
RunWithAntBinding(JRadioButton useDefaultAnt, JRadioButton useCustomAnt, ComboboxWithBrowseButton ants, final GlobalAntConfiguration antConfiguration) { myAntConfiguration = antConfiguration; myComponents.add(useDefaultAnt); myUseCustomAnt = useCustomAnt; myComponents.add(myUseCustomAnt); myAnts = ants; myUseDefaultAnt = useDefaultAnt; ButtonGroup group = new ButtonGroup(); group.add(useDefaultAnt); group.add(myUseCustomAnt); myUseCustomAnt.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { updateEnableCombobox(); if(myUseCustomAnt.isSelected() && !myLoadingValues) { myAnts.getComboBox().requestFocusInWindow(); } } }); myAntsController = new ChooseAndEditComboBoxController<AntReference, AntReference>(myAnts, new ConvertingIterator.IdConvertor<AntReference> (), AntReference.COMPARATOR) { @Override public Iterator<AntReference> getAllListItems() { return antConfiguration.getConfiguredAnts().keySet().iterator(); } @Override public AntReference openConfigureDialog(AntReference reference, JComponent parent) { Sdk sdk = myAntConfiguration.getConfiguredAnts().get(reference); SingleSdkEditor editor = new SingleSdkEditor(sdk, parent); editor.show(); Sdk selectedSdk = editor.getSelectedSdk(); if(selectedSdk != null) { if(selectedSdk.isPredefined()) { return AntReference.BUNDLED_ANT; } return new AntReference.BindedReference(sdk); } else { return AntReference.BUNDLED_ANT; } } }; myAntsController.setRenderer(new AntUIUtil.AntReferenceRenderer(myAntConfiguration)); }