• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LabelService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.egit.github.core.service.LabelService的典型用法代码示例。如果您正苦于以下问题:Java LabelService类的具体用法?Java LabelService怎么用?Java LabelService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LabelService类属于org.eclipse.egit.github.core.service包,在下文中一共展示了LabelService类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: connect

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
public boolean connect(String username, String password){

		this.username=username;
		client = new GitHubClient();
		client.setCredentials(username, password);
		
		repoService = new MyRepositoriesService(client);
		userService = new UserService(client);
		issueService = new IssueService(client);
		milestoneService = new MilestoneService(client);
		labelService = new LabelService(client);
		commitService = new CommitService(client);
		markdownService = new MarkdownService(client);
		colaboratorService = new CollaboratorService(client);
		contentsService = new ContentsService(client);
		
		
		
		try {
			loadInformations();
			return true;
		} catch (IOException e) {
			mainApp.writeNotification(e.getMessage());
			return false;
		}
	}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:27,代码来源:GitHubModel.java


示例2: makeOrGetReviewRequestLabel

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
private Label makeOrGetReviewRequestLabel(GitHubClient client, Repo repo) {
    Label reviewRequestLabel = new Label().setColor("009800").setName("Review Request");
    
    LabelService labelService = new LabelService(client);
    try {
        reviewRequestLabel = labelService.getLabel(repo.repoOwner, repo.repoName, "Review Request");
    } catch(IOException e) {
        System.out.println("Review Request Label not found.  Going to create it");
        try {
            reviewRequestLabel = labelService.createLabel(repo.repoOwner, repo.repoName, reviewRequestLabel);
        } catch (IOException e1) {
            e1.printStackTrace();   //this is a bigger problem
        }
    }
    return reviewRequestLabel;
}
 
开发者ID:DeveloperLiberationFront,项目名称:Pdf-Reviewer,代码行数:17,代码来源:ReviewRequestServlet.java


示例3: createCustomLabels

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
private List<Label> createCustomLabels(GitHubClient client) {
    List<Label> labels = new ArrayList<>();
    LabelService labelService = new LabelService(client);
    for (String customLabel : customLabelStrings) {
        Label newLabel = new Label().setColor(randomColor()).setName(customLabel);
        try {
            Label alreadyExistingLabel = labelService.getLabel(repo.repoOwner, repo.repoName, customLabel);
            labels.add(alreadyExistingLabel);
        } catch(IOException e) {
            System.out.println("new label " +customLabel + " not found.  Going to create it");
            try {
                newLabel = labelService.createLabel(repo.repoOwner, repo.repoName, newLabel);
            } catch (IOException e1) {
                e1.printStackTrace();   //this is a bigger problem
            }
            labels.add(newLabel);
        }
    }
    return labels;
}
 
开发者ID:DeveloperLiberationFront,项目名称:Pdf-Reviewer,代码行数:21,代码来源:ReviewSubmitServlet.java


示例4: getLabelStartsWith

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
private static Label getLabelStartsWith(GitHubClient client, RepositoryId repositoryId,
    String startsWith) throws IOException {
  LabelService lservice = new LabelService(client);
  for (Label label : lservice.getLabels(repositoryId)) {
    if (label.getName().startsWith(startsWith)) {
      return label;
    }
  }
  return null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:11,代码来源:IssueManagement.java


示例5: changeLabelName

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
public static void changeLabelName(GitHubClient client, RepositoryId repositoryId,
    String labelName, String changedName) throws IOException {
  LabelService lservice = new LabelService(client);
  IssueService iservice = new IssueService(client);

  Label label = lservice.getLabel(repositoryId, labelName.replace(" ", "%20"));
  System.out.println(label.getName());

  // Create the label with the changed name
  Label changedLabel = new Label();
  changedLabel.setName(changedName);
  changedLabel.setColor(label.getColor());
  changedLabel = lservice.createLabel(repositoryId, changedLabel);

  // find issues with the existing label
  Map<String, String> filterData = new HashMap<String, String>();
  filterData.put(IssueService.FILTER_LABELS, label.getName());
  List<Issue> issues = iservice.getIssues(repositoryId, filterData);

  // label each issue with the changed label
  for (Issue issue : issues) {
    System.out.println(issue.getTitle());
    List<Label> labels = issue.getLabels();
    // delete the existing label
    for (Iterator<Label> iter = labels.listIterator(); iter.hasNext();) {
      Label l = iter.next();
      if (l.getName().equals(labelName))
        iter.remove();
    }
    // add the new changed label
    labels.add(changedLabel);
    issue.setLabels(labels);
    iservice.editIssue(repositoryId, issue);
    System.out.println(labels.toString());
  }
  // delete the existing label
  lservice.deleteLabel(repositoryId, labelName.replace(" ", "%20"));
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:39,代码来源:IssueManagement.java


示例6: LabelsDialog

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
/**
 * Create dialog helper to display labels
 *
 * @param activity
 * @param requestCode
 * @param repository
 * @param service
 */
public LabelsDialog(final DialogFragmentActivity activity,
        final int requestCode, final IRepositoryIdProvider repository,
        final LabelService service) {
    this.activity = activity;
    this.requestCode = requestCode;
    this.repository = repository;
    this.service = service;
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:17,代码来源:LabelsDialog.java


示例7: getLabelByName

import org.eclipse.egit.github.core.service.LabelService; //导入依赖的package包/类
private static Label getLabelByName(GitHubClient client, RepositoryId repositoryId,
    String labelName) throws IOException {
  LabelService lservice = new LabelService(client);
  return lservice.getLabel(repositoryId, labelName.replace(" ", "%20"));
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:6,代码来源:IssueManagement.java



注:本文中的org.eclipse.egit.github.core.service.LabelService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Version类代码示例发布时间:2022-05-22
下一篇:
Java RequestCall类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap