Tabnine Logo
ModuleItem.isAutoFill
Code IndexAdd Tabnine to your IDE (free)

How to use
isAutoFill
method
in
org.scijava.module.ModuleItem

Best Java code snippets using org.scijava.module.ModuleItem.isAutoFill (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: net.imagej/imagej-common

private ModuleItem<?> getSingleInput(final Module module, final Class<?> type) {
  if (moduleService == null || convertService == null) return null;
  // Check the actual class first
  ModuleItem<?> item = moduleService.getSingleInput(module, type);
  if (item == null || !item.isAutoFill()) {
    // No match, so check look for classes that can be converted from the specified type
    final Collection<Class<?>> compatibleClasses = convertService.getCompatibleOutputClasses(type);
    item = moduleService.getSingleInput(module, compatibleClasses);
  }
  if (item == null || !item.isAutoFill()) return null;
  return item;
}
origin: org.scijava/scijava-common

/**
 * Helper method to look up the name of singleton module inputs of a given
 * type.
 *
 * @param module Module to check for single input
 * @param type Type of single input to look for
 * @return If the given module has exactly one input of the specified type,
 *         return that input's name. Otherwise null;
 */
protected String getSingleInput(final Module module, final Class<?> type) {
  if (moduleService == null) return null;
  final ModuleItem<?> item = moduleService.getSingleInput(module, type);
  if (item == null || !item.isAutoFill()) return null;
  return item.getName();
}
origin: scijava/scijava-common

/**
 * Helper method to look up the name of singleton module inputs of a given
 * type.
 *
 * @param module Module to check for single input
 * @param type Type of single input to look for
 * @return If the given module has exactly one input of the specified type,
 *         return that input's name. Otherwise null;
 */
protected String getSingleInput(final Module module, final Class<?> type) {
  if (moduleService == null) return null;
  final ModuleItem<?> item = moduleService.getSingleInput(module, type);
  if (item == null || !item.isAutoFill()) return null;
  return item.getName();
}
origin: scijava/scijava-common

private ModuleItem<?> getSingleItem(final Module module,
  final Collection<Class<?>> types, final Iterable<ModuleItem<?>> items)
{
  ModuleItem<?> result = null;
  for (final ModuleItem<?> item : items) {
    final String name = item.getName();
    final boolean resolved = module.isInputResolved(name);
    if (resolved) continue; // skip resolved inputs
    if (!item.isAutoFill()) continue; // skip unfillable inputs
    final Class<?> itemType = item.getType();
    for (final Class<?> type : types) {
      if (type.isAssignableFrom(itemType)) {
        if (result != null) return null; // multiple matching module items
        result = item;
        // This module item matches, so no need to check more classes.
        break;
      }
    }
  }
  return result;
}
origin: org.scijava/scijava-common

private ModuleItem<?> getSingleItem(final Module module,
  final Collection<Class<?>> types, final Iterable<ModuleItem<?>> items)
{
  ModuleItem<?> result = null;
  for (final ModuleItem<?> item : items) {
    final String name = item.getName();
    final boolean resolved = module.isInputResolved(name);
    if (resolved) continue; // skip resolved inputs
    if (!item.isAutoFill()) continue; // skip unfillable inputs
    final Class<?> itemType = item.getType();
    for (final Class<?> type : types) {
      if (type.isAssignableFrom(itemType)) {
        if (result != null) return null; // multiple matching module items
        result = item;
        // This module item matches, so no need to check more classes.
        break;
      }
    }
  }
  return result;
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  if (logService == null || moduleService == null) return;
  final ModuleItem<?> loggerInput = moduleService.getSingleInput(module,
    Logger.class);
  if (loggerInput == null || !loggerInput.isAutoFill()) return;
  String loggerName = loggerInput.getLabel();
  if(loggerName == null || loggerName.isEmpty())
    loggerName = module.getDelegateObject().getClass().getSimpleName();
  Logger logger = logService.subLogger(loggerName);
  final String name = loggerInput.getName();
  module.setInput(name, logger);
  module.resolveInput(name);
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  if (logService == null || moduleService == null) return;
  final ModuleItem<?> loggerInput = moduleService.getSingleInput(module,
    Logger.class);
  if (loggerInput == null || !loggerInput.isAutoFill()) return;
  String loggerName = loggerInput.getLabel();
  if(loggerName == null || loggerName.isEmpty())
    loggerName = module.getDelegateObject().getClass().getSimpleName();
  Logger logger = logService.subLogger(loggerName);
  final String name = loggerInput.getName();
  module.setInput(name, logger);
  module.resolveInput(name);
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (!input.isAutoFill()) continue; // cannot auto-fill this input
    final Class<?> type = input.getType();
    if (Gateway.class.isAssignableFrom(type)) {
      // input is a gateway
      @SuppressWarnings("unchecked")
      final ModuleItem<? extends Gateway> gatewayInput =
        (ModuleItem<? extends Gateway>) input;
      setGatewayValue(getContext(), module, gatewayInput);
    }
  }
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (!input.isAutoFill()) continue; // cannot auto-fill this input
    final Class<?> type = input.getType();
    if (Gateway.class.isAssignableFrom(type)) {
      // input is a gateway
      @SuppressWarnings("unchecked")
      final ModuleItem<? extends Gateway> gatewayInput =
        (ModuleItem<? extends Gateway>) input;
      setGatewayValue(getContext(), module, gatewayInput);
    }
  }
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  if (uiService == null) return; // no UI service available
  final UserInterface ui = uiService.getDefaultUI();
  if (ui == null) return; // no default UI
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (!input.isAutoFill()) continue; // cannot auto-fill this input
    final Class<?> type = input.getType();
    if (type.isAssignableFrom(ui.getClass())) {
      // input is a compatible UI
      final String name = input.getName();
      module.setInput(name, ui);
      module.resolveInput(name);
    }
  }
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  if (uiService == null) return; // no UI service available
  final UserInterface ui = uiService.getDefaultUI();
  if (ui == null) return; // no default UI
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (!input.isAutoFill()) continue; // cannot auto-fill this input
    final Class<?> type = input.getType();
    if (type.isAssignableFrom(ui.getClass())) {
      // input is a compatible UI
      final String name = input.getName();
      module.setInput(name, ui);
      module.resolveInput(name);
    }
  }
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (!input.isAutoFill()) continue; // cannot auto-fill this input
    final Class<?> type = input.getType();
    if (Service.class.isAssignableFrom(type)) {
      // input is a service
      @SuppressWarnings("unchecked")
      final ModuleItem<? extends Service> serviceInput =
        (ModuleItem<? extends Service>) input;
      setServiceValue(getContext(), module, serviceInput);
    }
    if (type.isAssignableFrom(getContext().getClass())) {
      // input is a compatible context
      final String name = input.getName();
      module.setInput(name, getContext());
      module.resolveInput(name);
    }
  }
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (!input.isAutoFill()) continue; // cannot auto-fill this input
    final Class<?> type = input.getType();
    if (Service.class.isAssignableFrom(type)) {
      // input is a service
      @SuppressWarnings("unchecked")
      final ModuleItem<? extends Service> serviceInput =
        (ModuleItem<? extends Service>) input;
      setServiceValue(getContext(), module, serviceInput);
    }
    if (type.isAssignableFrom(getContext().getClass())) {
      // input is a compatible context
      final String name = input.getName();
      module.setInput(name, getContext());
      module.resolveInput(name);
    }
  }
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  if (displayService == null || moduleService == null) return;
  final ModuleItem<?> displayInput =
    moduleService.getSingleInput(module, Display.class);
  if (displayInput == null || !displayInput.isAutoFill()) return;
  @SuppressWarnings("unchecked")
  final Class<? extends Display<?>> displayType =
    (Class<? extends Display<?>>) displayInput.getType();
  final Display<?> activeDisplay =
    displayService.getActiveDisplay(displayType);
  if (activeDisplay == null) return;
  final String name = displayInput.getName();
  module.setInput(name, activeDisplay);
  module.resolveInput(name);
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  if (displayService == null || moduleService == null) return;
  final ModuleItem<?> displayInput =
    moduleService.getSingleInput(module, Display.class);
  if (displayInput == null || !displayInput.isAutoFill()) return;
  @SuppressWarnings("unchecked")
  final Class<? extends Display<?>> displayType =
    (Class<? extends Display<?>>) displayInput.getType();
  final Display<?> activeDisplay =
    displayService.getActiveDisplay(displayType);
  if (activeDisplay == null) return;
  final String name = displayInput.getName();
  module.setInput(name, activeDisplay);
  module.resolveInput(name);
}
org.scijava.moduleModuleItemisAutoFill

Javadoc

Gets whether the item value is allowed to be auto-filled.

Popular methods of ModuleItem

  • getName
  • getType
    Gets the type of the item.
  • getWidgetStyle
    Gets the preferred widget style to use when rendering the item in a user interface.
  • getValue
    Gets the item's current value with respect to the given module.
  • isRequired
    Gets whether the item value must be specified (i.e., no default).
  • getColumnCount
    Gets the preferred width of the input field in characters (if applicable).
  • getGenericType
    Gets the type of the item, including Java generic parameters. For many modules, this may be the same
  • getLabel
  • getVisibility
    Gets the visibility of the item.
  • setValue
    Sets the item's current value with respect to the given module.
  • get
  • getChoices
    Gets the list of possible values.
  • get,
  • getChoices,
  • getDefaultValue,
  • getDescription,
  • getIOType,
  • getMaximumValue,
  • getMinimumValue,
  • getPersistKey,
  • getSoftMaximum,
  • getSoftMinimum

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JButton (javax.swing)
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now