de.tudarmstadt.ukp.clarin.webanno.model.Project.setMode()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.model.Project.setMode()方法的一些代码示例,展示了Project.setMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.setMode()方法的具体详情如下:
包路径:de.tudarmstadt.ukp.clarin.webanno.model.Project
类名称:Project
方法名:setMode

Project.setMode介绍

暂无

代码示例

代码示例来源:origin: webanno/webanno

private DropDownChoice<String> makeProjectTypeChoice()
{
  List<String> types = projectService.listProjectTypes().stream().map(t -> t.id())
      .collect(Collectors.toList());
  DropDownChoice<String> projTypes = new BootstrapSelect<>("mode", types);
  projTypes.setRequired(true);
  projTypes.add(LambdaBehavior.onConfigure(_this -> {
    // If there is only a single project type and the project mode has not been set yet,
    // then we can simply select that and do not need to show the choice at all.
    Project project = projectModel.getObject();
    if (projectTypes.getChoices().size() == 1 && project.getMode() == null) {
      project.setMode(projectTypes.getChoices().get(0));
    }
    
    _this.setEnabled(
        nonNull(projectModel.getObject()) && isNull(projectModel.getObject().getId()));
    
    // If there is only a single project type, then we can simply select that and do not
    // need to show the choice at all.
    _this.setVisible(projTypes.getChoices().size() > 1);
  }));
  
  return projTypes;
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project

private DropDownChoice<String> makeProjectTypeChoice()
{
  List<String> types = projectService.listProjectTypes().stream().map(t -> t.id())
      .collect(Collectors.toList());
  DropDownChoice<String> projTypes = new BootstrapSelect<>("mode", types);
  projTypes.setRequired(true);
  projTypes.add(LambdaBehavior.onConfigure(_this -> {
    // If there is only a single project type and the project mode has not been set yet,
    // then we can simply select that and do not need to show the choice at all.
    Project project = projectModel.getObject();
    if (projectTypes.getChoices().size() == 1 && project.getMode() == null) {
      project.setMode(projectTypes.getChoices().get(0));
    }
    
    _this.setEnabled(
        nonNull(projectModel.getObject()) && isNull(projectModel.getObject().getId()));
    
    // If there is only a single project type, then we can simply select that and do not
    // need to show the choice at all.
    _this.setVisible(projTypes.getChoices().size() > 1);
  }));
  
  return projTypes;
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao

project.setMode(StringUtils.lowerCase(exProject.getMode(), Locale.US));

代码示例来源:origin: webanno/webanno

project.setMode(StringUtils.lowerCase(exProject.getMode(), Locale.US));

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/de.tudarmstadt.ukp.clarin.webanno.brat

/**
 * create new {@link Project} from the
 * {@link de.tudarmstadt.ukp.clarin.webanno.model.export.Project} model
 *
 * @throws IOException
 */
public static Project createProject(
    de.tudarmstadt.ukp.clarin.webanno.model.export.Project aProject,
    RepositoryService aRepository)
  throws IOException
{
  String username = SecurityContextHolder.getContext().getAuthentication().getName();
  User user = aRepository.getUser(username);
  Project project = new Project();
  String projectName = aProject.getName();
  if (aRepository.existsProject(projectName)) {
    projectName = copyProjectName(aRepository, projectName);
  }
  project.setName(projectName);
  project.setDescription(aProject.getDescription());
  project.setMode(aProject.getMode());
  aRepository.createProject(project, user);
  return project;
}

代码示例来源:origin: webanno/webanno

@Before
public void setUp() throws Exception
{
  initMocks(this);
  project = new Project();
  project.setId(1l);
  project.setName("Test Project");
  project.setMode(WebAnnoConst.PROJECT_TYPE_ANNOTATION);
  
  workFolder = tempFolder.newFolder();
  
  when(annotationService.listAnnotationLayer(any())).thenReturn(layers());
  
  sut = new LayerExporter(annotationService);
}

代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-remote

Project project = new Project();
project.setName(aName);
project.setMode(WebAnnoConst.PROJECT_TYPE_ANNOTATION);
project.setScriptDirection(ScriptDirection.LTR);
project.setState(ProjectState.NEW);

代码示例来源:origin: webanno/webanno

Project project = new Project();
project.setName(aName);
project.setMode(WebAnnoConst.PROJECT_TYPE_ANNOTATION);
project.setScriptDirection(ScriptDirection.LTR);
project.setState(ProjectState.NEW);

代码示例来源:origin: webanno/webanno

@Before
public void setup() throws Exception
{
  if (jcas == null) {
    jcas = JCasFactory.createJCas();
  }
  else {
    jcas.reset();
  }
  
  project = new Project();
  project.setId(1l);
  project.setMode(PROJECT_TYPE_ANNOTATION);
  
  neLayer = new AnnotationLayer(NamedEntity.class.getName(), "NE", SPAN_TYPE, project, true,
      TOKENS);
  neLayer.setId(1l);
  featureSupportRegistry = new FeatureSupportRegistryImpl(asList());
}

代码示例来源:origin: webanno/webanno

project.setMode(PROJECT_TYPE_ANNOTATION);

代码示例来源:origin: webanno/webanno

@Before
public void setup() throws Exception
{
  if (jcas == null) {
    jcas = JCasFactory.createJCas();
  }
  else {
    jcas.reset();
  }
  
  username = "user";
  
  project = new Project();
  project.setId(1l);
  project.setMode(PROJECT_TYPE_ANNOTATION);
  
  document = new SourceDocument();
  document.setId(1l);
  document.setProject(project);
  
  neLayer = new AnnotationLayer(NamedEntity.class.getName(), "NE", SPAN_TYPE, project, true,
      TOKENS);
  neLayer.setId(1l);
  featureSupportRegistry = new FeatureSupportRegistryImpl(asList());
  
  behaviors = asList(new SpanStackingBehavior(), new SpanCrossSentenceBehavior(),
      new SpanAnchoringModeBehavior());
}

代码示例来源:origin: webanno/webanno

project.setMode(PROJECT_TYPE_ANNOTATION);

代码示例来源:origin: webanno/webanno

project.setMode(PROJECT_TYPE_ANNOTATION);

相关文章