/** Returns true if given project is under git version control system, false otherwise. */ private boolean isProjectUnderGit(Project project) { return VCS_GIT.equals(project.getAttribute(VCS_PROVIDER_NAME)); } }
@Override public void update(ActionEvent e) { panel.clear(); Project project = appContext.getRootProject(); if (project != null && project.getAttributes().containsKey(GIT_CURRENT_HEAD_NAME)) { Label projectNameLabel = new Label(project.getName()); projectNameLabel.ensureDebugId("statusBarProjectBranchRepositoryName"); projectNameLabel.getElement().getStyle().setMarginLeft(5., Unit.PX); panel.add(projectNameLabel); SVGImage branchIcon = new SVGImage(resources.checkoutReference()); branchIcon.getSvgElement().getStyle().setMarginLeft(5., Unit.PX); panel.add(branchIcon); Label headLabel = new Label(project.getAttribute(GIT_CURRENT_HEAD_NAME)); headLabel.ensureDebugId("statusBarProjectBranchName"); headLabel.setTitle(constant.branchesControlTitle()); Style headLabelStyle = headLabel.getElement().getStyle(); headLabelStyle.setCursor(Cursor.POINTER); headLabelStyle.setMarginLeft(5., Unit.PX); headLabel.addClickHandler(event -> branchPresenter.showBranches(project)); panel.add(headLabel); } } }
/** {@inheritDoc} */ @Override public void intercept(Resource resource) { if (!Boolean.valueOf(preferencesManager.getValue(PREF_SHOW_ARTIFACT_ID))) { return; } if (resource.isProject() && ((Project) resource).isTypeOf(MAVEN_ID)) { final String artifact = ((Project) resource).getAttribute(ARTIFACT_ID); if (!isNullOrEmpty(artifact) && !artifact.equals(resource.getName())) { resource.addMarker(new PresentableTextMarker(resource.getName() + " [" + artifact + "]")); } } } }
/** {@inheritDoc} */ @Override public void intercept(Resource resource) { if (resource.isFile() && POM_XML.equals(resource.getName())) { Project project = resource.getProject(); if (project != null && project.isTypeOf(MAVEN_ID) && resource.getParent().getLocation().equals(project.getLocation())) { String artifact = project.getAttribute(ARTIFACT_ID); if (!isNullOrEmpty(artifact) && !UNKNOWN_VALUE.equals(artifact)) { resource.addMarker(new PresentableTextMarker(artifact)); } } } } }
Container container = ((ContainerNode) node).getData(); if (container instanceof Project) { String head = container.getProject().getAttribute("git.current.head.name"); if (head != null) { Element nodeContainer = element.getFirstChildElement();