void addChild(PlotCommit c) { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; else if (cnt == 1) { if (!c.getId().equals(children[0].getId())) children = new PlotCommit[] { children[0], c }; } else { for (PlotCommit pc : children) if (c.getId().equals(pc.getId())) return; final PlotCommit[] n = new PlotCommit[cnt + 1]; System.arraycopy(children, 0, n, 0, cnt); n[cnt] = c; children = n; } }
void addChild(final PlotCommit c) { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; else if (cnt == 1) { if (!c.getId().equals(children[0].getId())) children = new PlotCommit[] { children[0], c }; } else { for (PlotCommit pc : children) if (c.getId().equals(pc.getId())) return; final PlotCommit[] n = new PlotCommit[cnt + 1]; System.arraycopy(children, 0, n, 0, cnt); n[cnt] = c; children = n; } }
void addChild(PlotCommit c) { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; else if (cnt == 1) { if (!c.getId().equals(children[0].getId())) children = new PlotCommit[] { children[0], c }; } else { for (PlotCommit pc : children) if (c.getId().equals(pc.getId())) return; final PlotCommit[] n = new PlotCommit[cnt + 1]; System.arraycopy(children, 0, n, 0, cnt); n[cnt] = c; children = n; } }
private void initCommitsMap() { commitsMap = new HashMap<String, PlotCommit>(); // ensure that filling (GenerateHistoryJob) and reading (here) // the commit list is thread safe synchronized (allCommits) { for (PlotCommit commit : allCommits) if (commit != null) commitsMap.put(commit.getId().name(), commit); } }
private void doCopy() { final ISelection s = table.getSelection(); if (s.isEmpty() || !(s instanceof IStructuredSelection)) return; final IStructuredSelection iss = (IStructuredSelection) s; final Iterator<PlotCommit> itr = iss.iterator(); final StringBuilder r = new StringBuilder(); while (itr.hasNext()) { final PlotCommit d = itr.next(); if (r.length() > 0) r.append(LINESEP); r.append(d.getId().name()); } if (clipboard == null || clipboard.isDisposed()) return; clipboard.setContents(new Object[] { r.toString() }, new Transfer[] { TextTransfer.getInstance() }, DND.CLIPBOARD); }
d.append(UIText.CommitMessageViewer_commit); d.append(SPACE); d.append(commit.getId().name()); d.append(LF);
public Object execute(ExecutionEvent event) throws ExecutionException { PlotCommit commit = (PlotCommit) getSelection(getPage()).getFirstElement(); final Repository repo = getRepository(event); try { WizardDialog dlg = new WizardDialog( HandlerUtil.getActiveShellChecked(event), new SimplePushRefWizard(repo, commit.getId(), UIText.PushCommitHandler_pushCommitTitle)); dlg.setHelpAvailable(true); dlg.open(); } catch (Exception e) { Activator.handleError(e.getMessage(), e, true); } return null; }
public Object execute(ExecutionEvent event) throws ExecutionException { PlotCommit commit = (PlotCommit) getSelection(getPage()).getFirstElement(); final Repository repo = getRepository(event); CreateTagDialog dialog = new CreateTagDialog(HandlerUtil .getActiveShellChecked(event), commit.getId(), repo); if (dialog.open() != Window.OK) return null; final TagBuilder tag = new TagBuilder(); PersonIdent personIdent = new PersonIdent(repo); String tagName = dialog.getTagName(); tag.setTag(tagName); tag.setTagger(personIdent); tag.setMessage(dialog.getTagMessage()); tag.setObjectId(commit); try { new TagOperation(repo, tag, dialog.shouldOverWriteTag()) .execute(new NullProgressMonitor()); } catch (CoreException e) { throw new ExecutionException(e.getMessage(), e); } return null; }