/** * See similar method wrapped by this one. The given project's name is substituted for the * system-name. */ public static String createModelRootId( IProject project, String domainName, boolean addExtension) { PersistenceManager manager = PersistenceManager.getDefaultInstance(); PersistableModelComponent root = manager.getRootComponent(project); String systemName = project.getName(); if (root != null) { systemName = root.getName(); } return createModelRootId(systemName, domainName, addExtension); }
/* (non-Javadoc) * @see org.xtuml.bp.core.common.ModelRoot#isPersisting() */ public boolean isPersisting() { IFile file = getFile(); // file can be null in case of default model root and default test model // root. // file may not exist if component is yet only created. if (file == null || !file.exists()) { return false; } PersistableModelComponent component = PersistenceManager.findComponent(getFile().getFullPath()); return component.isPersisting(); }
protected void setUp() throws Exception { super.setUp(); String componentPackageName = "Arrays"; PersistableModelComponent domainComponentPackage = ensureAvailableAndLoaded( projectName, componentPackageName, false, false, "Component Package"); arrayModelRoot = (Ooaofooa) domainComponentPackage.getRootModelElement().getModelRoot(); IPreferenceStore store = CorePlugin.getDefault().getPreferenceStore(); store.setValue(BridgePointPreferencesStore.ALLOW_IMPLICIT_COMPONENT_ADDRESSING, true); class ComponentNameTest implements ClassQueryInterface_c { public boolean evaluate(Object candidate) { Component_c selected = (Component_c) candidate; return selected.getName().equals("SingleDimensionFixedArrays"); } } Component_c comp = Component_c.ComponentInstance(arrayModelRoot, new ComponentNameTest()); populateFunctionInstances(); populateBridgeInstances(); class Object_test1_c implements ClassQueryInterface_c { Object_test1_c(String id) { m_id = id; } private String m_id; public boolean evaluate(Object inst) { ModelClass_c selected = (ModelClass_c) inst; return selected.getKey_lett().equals(m_id); } } ModelClass_c testObj = ModelClass_c.ModelClassInstance(arrayModelRoot, new Object_test1_c("A_T")); // $NON-NLS-1$ populateTransformerInstances(testObj, false); populateInterfaceOperationInstances(comp, "Port1", true); populateInterfaceOperationInstances(comp, "Port2", false); populateArrayStateActionInstances(); }