@Override public String getName() { if (fResource != null) return fResource.getName(); return null; }
/** * Returns a label for a resource name. * * @param resource the resource * @return the label of the resource name. */ public static String getResourceName(IResource resource) { return markLTR(resource.getName(), ":."); //$NON-NLS-1$ }
/** * Returns name if it is defined, or * blank string if not. */ static String getResourceName(IMarker marker) { return marker.getResource().getName(); }
/** * Returns name if it is defined, or * blank string if not. */ public static String getResourceName(IMarker marker) { return marker.getResource().getName(); }
/** * Adds a child delta to the list of children for this delta node. * @param delta */ protected void add(ProposedResourceDelta delta) { if (children.size() == 0 && status == 0) setKind(IResourceDelta.CHANGED); children.put(delta.getResource().getName(), delta); }
private int getFormattingKind(ICompilationUnit cu, boolean includeComments) { int kind = includeComments ? CodeFormatter.F_INCLUDE_COMMENTS : 0; if (cu.getResource() != null && cu.getResource().getName().equals(IModule.MODULE_INFO_JAVA)) { kind |= CodeFormatter.K_MODULE_INFO; } else { kind |= CodeFormatter.K_COMPILATION_UNIT; } return kind; }
@Override public String getName() { IResource resource = getResource(); return resource.getName() + " - " + resource.getFullPath().toString(); //$NON-NLS-1$ } }
/** * Returns the styled string for the given resource. * The returned label is BiDi-processed with {@link TextProcessor#process(String, String)}. * * @param resource the resource * @return the styled string * @since 3.4 */ private static StyledString getStyledResourceLabel(IResource resource) { StyledString result= new StyledString(resource.getName()); return Strings.markLTR(result); }
/** * Returns true if this resource represents the project description file, and * false otherwise. */ protected boolean isProjectDescriptionFile(IResource resource) { return resource.getType() == IResource.FILE && resource.getFullPath().segmentCount() == 2 && resource.getName().equals(IProjectDescription.DESCRIPTION_FILE_NAME); }
private String formatResourceMessage(IResource element) { IContainer parent = element.getParent(); if (parent != null && parent.getType() != IResource.ROOT) return BasicElementLabels.getResourceName(element.getName()) + JavaElementLabels.CONCAT_STRING + BasicElementLabels.getPathLabel(parent.getFullPath(), false); else return BasicElementLabels.getResourceName(element.getName()); }
private String getShortName(ITypedElement element) { if (element instanceof FileRevisionTypedElement){ FileRevisionTypedElement fileRevisionElement = (FileRevisionTypedElement) element; return fileRevisionElement.getName(); } else if (element instanceof LocalResourceTypedElement){ LocalResourceTypedElement typedContent = (LocalResourceTypedElement) element; return typedContent.getResource().getName(); } return element.getName(); }
private String getShortName(ITypedElement element) { if (element instanceof FileRevisionTypedElement){ FileRevisionTypedElement fileRevisionElement = (FileRevisionTypedElement) element; return fileRevisionElement.getName(); } else if (element instanceof LocalResourceTypedElement){ LocalResourceTypedElement typedContent = (LocalResourceTypedElement) element; return typedContent.getResource().getName(); } return element.getName(); }
@Override public boolean isBuildFile(IResource resource) { return resource != null && resource.getProject() != null && resource.getType() == IResource.FILE && resource.getName().equals("pom.xml") //Check pom.xml is at the root of the project && resource.getProject().equals(resource.getParent()); }
protected void handleCheckStateChanged(IResource resource, boolean checked) { fOriginalResource = resource; isChecked = checked; boolean wasTopParentChecked = fTreeViewer.getChecked(fOriginalResource.getParent()); if (!isChecked) { resource = handleAllUnselected(resource, resource.getName()); } fParentResource = resource; handleBuildCheckStateChange(wasTopParentChecked); }
@Override public boolean encloses(IJavaElement element) { try { IResource underlyingResource = element.getUnderlyingResource(); if (underlyingResource != null && isJarFile(underlyingResource.getName())) { return false; } } catch (JavaModelException e) { JavaCore.getPlugin().getLog().log(e.getStatus()); } return this.searchScope.encloses(element); }
public void addCopyDelta(IResource copy, CopyArguments arguments) { if (fIgnoreCount == 0) { IPath destination= ((IResource)arguments.getDestination()).getFullPath().append(copy.getName()); internalAdd(new CopyDescription(copy, destination)); } }
public void addCopyDelta(IResource copy, CopyArguments arguments) { if (fIgnoreCount == 0) { IPath destination= ((IResource)arguments.getDestination()).getFullPath().append(copy.getName()); internalAdd(new CopyDescription(copy, destination)); } }