本文整理汇总了Java中org.eclipse.emf.cdo.view.CDOView.getObject方法的典型用法代码示例。如果您正苦于以下问题:Java CDOView.getObject方法的具体用法?Java CDOView.getObject怎么用?Java CDOView.getObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.emf.cdo.view.CDOView
的用法示例。
在下文中一共展示了CDOView.getObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkDetachedObjects
import org.eclipse.emf.cdo.view.CDOView; //导入方法依赖的package包/类
/**
* Checks for {@link CDOSessionInvalidationEvent#getDetachedObjects() detached objects}.
*
* @param cdoSessionInvalidationEvent
* the {@link CDOSessionInvalidationEvent}
*/
protected void checkDetachedObjects(final CDOSessionInvalidationEvent cdoSessionInvalidationEvent) {
final CDOView view = cdoSessionInvalidationEvent.getSource().openView(cdoSessionInvalidationEvent
.getBranch(), cdoSessionInvalidationEvent.getPreviousTimeStamp());
for (CDOIDAndVersion cdoidAndVersion : cdoSessionInvalidationEvent.getDetachedObjects()) {
final CDOObject object = view.getObject(cdoidAndVersion.getID());
if (object instanceof CDOResourceNode) {
final CDOResourceNode node = (CDOResourceNode)object;
for (IBase base : bases) {
final ILocation repositoryLocation = MappingUtils.getConnectorRegistry().getLocation(base,
view);
if (repositoryLocation != null) {
deleteResourceNode(repositoryLocation, node);
}
}
} else {
// TODO other deletions/resource change
}
}
view.close();
}
示例2: renameResourceNode
import org.eclipse.emf.cdo.view.CDOView; //导入方法依赖的package包/类
/**
* Renames the given {@link CDOResourceNode} and its contents if any.
*
* @param newView
* the {@link CDOView} before changes
* @param repositoryLocation
* the repository location
* @param oldNode
* the {@link CDOResourceNode} before changes
* @param newNode
* the {@link CDOResourceNode} after changes
*/
private void renameResourceNode(CDOView newView, ILocation repositoryLocation, CDOResourceNode oldNode,
CDOResourceNode newNode) {
final ILocation location = MappingUtils.getConnectorRegistry().getLocation(repositoryLocation,
oldNode);
if (location != null) {
MappingUtils.getConnectorRegistry().updateLocation(location, newNode);
}
if (oldNode instanceof CDOResourceFolder) {
for (CDOResourceNode oldChild : ((CDOResourceFolder)oldNode).getNodes()) {
final CDOResourceNode newChild = (CDOResourceNode)newView.getObject(oldChild.cdoID());
if (newChild != null) {
renameResourceNode(newView, repositoryLocation, oldChild, newChild);
}
}
}
}
示例3: checkAttachedObjects
import org.eclipse.emf.cdo.view.CDOView; //导入方法依赖的package包/类
/**
* Checks for {@link CDOSessionInvalidationEvent#getNewObjects() attached objects}.
*
* @param cdoSessionInvalidationEvent
* the {@link CDOSessionInvalidationEvent}
*/
protected void checkAttachedObjects(CDOSessionInvalidationEvent cdoSessionInvalidationEvent) {
final CDOView view = cdoSessionInvalidationEvent.getLocalTransaction();
for (CDOIDAndVersion cdoidAndVersion : cdoSessionInvalidationEvent.getNewObjects()) {
final CDOObject object = view.getObject(cdoidAndVersion.getID());
if (object instanceof BaseImpl) {
registerBase(view, (BaseImpl)object);
}
}
}
示例4: checkDetachedObjects
import org.eclipse.emf.cdo.view.CDOView; //导入方法依赖的package包/类
/**
* Checks for {@link CDOSessionInvalidationEvent#getDetachedObjects() detached objects}.
*
* @param cdoSessionInvalidationEvent
* the {@link CDOSessionInvalidationEvent}
*/
protected void checkDetachedObjects(final CDOSessionInvalidationEvent cdoSessionInvalidationEvent) {
final CDOView view = cdoSessionInvalidationEvent.getSource().openView(cdoSessionInvalidationEvent
.getBranch(), cdoSessionInvalidationEvent.getPreviousTimeStamp());
for (CDOIDAndVersion cdoidAndVersion : cdoSessionInvalidationEvent.getDetachedObjects()) {
final CDOObject object = view.getObject(cdoidAndVersion.getID());
if (object instanceof BaseImpl) {
unregisterBase(view, (BaseImpl)object);
}
}
view.close();
}
示例5: getCDOObjectById
import org.eclipse.emf.cdo.view.CDOView; //导入方法依赖的package包/类
private static CDOObject getCDOObjectById(CDOView view, CDOID cdoid) {
try {
return view.getObject(cdoid);
} catch (Exception e) {
LOGGER.warn(e.getMessage(), e);
return null;
}
}
示例6: checkChangedObjects
import org.eclipse.emf.cdo.view.CDOView; //导入方法依赖的package包/类
/**
* Checks for {@link CDOSessionInvalidationEvent#getChangedObjects() changed objects}.
*
* @param cdoSessionInvalidationEvent
* the {@link CDOSessionInvalidationEvent}
*/
protected void checkChangedObjects(final CDOSessionInvalidationEvent cdoSessionInvalidationEvent) {
final CDOView oldView = cdoSessionInvalidationEvent.getSource().openView(cdoSessionInvalidationEvent
.getBranch(), cdoSessionInvalidationEvent.getPreviousTimeStamp());
final CDOView newView = cdoSessionInvalidationEvent.getLocalTransaction();
for (IBase base : bases) {
final Map<CDOView, Set<Object>> changedElements = new HashMap<CDOView, Set<Object>>();
for (CDORevisionKey cdoRevisionKey : cdoSessionInvalidationEvent.getChangedObjects()) {
final ILocation repositoryLocation = MappingUtils.getConnectorRegistry().getLocation(base,
oldView);
if (repositoryLocation != null) {
if (cdoRevisionKey instanceof CDORevisionDelta) {
final CDORevisionDelta delta = (CDORevisionDelta)cdoRevisionKey;
final CDOObject newObject = newView.getObject(delta.getID());
Set<Object> set = changedElements.get(newView);
if (set == null) {
set = new HashSet<Object>();
changedElements.put(newView, set);
}
set.add(newObject.eResource());
final CDOFeatureDelta renameDelta = delta.getFeatureDelta(EresourcePackage.eINSTANCE
.getCDOResourceNode_Name());
final CDOFeatureDelta binaryContentDelta = delta.getFeatureDelta(
EresourcePackage.eINSTANCE.getCDOBinaryResource_Contents());
final CDOFeatureDelta textContentDelta = delta.getFeatureDelta(
EresourcePackage.eINSTANCE.getCDOTextResource_Contents());
if (renameDelta != null) {
final CDOResourceNode object = (CDOResourceNode)oldView.getObject(delta.getID());
final CDOResourceNode oldNode = (CDOResourceNode)object;
renameResourceNode(newView, repositoryLocation, oldNode,
(CDOResourceNode)newObject);
} else if (binaryContentDelta != null || textContentDelta != null) {
set.add(newObject);
}
}
}
}
resourceContentChanged(base, changedElements);
}
oldView.close();
}