blob: 2cc9f4d79edf5a99cd88e44347624d6a0ef4905d [file] [log] [blame]
package org.eclipse.osbp.tools.graphical.entity.lib;
import org.eclipse.osbp.dsl.semantic.common.types.LType;
import org.eclipse.osbp.dsl.semantic.common.types.LTypedPackage;
import org.eclipse.osbp.dsl.semantic.entity.LEntityModel;
import org.eclipse.xtext.xtype.XImportSection;
import org.eclipse.xtext.xtype.XtypeFactory;
public class Util {
public static String getFQN(LType type) {
if (type == null) {
return "";
}
LTypedPackage pkg = (LTypedPackage) type.eContainer();
return pkg.getName() + "." + type.getName();
}
public static XImportSection getImportSecion(LTypedPackage pkg) {
LEntityModel model = (LEntityModel) pkg.eContainer();
XImportSection section = model.getImportSection();
if (section == null) {
section = XtypeFactory.eINSTANCE.createXImportSection();
model.setImportSection(section);
}
return section;
}
}