congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ModuleItem.getValue
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.scijava/scijava-common

/** Saves the value of the given module item to persistent storage. */
private <T> void saveValue(final Module module, final ModuleItem<T> item) {
  final T value = item.getValue(module);
  moduleService.save(item, value);
}
origin: org.scijava/scijava-common

private <T> void saveInput(final ModuleItem<T> input) {
  final T value = input.getValue(this);
  moduleService.save(input, value);
}
origin: scijava/scijava-common

/** Saves the value of the given module item to persistent storage. */
private <T> void saveValue(final Module module, final ModuleItem<T> item) {
  final T value = item.getValue(module);
  moduleService.save(item, value);
}
origin: scijava/scijava-common

private <T> void saveInput(final ModuleItem<T> input) {
  final T value = input.getValue(this);
  moduleService.save(input, value);
}
origin: imagej/imagej-ops

  static Object run(final Module module) {
    module.run();

    final List<Object> outputs = new ArrayList<>();
    for (final ModuleItem<?> output : module.getInfo().outputs()) {
      final Object value = output.getValue(module);
      outputs.add(value);
    }
    return outputs.size() == 1 ? outputs.get(0) : outputs;
  }
}
origin: org.scijava/scijava-common

public DefaultWidgetModel(final Context context, final InputPanel<?, ?> inputPanel,
  final Module module, final ModuleItem<?> item, final List<?> objectPool)
{
  setContext(context);
  this.inputPanel = inputPanel;
  this.module = module;
  this.item = item;
  this.objectPool = objectPool;
  convertedObjects = new WeakHashMap<>();
  if (item.getValue(module) == null) {
    // assign the item's default value as the current value
    setValue(moduleService.getDefaultValue(item));
  }
}
origin: scijava/scijava-common

public DefaultWidgetModel(final Context context, final InputPanel<?, ?> inputPanel,
  final Module module, final ModuleItem<?> item, final List<?> objectPool)
{
  setContext(context);
  this.inputPanel = inputPanel;
  this.module = module;
  this.item = item;
  this.objectPool = objectPool;
  convertedObjects = new WeakHashMap<>();
  if (item.getValue(module) == null) {
    // assign the item's default value as the current value
    setValue(moduleService.getDefaultValue(item));
  }
}
origin: org.scijava/scijava-common

protected <T> void update(final ModuleItem<T> item, final T newValue) {
  final T oldValue = item.getValue(this);
  if (oldValue != newValue) {
    item.setValue(this, newValue);
    try {
      item.callback(this);
    }
    catch (final MethodCallException exc) {
      log.error(exc);
    }
  }
}
origin: org.scijava/scijava-table

private boolean isSimple(final Module m, final ModuleItem<?> item) {
  final Class<?> type = item.getType();
  return isSimpleType(type) || //
    // NB: The output is typed on Object -- maybe the default result output.
    // In this case, let's decide based on the actual value rather than type.
    type == Object.class && isSimpleValue(item.getValue(m));
}
origin: org.scijava/scijava-common

@Override
public Object getValue() {
  final Object value = item.getValue(module);
  if (isMultipleChoice()) return ensureValidChoice(value);
  if (getObjectPool().size() > 0) return ensureValidObject(value);
  return value;
}
origin: scijava/scijava-common

@Override
public Object getValue() {
  final Object value = item.getValue(module);
  if (isMultipleChoice()) return ensureValidChoice(value);
  if (getObjectPool().size() > 0) return ensureValidObject(value);
  return value;
}
origin: scijava/scijava-common

protected <T> void update(final ModuleItem<T> item, final T newValue) {
  final T oldValue = item.getValue(this);
  if (oldValue != newValue) {
    item.setValue(this, newValue);
    try {
      item.callback(this);
    }
    catch (final MethodCallException exc) {
      log.error(exc);
    }
  }
}
origin: scijava/scijava-common

private <T> void assignDefaultValue(final Module module,
  final ModuleItem<T> item)
{
  if (module.isInputResolved(item.getName())) return;
  final T nullValue = Types.nullValue(item.getType());
  if (!Objects.equals(item.getValue(module), nullValue)) return;
  final T defaultValue = moduleService.getDefaultValue(item);
  if (defaultValue == null) return;
  item.setValue(module, defaultValue);
}
origin: org.scijava/scijava-common

private <T> void assignDefaultValue(final Module module,
  final ModuleItem<T> item)
{
  if (module.isInputResolved(item.getName())) return;
  final T nullValue = Types.nullValue(item.getType());
  if (!Objects.equals(item.getValue(module), nullValue)) return;
  final T defaultValue = moduleService.getDefaultValue(item);
  if (defaultValue == null) return;
  item.setValue(module, defaultValue);
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (input.isRequired() && input.getValue(module) == null) {
      cancel("'" + input.getName() + "' is required but unset.");
    }
  }
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  for (final ModuleItem<?> input : module.getInfo().inputs()) {
    if (input.isRequired() && input.getValue(module) == null) {
      cancel("'" + input.getName() + "' is required but unset.");
    }
  }
}
origin: org.scijava/scijava-common

/** Loads the value of the given module item from persistent storage. */
private <T> void loadValue(final Module module, final ModuleItem<T> item) {
  // skip input that has already been resolved
  if (module.isInputResolved(item.getName())) return;
  final T prefValue = moduleService.load(item);
  final Class<T> type = item.getType();
  final T defaultValue = item.getValue(module);
  final T value = getBestValue(prefValue, defaultValue, type);
  item.setValue(module, value);
}
origin: scijava/scijava-common

/** Loads the value of the given module item from persistent storage. */
private <T> void loadValue(final Module module, final ModuleItem<T> item) {
  // skip input that has already been resolved
  if (module.isInputResolved(item.getName())) return;
  final T prefValue = moduleService.load(item);
  final Class<T> type = item.getType();
  final T defaultValue = item.getValue(module);
  final T value = getBestValue(prefValue, defaultValue, type);
  item.setValue(module, value);
}
origin: scijava/scijava-common

@Override
public void process(final Module module) {
  if (displayService == null) return;
  for (final ModuleItem<?> outputItem : module.getInfo().outputs()) {
    if (module.isOutputResolved(outputItem.getName())) continue;
    final Object value = outputItem.getValue(module);
    final String name = defaultName(outputItem);
    final boolean resolved = handleOutput(name, value);
    if (resolved) module.resolveOutput(name);
  }
}
origin: org.scijava/scijava-common

@Override
public void process(final Module module) {
  if (displayService == null) return;
  for (final ModuleItem<?> outputItem : module.getInfo().outputs()) {
    if (module.isOutputResolved(outputItem.getName())) continue;
    final Object value = outputItem.getValue(module);
    final String name = defaultName(outputItem);
    final boolean resolved = handleOutput(name, value);
    if (resolved) module.resolveOutput(name);
  }
}
org.scijava.moduleModuleItemgetValue

Javadoc

Gets the item's current value with respect to the given module.

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.
  • 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.
  • getDefaultValue
    Gets the default value.
  • getChoices,
  • getDefaultValue,
  • getDescription,
  • getIOType,
  • getMaximumValue,
  • getMinimumValue,
  • getPersistKey,
  • getSoftMaximum,
  • getSoftMinimum

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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