本文整理了Java中org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper.getProject()
方法的一些代码示例,展示了WorkbenchResourceHelper.getProject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkbenchResourceHelper.getProject()
方法的具体详情如下:
包路径:org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper
类名称:WorkbenchResourceHelper
方法名:getProject
暂无
代码示例来源:origin: org.eclipse/org.eclipse.wst.common.emfworkbench.integration
protected static boolean isSameProject(Resource resourceA, Resource resourceB) {
IProject pA, pB;
pA = getProject(resourceA);
pB = getProject(resourceB);
if (pA != null && pB != null)
return pA.equals(pB);
//otherwise we do not have enough info to determine false so we must return true
return true;
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee
/**
* Notify all editModels of the change.
*/
private static void removedResources(List removedResources) {
Resource firstRes = (Resource)removedResources.get(0);
IProject proj = WorkbenchResourceHelper.getProject(firstRes);
IModelProviderEvent event = new ModelProviderEvent(IModelProviderEvent.REMOVED_RESOURCE, null,proj);
event.addResources(removedResources);
notifyModelProviders(event);
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui
public static String prependProjectName(EObject object, String label) {
String projectName = null;
if (object.eResource() != null) {
IProject proj = WorkbenchResourceHelper.getProject(object.eResource());
if (proj != null)
projectName = proj.getName();
}
if (projectName == null || projectName.equals(label))
return label;
else if (label == null || label.length() == 0)
return projectName;
else
return projectName + ": " + label; //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee
/**
* Notify all editModels of the change.
*/
private static void removedResource(Resource removedResource) {
IProject proj = WorkbenchResourceHelper.getProject(removedResource);
IModelProviderEvent event = new ModelProviderEvent(IModelProviderEvent.REMOVED_RESOURCE, null,proj);
event.addResource(removedResource);
notifyModelProviders(event);
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.common.emfworkbench.integration
public static IProject getProject(Resource res) {
IProject proj = getProject(res.getResourceSet());
if (proj == null) {
IFile file = getFile(res);
if (file != null)
proj = file.getProject();
}
return proj;
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee
/**
* Notify all editModels of the change.
*/
private static void addedResource(Resource addedResource) {
if ((addedResource != null) && (addedResource instanceof CompatibilityXMIResource))
((CompatibilityXMIResource) addedResource).setFormat(CompatibilityXMIResource.FORMAT_MOF5);
IProject proj = WorkbenchResourceHelper.getProject(addedResource);
IModelProviderEvent event = new ModelProviderEvent(IModelProviderEvent.ADDED_RESOURCE, null,proj);
event.addResource(addedResource);
notifyModelProviders(event);
}
/**
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core
IJavaProject javaProject = JavaCore.create(WorkbenchResourceHelper.getProject(getEnterpriseBean().eResource()));
IJavaElement javaElements[] = new IJavaElement[] { javaProject };
final IJavaSearchScope scope = SearchEngine.createJavaSearchScope(javaElements, true);
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.core
public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
if (!isDirty && resource.isModified()) { // The XMLModel was saved
resource.setModified(false);
long stamp = WorkbenchResourceHelper.computeModificationStamp(resource);
WorkbenchResourceHelper.setSynhronizationStamp(resource, stamp);
IProject proj = WorkbenchResourceHelper.getProject(resource);
ResourceSetWorkbenchEditSynchronizer synchronizer = (ResourceSetWorkbenchEditSynchronizer) ((ProjectResourceSet) WorkbenchResourceHelperBase.getResourceSet(proj)).getSynchronizer();
IFile aFile = WorkbenchResourceHelper.getFile(resource);
synchronizer.preSave(aFile);
}
if (isDirty)
resource.setModified(true);
}
内容来源于网络,如有侵权,请联系作者删除!