Java 类com.intellij.util.containers.ConvertingIterator 实例源码

项目:intellij-ce-playground    文件:ModuleLibraryTable.java   
@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);
}
项目:intellij-ce-playground    文件:MacroManager.java   
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)
  );
}
项目:intellij-ce-playground    文件:RunWithAntBinding.java   
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));
}
项目:tools-idea    文件:ModuleLibraryTable.java   
@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);
}
项目:tools-idea    文件:MacroManager.java   
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)
  );
}
项目:tools-idea    文件:RunWithAntBinding.java   
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));
}
项目:consulo    文件:ModuleLibraryTable.java   
@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);
}
项目:consulo    文件:MacroManager.java   
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)
  );
}
项目:consulo-apache-ant    文件:RunWithAntBinding.java   
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));
}