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

Java Milestone类代码示例

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

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



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

示例1: setMilestone

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
@Override
public Optional<Integer> setMilestone(String repoId, int issueId, String issueTitle,
                                      Optional<Integer> issueMilestone) throws IOException {
    // github api requires at least id and title
    Issue createdIssue = new Issue();
    createdIssue.setNumber(issueId);
    createdIssue.setTitle(issueTitle);

    Milestone gitHubMilestone = new Milestone();
    // set milestone number to the desired milestone id
    // simply don't set a number to demilestone
    issueMilestone.ifPresent(gitHubMilestone::setNumber);
    createdIssue.setMilestone(gitHubMilestone);

    Issue returnedIssue = issueService.editIssue(RepositoryId.createFromId(repoId), createdIssue);

    return Optional.ofNullable(returnedIssue.getMilestone())
            .map(Milestone::getNumber);
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:20,代码来源:GitHubRepo.java


示例2: turboMilestoneTest

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
@Test
public void turboMilestoneTest() {
    Milestone milestone = new Milestone();
    milestone.setNumber(1);
    milestone.setState("open");
    TurboMilestone turboMilestone = new TurboMilestone("dummy/dummy", milestone);
    assertEquals(1, turboMilestone.getId());
    assertEquals("dummy/dummy", turboMilestone.getRepoId());
    turboMilestone.setDueDate(Optional.<LocalDate>empty());
    assertEquals(Optional.empty(), turboMilestone.getDueDate());
    turboMilestone.setDescription("test description");
    assertEquals("test description", turboMilestone.getDescription());
    turboMilestone.setOpen(false);
    assertEquals(false, turboMilestone.isOpen());
    turboMilestone.setOpenIssues(0);
    assertEquals(0, turboMilestone.getOpenIssues());
    turboMilestone.setClosedIssues(0);
    assertEquals(0, turboMilestone.getClosedIssues());
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:20,代码来源:TurboMilestoneTest.java


示例3: testHeaderIteratorInvalidRepo

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Tests that PageHeaderIterator throws a NoSuchElement exception when its next
 * method is called with a initial request to an non-existent repository
 *
 * @throws NoSuchElementException
 */
@Test(expected = NoSuchElementException.class)
public void testHeaderIteratorInvalidRepo() throws NoSuchElementException {
    GitHubClientEx client = new GitHubClientEx();

    Map<String, String> params = new HashMap<>();
    params.put("state", "all");

    PagedRequest<Milestone> request = new PagedRequest<>();
    String path = SEGMENT_REPOS + "/nonexistentrepo";
    request.setUri(path);
    request.setResponseContentType(CONTENT_TYPE_JSON);
    request.setParams(params);

    PageHeaderIterator iter = new PageHeaderIterator(request, client, "ETag");
    if (iter.hasNext()) {
        iter.next();
    }
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:25,代码来源:PageHeaderIteratorTests.java


示例4: testInvalidHeadRequest

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Tests that head request to nonexistent repo throws an exception
 *
 * @throws IOException
 */
@Test(expected = IOException.class)
public void testInvalidHeadRequest() throws IOException {
    GitHubClientEx client = new GitHubClientEx();

    PagedRequest<Milestone> request = new PagedRequest<>();
    Map<String, String> params = new HashMap<>();
    params.put("state", "all");

    String path = SEGMENT_REPOS + "/nonexistentrepo";
    request.setUri(path);
    request.setResponseContentType(CONTENT_TYPE_JSON);
    request.setParams(params);

    client.head(request);
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:21,代码来源:GitHubClientExTests.java


示例5: show

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Show dialog with given milestone selected
 *
 * @param selectedMilestone
 */
public void show(Milestone selectedMilestone) {
    if (repositoryMilestones == null) {
        load(selectedMilestone);
        return;
    }

    int checked = -1;
    if (selectedMilestone != null)
        for (int i = 0; i < repositoryMilestones.size(); i++)
            if (selectedMilestone.getNumber() == repositoryMilestones
                    .get(i).getNumber()) {
                checked = i;
                break;
            }
    MilestoneDialogFragment.show(activity, requestCode,
            activity.getString(string.select_milestone), null,
            repositoryMilestones, checked);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:24,代码来源:MilestoneDialog.java


示例6: merge

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
private static Map<String, Object> merge(final Milestone milestone,
                                         final String org,
                                         final String repo,
                                         final Map<Integer, Set<Map<String, String>>> assignees) {
    return ImmutableMap.<String, Object>builder()
            .put("organisation", org)
            .put("repository", repo)
            .put("id", UUID.randomUUID().toString())
            .put("url", milestone.getUrl())
            .put("title", milestone.getTitle())
            .put("number", milestone.getNumber())
            .put("openIssues", milestone.getOpenIssues())
            .put("closedIssues", milestone.getClosedIssues())
            .put("description", Strings.nullToEmpty(milestone.getDescription()))
            .put("slug", String.format("%s/%s/%d", org, repo, milestone.getNumber()))
            .put("assignees", Optional.ofNullable(assignees.get(milestone.getNumber())).orElse(emptySet()))
            .build();
}
 
开发者ID:plan3,项目名称:stoneboard,代码行数:19,代码来源:Milestones.java


示例7: getIssuesByMilestone

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
public ArrayList<Issue> getIssuesByMilestone(Repository repository, Milestone milestone){		
	try {
		Map<String, String> filterData = new HashMap<String, String>();
		filterData.put(IssueService.FILTER_MILESTONE, Integer.toString(milestone.getNumber()));
		filterData.put(IssueService.FILTER_STATE, IssueService.STATE_CLOSED);
		

		ArrayList<Issue> issues = new ArrayList<Issue>(issueService.getIssues(repository, filterData));
		filterData.put(IssueService.FILTER_STATE, IssueService.STATE_OPEN);
		issues.addAll(issueService.getIssues(repository, filterData));
		
		return issues;
	} catch (IOException e) {
		mainApp.writeNotification("Failed getting the issues.");
	}
	return null;
}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:18,代码来源:GitHubModel.java


示例8: saveMilestone

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
public Milestone saveMilestone(Repository repository, Milestone milestone,
		String oldmilestoneName) {
	try {
		System.out.println(oldmilestoneName);
		System.out.println(milestone.getTitle());

		if(oldmilestoneName.compareTo(milestone.getTitle()) == 0){
			return milestoneService.editMilestone(repository, milestone);
		}else{
			labelService.deleteLabel(repository, oldmilestoneName);
			return milestoneService.createMilestone(repository, milestone);
		}
	} catch (IOException e) {
		mainApp.writeNotification("Failed saving the milestone.\n"+e.getMessage());
		return null;
	}
}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:18,代码来源:GitHubModel.java


示例9: createUpdatedRequest

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
@Override
protected PagedRequest<Milestone> createUpdatedRequest(IRepositoryIdProvider repoId) {
    PagedRequest<Milestone> request = super.createUpdatedRequest(repoId);
    request.setParams(createUpdatedMilestonesParams());
    request.setType(new TypeToken<Milestone>() {
    }.getType());
    request.setArrayType(new TypeToken<ArrayList<Milestone>>() {
    }.getType());
    return request;
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:11,代码来源:MilestoneUpdateService.java


示例10: TurboMilestone

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
public TurboMilestone(String repoId, Milestone milestone) {
    this.id = milestone.getNumber();
    this.title = milestone.getTitle();
    this.dueDate = milestone.getDueOn() == null
            ? Optional.empty()
            : Optional.of(Utility.dateToLocalDateTime(milestone.getDueOn()).toLocalDate());
    this.description = milestone.getDescription() == null ? "" : milestone.getDescription();
    this.isOpen = milestone.getState().equals(STATE_OPEN);
    this.openIssues = milestone.getOpenIssues();
    this.closedIssues = milestone.getClosedIssues();
    this.repoId = repoId;
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:13,代码来源:TurboMilestone.java


示例11: testGetUpdatedMilestonesNoChanges

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Tests that getUpdatedItems returns empty result if the combination of ETags
 * from all pages returned by a MockServer is equal to the ETags passed into the constructor. The updated
 * ETags should then remain the same and the update check time should reflect first page' Date header
 */
@Test
public void testGetUpdatedMilestonesNoChanges() {
    GitHubClientEx client = new GitHubClientEx("localhost", 8888, "http");
    String previousETags = "4c0ad3c08dc706b76d8277a88a4c037e#4b56f029e953e9983344b9e0b60d9a71";
    MilestoneUpdateService service = new MilestoneUpdateService(client, previousETags);

    List<Milestone> milestones = service.getUpdatedItems(RepositoryId.createFromId("teammates/repo"));

    assertTrue(milestones.isEmpty());
    assertEquals(previousETags, service.getUpdatedETags());
    assertEquals(Utility.parseHTTPLastModifiedDate("Sun, 27 Dec 2015 15:28:46 GMT"),
                 service.getUpdatedCheckTime());
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:19,代码来源:MilestoneUpdateServiceTests.java


示例12: testGetUpdatedMilestonesSample

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Tests that getUpdatedItems returns all milestones recorded in resources/tests/PagedMilestonesSample
 * if last ETag of 2nd page is different from 2nd page' ETag in the responses. The updated ETags should
 * then be modified accordingly and the update check time should reflect the first page Date header
 */
@Test
public void testGetUpdatedMilestonesSample() {
    GitHubClientEx client = new GitHubClientEx("localhost", 8888, "http");
    String previousETags = "4c0ad3c08dc706b76d8277a88a4c037e#ffffff";
    String expectedETags = "4c0ad3c08dc706b76d8277a88a4c037e#4b56f029e953e9983344b9e0b60d9a71";
    MilestoneUpdateService service = new MilestoneUpdateService(client, previousETags);

    List<Milestone> milestones = service.getUpdatedItems(RepositoryId.createFromId("teammates/repo"));

    assertEquals(188, milestones.size());
    assertEquals(expectedETags, service.getUpdatedETags());
    assertEquals(Utility.parseHTTPLastModifiedDate("Sun, 27 Dec 2015 15:28:46 GMT"),
                 service.getUpdatedCheckTime());
}
 
开发者ID:HubTurbo,项目名称:HubTurbo,代码行数:20,代码来源:MilestoneUpdateServiceTests.java


示例13: MilestoneListAdapter

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
public MilestoneListAdapter(LayoutInflater inflater,
        Milestone[] milestones, int selected) {
    super(inflater, R.layout.milestone_item);

    this.selected = selected;
    setItems(milestones);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:8,代码来源:MilestoneDialogFragment.java


示例14: update

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
@Override
protected void update(int position, Milestone item) {
    setText(1, item.getTitle());

    String description = item.getDescription();
    if (!TextUtils.isEmpty(description))
        ViewUtils.setGone(setText(2, description), false);
    else
        setGone(2, true);

    setChecked(0, selected == position);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:13,代码来源:MilestoneDialogFragment.java


示例15: getMilestoneNumber

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Get milestone number for title
 *
 * @param title
 * @return number of -1 if not found
 */
public int getMilestoneNumber(String title) {
    if (repositoryMilestones == null)
        return -1;
    for (Milestone milestone : repositoryMilestones)
        if (title.equals(milestone.getTitle()))
            return milestone.getNumber();
    return -1;
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:15,代码来源:MilestoneDialog.java


示例16: updateMilestone

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
private void updateMilestone() {
    Milestone selected = filter.getMilestone();
    if (selected != null)
        milestoneText.setText(selected.getTitle());
    else
        milestoneText.setText(string.none);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:8,代码来源:EditIssuesFilterActivity.java


示例17: run

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
@Override
protected Issue run(Account account) throws Exception {
    Issue editedIssue = new Issue();
    editedIssue.setNumber(issueNumber);
    editedIssue.setMilestone(new Milestone().setNumber(milestoneNumber));
    return store.editIssue(repositoryId, editedIssue);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:8,代码来源:EditMilestoneTask.java


示例18: edit

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
/**
 * Edit issue to have given milestone
 *
 * @param milestone
 * @return this task
 */
public EditMilestoneTask edit(Milestone milestone) {
    if (milestone != null)
        milestoneNumber = milestone.getNumber();
    else
        milestoneNumber = -1;

    showIndeterminate(string.updating_milestone);

    super.execute();

    return this;
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:19,代码来源:EditMilestoneTask.java


示例19: update

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
@Override
protected void update(int position, IssueFilter filter) {
    avatars.bind(imageView(0), filter.getRepository().getOwner());
    setText(1, filter.getRepository().generateId());
    if (filter.isOpen())
        setText(2, string.open_issues);
    else
        setText(2, string.closed_issues);

    Collection<Label> labels = filter.getLabels();
    if (labels != null && !labels.isEmpty()) {
        TextView labelsText = textView(3);
        LabelDrawableSpan.setText(labelsText, labels);
        ViewUtils.setGone(labelsText, false);
    } else
        setGone(3, true);

    Milestone milestone = filter.getMilestone();
    if (milestone != null)
        ViewUtils.setGone(setText(4, milestone.getTitle()), false);
    else
        setGone(4, true);

    User assignee = filter.getAssignee();
    if (assignee != null) {
        avatars.bind(imageView(7), assignee);
        ViewUtils.setGone(setText(6, assignee.getLogin()), false);
    } else
        setGone(5, true);
}
 
开发者ID:huibinfeng0810,项目名称:github-v2,代码行数:31,代码来源:FilterListAdapter.java


示例20: setRepository

import org.eclipse.egit.github.core.Milestone; //导入依赖的package包/类
public void setRepository(Repository repository) {
	this.repository = repository;
	milestones = ghModel.getMilestones(repository);
	if(milestones != null)
	for (Milestone milestone : milestones){
		addmilestone(milestone,null);

	}
	
	final Label milestone2 = new Label("Create new milestone");
	milestone2.setMinWidth(200);
	milestone2.getStyleClass().add("item-title");
	milestone2.setStyle("-fx-border-color:white;-fx-padding: 5 15 5 15;");
	ImageView iv = new ImageView();
	iv.setImage(new Image("/Images/add.png",30,30,true,true));
	milestone2.setGraphic(iv);
	milestonesBox.getChildren().add(milestone2);
	
	milestone2.setOnMouseClicked(new EventHandler<MouseEvent>() {
		public void handle(MouseEvent event) {
			Milestone newmilestone = new Milestone();
			newmilestone.setTitle("TO DO: change milestones Name");
			ghModel.createMilestone(MilestonesController.this.repository, newmilestone);
			addmilestone(newmilestone,milestonesBox.getChildren().size()-1);
		}
	});		
}
 
开发者ID:ThibaudL,项目名称:GitHubProjectManagement,代码行数:28,代码来源:MilestonesController.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Task类代码示例发布时间:2022-05-22
下一篇:
Java AppAttemptInfo类代码示例发布时间: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