本文整理匯總了Java中org.eclipse.core.resources.IProject.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java IProject.getName方法的具體用法?Java IProject.getName怎麽用?Java IProject.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IProject
的用法示例。
在下文中一共展示了IProject.getName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getOverwrittenShippedLibs
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private Set<String> getOverwrittenShippedLibs(Set<String> newNpmProjectNames) {
Set<String> overwrittenShippedLibNames = new HashSet<>();
Iterable<String> ps = ShippedCodeAccess.getAllShippedPaths();
for (String shippedLibPath : ps) {
URI uri = new File(shippedLibPath).toURI();
Iterable<IProject> slProjects = externalLibraryWorkspace.getProjects(uri);
for (IProject slProject : slProjects) {
String slpName = slProject.getName();
if (newNpmProjectNames.contains(slpName)) {
overwrittenShippedLibNames.add(slpName);
}
}
}
return overwrittenShippedLibNames;
}
示例2: openJscriptTransactionEditor
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
public void openJscriptTransactionEditor(IProject project) {
Transaction transaction = (Transaction)this.getObject();
String tempFileName = "_private/"+project.getName()+
"__"+transaction.getConnector().getName()+
"__"+transaction.getName();
IFile file = project.getFile(tempFileName);
IWorkbenchPage activePage = PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage();
if (activePage != null) {
try {
activePage.openEditor(new JscriptTransactionEditorInput(file,transaction),
"com.twinsoft.convertigo.eclipse.editors.jscript.JscriptTransactionEditor");
} catch(PartInitException e) {
ConvertigoPlugin.logException(e, "Error while loading the transaction editor '" + transaction.getName() + "'");
}
}
}
示例3: getOrphanGraphWalkerClasses
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/**
* @param projectName
* @return
*/
public static List<IType> getOrphanGraphWalkerClasses(IType type, boolean hint) {
try {
IProject project = ResourceManager.getResource(type.getPath().toString()).getProject();
String projectName = project.getName();
List<IType> all = findClassesWithAnnotation(projectName, GraphWalker.class, "value", true);
if (hint) {
all = GraphWalkerFacade.getSharedContexts(project, type, all);
all.remove(type);
}
Collections.sort(all, new Comparator() {
@Override
public int compare(Object o1, Object o2) {
IType type1 = (IType) o1;
IType type2 = (IType) o2;
return type1.getFullyQualifiedName().compareTo(type2.getFullyQualifiedName());
}
});
return all;
} catch (Exception e) {
ResourceManager.logException(e);
return new ArrayList<IType>();
}
}
示例4: getParameterFileIPath
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private IPath getParameterFileIPath(){
if(getEditorInput() instanceof IFileEditorInput){
IFileEditorInput input = (IFileEditorInput)getEditorInput() ;
IFile file = input.getFile();
IProject activeProject = file.getProject();
String activeProjectName = activeProject.getName();
IPath parameterFileIPath =new Path("/"+activeProjectName+"/param/"+ getPartName().replace(".job", ".properties"));
activeProjectName.concat("_").concat(getPartName().replace(".job", "_"));
return parameterFileIPath;
}else{
return null;
}
}
示例5: removeProject
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
public void removeProject(ToBeBuilt toBeBuilt, IProject project, IProgressMonitor monitor) {
storageMapper.collectNfarURIs(project, toBeBuilt.getToBeDeleted());
Iterator<Map.Entry<String, Set<URI>>> iterator = knownEntries.entrySet().iterator();
String keyPrefix = project.getName() + "|";
while (iterator.hasNext()) {
String key = iterator.next().getKey();
if (key.startsWith(keyPrefix)) {
iterator.remove();
}
}
}
示例6: removeStorage
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
public boolean removeStorage(ToBeBuilt toBeBuilt, IStorage storage, IProgressMonitor monitor) {
if (IN4JSArchive.NFAR_FILE_EXTENSION.equals(storage.getFullPath().getFileExtension())
&& storage instanceof IFile) {
IProject project = ((IFile) storage).getProject();
String key = project.getName() + "|" + storage.getFullPath().toPortableString();
Set<URI> cachedURIs = knownEntries.remove(key);
if (cachedURIs != null) {
toBeBuilt.getToBeDeleted().addAll(cachedURIs);
} else {
// cache not populated, use the index to find the URIs that shall be removed, e.g.
// can happen after a restart of Eclipse
Iterable<IResourceDescription> descriptions = builderState.getAllResourceDescriptions();
String expectedAuthority = "platform:/resource" + storage.getFullPath() + "!";
Set<URI> toBeDeleted = toBeBuilt.getToBeDeleted();
for (IResourceDescription description : descriptions) {
URI knownURI = description.getURI();
if (knownURI.isArchive()) {
String authority = knownURI.authority();
if (expectedAuthority.equals(authority)) {
toBeDeleted.add(knownURI);
}
}
}
}
return true;
}
return false;
}
示例7: getToBeBuilt
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
protected ToBeBuilt getToBeBuilt(ToBeBuiltComputer computer, IProject project, IProgressMonitor monitor) {
try {
return computer.updateProject(project, monitor);
} catch (OperationCanceledException | CoreException e) {
final String name = project.getName();
LOGGER.error("Error occurred while calculating to be build data for '" + name + "' project.", e);
throw Exceptions.sneakyThrow(e);
}
}
示例8: baseProjectName
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/**
* Computer the base name for a project base on xdsml project
* ie. if it ends with .xdsml this suffix is removed
* @param xdsmlProject
* @return
*/
public static String baseProjectName(IProject xdsmlProject){
int index = xdsmlProject.getName().indexOf(".xdsml");
if(index != -1){
return xdsmlProject.getName().substring(0, index);
}
return xdsmlProject.getName();
}
示例9: getTempFileName
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
protected String getTempFileName(IProject project) {
TreeObject object = getTreeObjectOwner();
Document document = (Document)object.getObject();
String tempFileName = "_private/"+project.getName()+
"__"+getConnectorTreeObject().getName()+
"__"+document.getName()+
"__updates."+getName();
return tempFileName;
}
示例10: openJscriptHandlerEditor
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
public void openJscriptHandlerEditor(IProject project) {
ProjectExplorerView explorerView = ConvertigoPlugin.getDefault().getProjectExplorerView();
TreeObject selectedHandler = explorerView.getFirstSelectedTreeObject();
TreeObject object = selectedHandler;
while (!(object instanceof TransactionTreeObject)) {
object = object.getParent();
}
Transaction transaction = (Transaction)object.getObject();
String tempFileName = "_private/"+project.getName()+
"__"+getConnectorTreeObject().getName()+
"__"+object.getName();
IFile file = project.getFile(tempFileName);
IWorkbenchPage activePage = PlatformUI
.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage();
if (activePage != null) {
try {
activePage.openEditor(new JscriptTransactionEditorInput(file,transaction),
"com.twinsoft.convertigo.eclipse.editors.jscript.JscriptTransactionEditor");
moveTo(selectedHandler.getName());
} catch(PartInitException e) {
ConvertigoPlugin.logException(e, "Error while loading the transaction editor '" + transaction.getName() + "'");
}
}
}
示例11: getTempFileName
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
protected String getTempFileName(IProject project) {
TreeObject object = getTreeObjectOwner();
Document document = (Document)object.getObject();
String tempFileName = "_private/"+project.getName()+
"__"+getConnectorTreeObject().getName()+
"__"+document.getName()+
"__filters."+getName();
return tempFileName;
}
示例12: getTempFileName
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
protected String getTempFileName(IProject project) {
TreeObject object = getTreeObjectOwner();
Document document = (Document)object.getObject();
String tempFileName = "_private/"+project.getName()+
"__"+getConnectorTreeObject().getName()+
"__"+document.getName()+
"__views."+getParent().getName()+"."+getName();
return tempFileName;
}
示例13: openEditor
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
public static void openEditor(IWorkbenchPage page, IProject proj) throws PartInitException {
Log.log(Log.LOG_INFO, "Opening editor for project: " + proj.getName()); //$NON-NLS-1$
if (OpenProjectUtils.checkVersionAndWarn(proj, page.getWorkbenchWindow().getShell(), true)) {
ProjectEditorInput input = new ProjectEditorInput(proj.getName());
page.openEditor(input, EDITOR.PROJECT);
}
}
示例14: execute
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Override
public Object execute(ExecutionEvent event) {
IEditorPart part = HandlerUtil.getActiveEditor(event);
if (part instanceof ProjectEditorDiffer){
((ProjectEditorDiffer) part).getChanges();
} else if (part instanceof SQLEditor && part.getEditorInput() instanceof IFileEditorInput) {
try {
SQLEditor sqlEditor = (SQLEditor) part;
IProject proj = ((IFileEditorInput) sqlEditor.getEditorInput()).getFile().getProject();
DbInfo remote = sqlEditor.getCurrentDb();
ProjectEditorDiffer editor = ChangesJobTester.findProjectEditor(proj);
if (editor == null) {
ProjectEditorDiffer.saveLastDb(remote, proj);
ProjectEditorInput projectEditorInput = new ProjectEditorInput(proj.getName());
editor = (ProjectEditorDiffer) sqlEditor.getSite().getPage()
.openEditor(projectEditorInput, EDITOR.PROJECT);
} else {
editor.setCurrentDb(remote);
editor.getSite().getPage().activate(editor);
}
editor.getChanges();
} catch (PartInitException e) {
ExceptionNotifier.notifyDefault(e.getLocalizedMessage(), e);
}
}
return null;
}
示例15: getParameterFileIPath
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private IPath getParameterFileIPath(){
IFileEditorInput input = (IFileEditorInput)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorInput() ;
IFile file = input.getFile();
IProject activeProject = file.getProject();
String activeProjectName = activeProject.getName();
//java.nio.file.Path path= java.nio.file.Path(parameterFile)
Path filePath = Paths.get(parameterFile, "");
IPath parameterFileIPath =new org.eclipse.core.runtime.Path("/"+activeProjectName+"/param/"+filePath.getFileName().toString().replace("job", "properties"));
return parameterFileIPath;
}