Java Code Examples for org.eclipse.core.resources.IResource.getName()

The following are Jave code examples for showing how to use getName() of the org.eclipse.core.resources.IResource class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: convertigo-eclipse   File: ProjectLoadingJob.java   Source Code and License Vote up 6 votes
protected void loadResource(TreeParent parentTreeObject, Object folderObject, IResource[] members) throws CoreException {
	ResourceFolderTreeObject resourceFolderTreeObject;
	if (folderObject instanceof String) resourceFolderTreeObject = new ResourceFolderTreeObject(viewer, (String) folderObject);
	else resourceFolderTreeObject = new ResourceFolderTreeObject(viewer, (IFolder) folderObject);
	parentTreeObject.addChild(resourceFolderTreeObject);

	ResourceTreeObject resourceTreeObject;
	for (int i = 0; i < members.length; i++) {
		IResource resource = members[i];
		String name = resource.getName();
		if (resource instanceof IFolder) {
			if (name.equals("_data")) continue;
			if (name.equals("_lib")) continue;
			if (name.equals("_private")) continue;
			loadResource(resourceFolderTreeObject, ((IFolder) resource), ((IFolder) resource).members());
		}
		else {
			if (name.equals(".project")) continue;
			if (name.endsWith(".etr")) continue;
			resourceTreeObject = new ResourceTreeObject(viewer, (IFile) resource);
			resourceFolderTreeObject.addChild(resourceTreeObject);
		}
	}
}
 
Example 2
Project: Tarski   File: SigTypeLabelProvider.java   Source Code and License Vote up 5 votes
@Override
public String getText(Object element) {
  if (element instanceof IResource) {
    IResource iResource = (IResource) element;
    return iResource.getName();
  } else if (element instanceof IMarker) {
    IMarker iMarker = (IMarker) element;
    return AlloyUtilities.getAtomNameById(MarkUtilities.getSourceId(iMarker));// MarkUtilities.getText(iMarker);
  } else {
    return "Unknown type: " + element.getClass();
  }
}
 
Example 3
Project: Tarski   File: CreatingAtomWizardLabelProvider.java   Source Code and License Vote up 5 votes
@Override
public String getText(Object element) {
  if (element instanceof IResource) {
    IResource iResource = (IResource) element;
    return iResource.getName();
  } else if (element instanceof IMarker) {
    IMarker iMarker = (IMarker) element;
    return MarkUtilities.getText(iMarker);
  } else {
    return "Unknown type: " + element.getClass();
  }
}