org.eclipse.emf.ecore.impl.BasicEObjectImpl Java Examples

The following examples show how to use org.eclipse.emf.ecore.impl.BasicEObjectImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PapyrusModelCreator.java    From txtUML with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Copies the content of the sourceUMLPath to the umlFile
 * The referenced Profile files will be also copied
 * @param sourceUMLPath - The path of the source .uml File
 */
private void setUpUMLFile(String sourceUMLPath){
		copyFile(sourceUMLPath, umlFile);
		
		Model m = getUmlModel();
		EList<Profile> profiles = m.getAllAppliedProfiles();
		for(Profile profile : profiles){
					String filestring = ((BasicEObjectImpl) profile).eProxyURI().toPlatformString(false);
					Path profileFilepath = new Path(filestring);
					
					String oldFolder = new Path(new Path(sourceUMLPath).toFile().getParent().toString()).toString();
					String oldFileName = oldFolder+Path.SEPARATOR+profileFilepath.toFile().getName();
					
					int index = umlFilePath.lastIndexOf(Path.SEPARATOR);
					String newFileName = umlFilePath.substring(0, index)+Path.SEPARATOR+profileFilepath.toFile().getName();
					IFile newFile = fileFromPath(newFileName);
					
					copyFile(oldFileName, newFile);
		}
}
 
Example #2
Source File: BpmnModelUtil.java    From fixflow with Apache License 2.0 6 votes vote down vote up
public static  BaseElement getBaseElement(DefinitionsBehavior definitions,BaseElement baseElement){
	if(baseElement==null){
		return null;
	}
	if(baseElement.getId()==null){
		BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
		if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
			String elementId=basicEObjectImpl.eProxyURI().fragment();
			BaseElement bpmnElement=definitions.getElement(elementId);
			return bpmnElement;
		}
		else{
			return null;
		}
	}else{
		return baseElement;
	}
}
 
Example #3
Source File: GetFlowGraphicsElementPositionCmd.java    From fixflow with Apache License 2.0 6 votes vote down vote up
private  BaseElement getBaseElement(BaseElement baseElement){
	if(baseElement==null){
		return null;
	}
	if(baseElement.getId()==null){
		BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
		if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
			String elementId=basicEObjectImpl.eProxyURI().fragment();
			BaseElement bpmnElement=definitions.getElement(elementId);
			return bpmnElement;
		}
		else{
			return null;
		}
	}else{
		return baseElement;
	}
}
 
Example #4
Source File: EcoreUtilN4.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Will be called by super class once for each proxy. Super class will ensure that
 * <code>crossReferencedEObject</code> is a proxy.
 */
@Override
protected void add(InternalEObject eObject, EReference eReference, EObject crossReferencedEObject) {
	handler.handle(eObject, eReference, (BasicEObjectImpl) crossReferencedEObject);
}
 
Example #5
Source File: GetFlowGraphicsSvgCmd.java    From fixflow with Apache License 2.0 3 votes vote down vote up
private  BaseElement getBaseElement(BaseElement baseElement)
{
	
	
	
	if(baseElement==null){
		return null;
	}
	
	if(baseElement.getId()==null){
		BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
		if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
			String elementId=basicEObjectImpl.eProxyURI().fragment();
			BaseElement bpmnElement=definitions.getElement(elementId);
			return bpmnElement;
		}
		else{
			return null;
		}
	}else{
		return baseElement;
	}
	
	
	
	
	
}
 
Example #6
Source File: EcoreUtilN4.java    From n4js with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Will be invoked for each proxy.
 */
public void handle(InternalEObject source, EReference eReference, BasicEObjectImpl targetProxy);