本文整理了Java中org.guvnor.structure.repositories.Branch
类的一些代码示例,展示了Branch
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Branch
类的具体详情如下:
包路径:org.guvnor.structure.repositories.Branch
类名称:Branch
暂无
代码示例来源:origin: kiegroup/appformer
/**
* collect all branches
* @param fs
* @return
*/
private Map<String, Branch> getBranches(final FileSystem fs) {
final Map<String, Branch> branches = new HashMap<>();
for (final org.uberfire.java.nio.file.Path path : fs.getRootDirectories()) {
final String branchName = getBranchName(path);
branches.put(branchName,
new Branch(branchName,
convert(path)));
}
return branches;
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-datasource-mgmt-backend
private boolean containsBranch(final Collection<Branch> branches,
final String branchName) {
for (final Branch branch : branches) {
if (branchName.equals(branch.getName())) {
return true;
}
}
return false;
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
private Branch getBranch(final Repository repository,
final Path convertedPath) {
for (final Branch branch : repository.getBranches()) {
if (branch.getPath().equals(convertedPath)) {
return branch;
}
}
return null;
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
@Override
public void init(final ProjectBranchBreadcrumb presenter) {
final Branch currentBranch = presenter.getCurrentBranch();
final List<Item<Branch>> items = presenter.getBranches().stream()
.map(b -> new Item<>(b, b.getName(), b.equals(currentBranch) ? CHECKED : UNCHECKED, presenter::onBranchChanged, Item.Type.OPTION))
.collect(toList());
items.add(new Item<>(null, "", UNCHECKED, null, Item.Type.SEPARATOR));
items.add(new Item<>(null, ts.format(LibraryConstants.AddBranch), UNCHECKED, b -> {
final AddBranchPopUpPresenter addBranchPopUpPresenter = addBranchPopUpPresenters.get();
addBranchPopUpPresenter.show();
}, Item.Type.ACTION));
branchesDropdown.setup(items,
currentBranch.getName());
}
代码示例来源:origin: org.uberfire/uberfire-project-api
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WorkspaceProject workspaceProject = (WorkspaceProject) o;
if (requiresRefresh != workspaceProject.requiresRefresh) {
return false;
}
if (!repository.equals(workspaceProject.repository)) {
return false;
}
if (!branch.equals(workspaceProject.branch)) {
return false;
}
if (mainModule != null ? !mainModule.equals(workspaceProject.mainModule) : workspaceProject.mainModule != null) {
return false;
}
return organizationalUnit.equals(workspaceProject.organizationalUnit);
}
代码示例来源:origin: kiegroup/appformer
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WorkspaceProject workspaceProject = (WorkspaceProject) o;
if (requiresRefresh != workspaceProject.requiresRefresh) {
return false;
}
if (!repository.equals(workspaceProject.repository)) {
return false;
}
if (!branch.equals(workspaceProject.branch)) {
return false;
}
if (mainModule != null ? !mainModule.equals(workspaceProject.mainModule) : workspaceProject.mainModule != null) {
return false;
}
return organizationalUnit.equals(workspaceProject.organizationalUnit);
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
private Branch makeBranch(final String branchName,
final String repoName) {
final Path path = mock(Path.class);
doReturn("default://" + branchName + "@" + repoName + "/").when(path).toURI();
return new Branch(branchName, path);
}
}
代码示例来源:origin: kiegroup/appformer
@Override
public Optional<Branch> getBranch(Path branchRoot) {
for (final Branch branch : getBranches()) {
if (branch.getPath().equals(branchRoot)) {
return Optional.of(branch);
}
}
return Optional.empty();
}
代码示例来源:origin: kiegroup/appformer
public void addBranch(final Branch branch) {
branches.put(branch.getName(),
branch);
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
public void goToProject(final WorkspaceProject project,
final Branch branch) {
libraryInternalPreferences.load(loadedLibraryInternalPreferences -> {
final Optional<Branch> lastBranchOpened = loadedLibraryInternalPreferences.getLastBranchOpened(project);
final Command goToProjectCommand = () -> projectService.call((RemoteCallback<WorkspaceProject>) this::goToProject).resolveProject(project.getSpace(),
branch);
if (!lastBranchOpened.isPresent() || !lastBranchOpened.get().equals(branch)) {
loadedLibraryInternalPreferences.setLastBranchOpened(project,
branch);
loadedLibraryInternalPreferences.save(goToProjectCommand,
error -> {
});
} else {
goToProjectCommand.execute();
}
},
error -> {
});
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
private Branch makeBranch(final String branchName,
final String repoName) {
final Path path = mock(Path.class);
doReturn("default://" + branchName + "@" + repoName + "/").when(path).toURI();
return new Branch(branchName, path);
}
}
代码示例来源:origin: org.uberfire/uberfire-project-api
/**
* Short cut for the WorkspaceProject root.
* @return The root path of the active branch.
*/
public Path getRootPath() {
return this.getBranch().getPath();
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-ala-ui-backend
private Collection<String> toBranchNames(final Collection<Branch> branches) {
final ArrayList<String> result = new ArrayList<>();
for (final Branch branch : branches) {
result.add(branch.getName());
}
return result;
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-backend
private Branch makeBranch(final String branchName,
final String repoName) {
final Path path = mock(Path.class);
doReturn("default://" + branchName + "@" + repoName + "/").when(path).toURI();
return new Branch(branchName,
path);
}
}
代码示例来源:origin: org.uberfire/uberfire-project-backend
@Override
public WorkspaceProject resolveProject(final Space space,
final Branch branch) {
return resolveProject(space,
branch.getPath());
}
代码示例来源:origin: kiegroup/appformer
private boolean hasBranchBeenRemoved(final Repository repository,
final String branchName) {
return !repository
.getBranches()
.stream()
.anyMatch(branch -> branch.getName().equals(branchName));
}
代码示例来源:origin: kiegroup/appformer
@Test
public void repositoryWithPublicUrisAndBranchesLoadTest() {
publicURIs.add(uri1);
publicURIs.add(uri2);
branches.add(new Branch("development",
mock(Path.class)));
branches.add(new Branch("release",
mock(Path.class)));
repositoryLoadTest(publicURIs,
branches);
}
代码示例来源:origin: kiegroup/appformer
@Override
public WorkspaceProject resolveProject(final Space space,
final Branch branch) {
return resolveProject(space,
branch.getPath());
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
public void show(final Branch branch) {
this.branch = branch;
view.show(branch.getName());
}
代码示例来源:origin: kiegroup/appformer
@Test
public void repositoryWithNoPublicUrisAndBranchesLoadTest() {
branches.add(new Branch("development",
mock(Path.class)));
branches.add(new Branch("release",
mock(Path.class)));
repositoryLoadTest(publicURIs,
branches);
}
内容来源于网络,如有侵权,请联系作者删除!