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

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

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

origin: scijava/scijava-common

@Override
public boolean isMultipleChoice() {
  final List<?> choices = item.getChoices();
  return choices != null && !choices.isEmpty();
}
origin: org.scijava/scijava-common

@Override
public boolean isMultipleChoice() {
  final List<?> choices = item.getChoices();
  return choices != null && !choices.isEmpty();
}
origin: org.scijava/scijava-common

@Override
public String[] getChoices() {
  final List<?> choicesList = item.getChoices();
  final String[] choices = new String[choicesList.size()];
  for (int i = 0; i < choices.length; i++) {
    choices[i] = choicesList.get(i).toString();
  }
  return choices;
}
origin: scijava/scijava-common

@Override
public String[] getChoices() {
  final List<?> choicesList = item.getChoices();
  final String[] choices = new String[choicesList.size()];
  for (int i = 0; i < choices.length; i++) {
    choices[i] = choicesList.get(i).toString();
  }
  return choices;
}
origin: scijava/scijava-common

@Test
public void testEnumParam() {
  final CommandInfo info = commandService.getCommand(
    CommandWithEnumParam.class);
  assertNotNull(info);
  final Iterator<ModuleItem<?>> iter = info.inputs().iterator();
  assertTrue(iter.hasNext());
  ModuleItem<?> freeform = iter.next();
  assertTrue(iter.hasNext());
  ModuleItem<?> constrained = iter.next();
  assertTrue(iter.hasNext());
  ModuleItem<?> choice = iter.next();
  assertFalse(iter.hasNext());
  assertSame(String.class, freeform.getType());
  assertNull(freeform.getChoices());
  assertSame(String.class, constrained.getType());
  assertEquals(Arrays.asList("foo", "bar", "fubar"), //
    constrained.getChoices());
  assertSame(Choice.class, choice.getType());
  assertEquals(Arrays.asList(Choice.YES, Choice.NO, Choice.MAYBE_SO), //
    choice.getChoices());
}
origin: org.scijava/scijava-common

/** Creates a new module item with the same values as the given item. */
public DefaultMutableModuleItem(final ModuleInfo info,
  final ModuleItem<T> item)
{
  super(info);
  name = item.getName();
  type = item.getType();
  genericType = item.getGenericType();
  ioType = item.getIOType();
  visibility = item.getVisibility();
  required = item.isRequired();
  persisted = item.isPersisted();
  persistKey = item.getPersistKey();
  initializer = item.getInitializer();
  validater = item.getValidater();
  callback = item.getCallback();
  widgetStyle = item.getWidgetStyle();
  minimumValue = item.getMinimumValue();
  maximumValue = item.getMaximumValue();
  softMinimum = item.getSoftMinimum();
  softMaximum = item.getSoftMaximum();
  stepSize = item.getStepSize();
  columnCount = item.getColumnCount();
  final List<T> itemChoices = item.getChoices();
  if (itemChoices != null) choices.addAll(itemChoices);
  label = item.getLabel();
  description = item.getDescription();
}
origin: scijava/scijava-common

/** Creates a new module item with the same values as the given item. */
public DefaultMutableModuleItem(final ModuleInfo info,
  final ModuleItem<T> item)
{
  super(info);
  name = item.getName();
  type = item.getType();
  genericType = item.getGenericType();
  ioType = item.getIOType();
  visibility = item.getVisibility();
  required = item.isRequired();
  persisted = item.isPersisted();
  persistKey = item.getPersistKey();
  initializer = item.getInitializer();
  validater = item.getValidater();
  callback = item.getCallback();
  widgetStyle = item.getWidgetStyle();
  minimumValue = item.getMinimumValue();
  maximumValue = item.getMaximumValue();
  softMinimum = item.getSoftMinimum();
  softMaximum = item.getSoftMaximum();
  stepSize = item.getStepSize();
  columnCount = item.getColumnCount();
  final List<T> itemChoices = item.getChoices();
  if (itemChoices != null) choices.addAll(itemChoices);
  label = item.getLabel();
  description = item.getDescription();
}
origin: scijava/scijava-common

private void assertItem(final String name, final Class<?> type,
  final String label, final ItemIO ioType, final boolean required,
  final boolean persist, final String persistKey, final String style,
  final Object value, final Object min, final Object max,
  final Object softMin, final Object softMax, final Number stepSize,
  final List<?> choices, final ModuleItem<?> item)
{
  assertEquals(name, item.getName());
  assertSame(type, item.getType());
  assertEquals(label, item.getLabel());
  assertSame(ioType, item.getIOType());
  assertEquals(required, item.isRequired());
  assertEquals(persist, item.isPersisted());
  assertEquals(persistKey, item.getPersistKey());
  assertEquals(style, item.getWidgetStyle());
  assertEquals(value, item.getDefaultValue());
  assertEquals(min, item.getMinimumValue());
  assertEquals(max, item.getMaximumValue());
  assertEquals(softMin, item.getSoftMinimum());
  assertEquals(softMax, item.getSoftMaximum());
  assertEquals(stepSize, item.getStepSize());
  assertEquals(choices, item.getChoices());
}
org.scijava.moduleModuleItemgetChoices

Javadoc

Gets the list of possible values.

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • BoxLayout (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Vim plugins
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