Common handling code for -chooseVisitors and -choosePlugins options.

@param argument
the list of visitors or plugins to be chosen
@param desc
String describing what is being chosen
@param chooser
callback object to selectively choose list members
343152
private void choose(String argument, String desc, Chooser chooser) {
        StringTokenizer tok = new StringTokenizer(argument, ",");
        while (tok.hasMoreTokens()) {
            String what = tok.nextToken().trim();
            if (!what.startsWith("+") && !what.startsWith("-")) {
                throw new IllegalArgumentException(desc + " must start with " + "\"+\" or \"-\" (saw " + what + ")");
            }
            boolean enabled = what.startsWith("+");
            chooser.choose(enabled, what.substring(1));
        }
    }
329262
function (mQueryOptions, aSelectPaths) {
			mQueryOptions.$select = mQueryOptions.$select || [];
			aSelectPaths.forEach(function (sPath) {
				if (mQueryOptions.$select.indexOf(sPath) < 0) {
					mQueryOptions.$select.push(sPath);
				}
			});
		}
1038780
@Deprecated
    @SuppressWarnings("unchecked")
    public static void deselect(final FastAdapter adapter) {
        adapter.recursive(new AdapterPredicate() {
            @Override
            public boolean apply(@NonNull IAdapter lastParentAdapter, int lastParentPosition, @NonNull IItem item, int position) {
                if (position != -1) {
                    SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class);
                    if (extension != null) {
                        extension.deselect(position);
                    }
                } else {
                    item.withSetSelected(false);
                }
                return true;
            }
        }, false);
    }
601629
protected void setSelectOptions(List<CmsSelectWidgetOption> selectOptions) {

        m_selectOptions = new ArrayList<CmsSelectWidgetOption>();
        m_selectOptions.addAll(selectOptions);
    }
978492
@Override
    public void accept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent) {
        visitor.visit(this, ClientlibVisitor.VisitorMode.DEPENDS, parent);
    }
14517
protected function addArgumentDescriptorToFunction(
        FunctionDescriptor $functionDescriptor,
        ArgumentDescriptor $argumentDescriptor
    ): void {
        $functionDescriptor->getArguments()->set($argumentDescriptor->getName(), $argumentDescriptor);
    }
922662
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this) && value != null) {
            value.visit(v);
        }
    }
359432
public static <E> OptionalFunction<Selection<Method>, E> invoke(Object... args) {
    return OptionalFunction.of(selection -> factory.createInvoker(selection.result()).on(selection.target()).withArgs(args));
  }
815568
void selectView(String viewName) {

        if (DETAILS.equals(viewName)) {
            getList().removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList());
        } else if (SMALL.equals(viewName)) {
            getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList());
            getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().smallThumbnails());
        } else if (BIG.equals(viewName)) {
            getList().addStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().tilingList());
            getList().removeStyleName(I_CmsLayoutBundle.INSTANCE.galleryResultItemCss().smallThumbnails());
        }
    }
117663
private JsHandlerRegistration addFeatureSelectionHandler2(final FeatureSelectedHandler selectedHandler,
			final FeatureDeselectedHandler deselectedHandler) {

		final List<VectorLayer> layers = ((MapImpl) map).getMapWidget().getMapModel().getVectorLayers();
		final HandlerRegistration[] registrations = new HandlerRegistration[layers.size()];

		for (int i = 0; i < layers.size(); i++) {
			final FeaturesSupported fs = (FeaturesSupported) map.getLayersModel().getLayer(layers.get(i).getId());

			registrations[i] = layers.get(i).addFeatureSelectionHandler(new FeatureSelectionHandler() {

				public void onFeatureSelected(FeatureSelectedEvent event) {
					Feature feature = new FeatureImpl(event.getFeature().toDto(), fs);
					selectedHandler.onFeatureSelected(new org.geomajas.plugin.jsapi.client.event.FeatureSelectedEvent(
							feature));
				}

				public void onFeatureDeselected(FeatureDeselectedEvent event) {
					Feature feature = new FeatureImpl(event.getFeature().toDto(), fs);
					deselectedHandler
							.onFeatureDeselected(new org.geomajas.plugin.jsapi.client.event.FeatureDeselectedEvent(
									feature));
				}
			});
		}

		return new JsHandlerRegistration(registrations);
	}
754257
protected function addArgument(string $name, string $desc, string $default_value = '', int $position = null, bool $is_require = false) : void
    {
        if($position === null){
            $position   = count($this->arguments());
        }
        $CommandArgument    = new CommandArgument($name, $desc, $default_value, $position, $is_require);
        $this->arguments()->append($CommandArgument);
    }
650288
protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs)
    {
      if (callAttrs && null != m_avts)
      {
        int nAttrs = m_avts.size();

        for (int i = (nAttrs - 1); i >= 0; i--)
        {
          AVT avt = (AVT) m_avts.get(i);
          avt.callVisitors(visitor);
        }
      }
      super.callChildVisitors(visitor, callAttrs);
    }
293660
function optionResult(options, option){
        var result = options[option];
        // If the returned value is a function, call it with the dest option parameter
        if(_.isFunction(result)){
            result = result(options.dest);
        }
        return result;
    }
306935
function SettingsRenderer(settingsListExplorer, serviceRegistry) {
		this.serviceRegistry = serviceRegistry;
		this.childWidgets = [];
		SelectionRenderer.call(this, {cachePrefix: 'pluginSettings', noRowHighlighting: true}, settingsListExplorer); //$NON-NLS-0$
	}
148478
function(desc) {
		if (desc.value && gui.Type.isFunction(desc.value)) {
			if (desc.value.$hidden && desc.configurable) {
				desc.enumerable = false;
			}
		}
		return desc;
	}
329361
function loadDescriptor(descriptor, skipOptions) {
  if (typeof descriptor.value !== "function") {
    return { value: descriptor.value, descriptor: descriptor };
  }

  var value = descriptor.value,
      options = descriptor.options;

  var item = void 0;
  try {
    if (skipOptions) {
      item = value(context);
    } else {
      item = value(context, options, { dirname: descriptor.dirname });
    }
  } catch (e) {
    if (descriptor.alias) {
      e.message += " (While processing: " + (0, _stringify2.default)(descriptor.alias) + ")";
    }
    throw e;
  }

  if (!item || (typeof item === "undefined" ? "undefined" : (0, _typeof3.default)(item)) !== "object") {
    throw new Error("Plugin/Preset did not return an object.");
  }

  return { value: item, descriptor: descriptor };
}
543594
public void select(final boolean considerSelectableFlag) {
        mFastAdapter.recursive(new AdapterPredicate<Item>() {
            @Override
            public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) {
                select(lastParentAdapter, item, -1, false, considerSelectableFlag);
                return false;
            }
        }, false);
        mFastAdapter.notifyDataSetChanged();
    }