Commit 760bfa16 authored by Dominique Blouin's avatar Dominique Blouin
Browse files

Temporary updates for latest OSATE

parent 8f8932b3
......@@ -5,6 +5,7 @@ import java.io.File;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.topcased.adele.editor.ADELEPlugin;
/**
......@@ -23,24 +24,24 @@ public class ADELEPreferenceInitializer extends AllDiagramPreferenceInitializer
public void initializeDefaultPreferences() {
super.initializeDefaultPreferences();
Preferences ps = ADELEPlugin.getDefault().getPluginPreferences();
String adminPluginPath = Platform.getPlugin("org.topcased.adele.admin").getDescriptor().getInstallURL().getPath();
adminPluginPath = adminPluginPath.replaceFirst("/plugin/", "/plugins/");
adminPluginPath = Platform.getInstallLocation().getURL().getFile()
+ adminPluginPath;
String defaultDatabasePath = adminPluginPath + "usr" + File.separator
+ "config" + File.separator + "database.odsconfig";
if (!(new File(defaultDatabasePath)).exists())
defaultDatabasePath="";
ps.setDefault(ADELEPreferenceConstants.ADELE_DATABASE_PATH, (new Path(defaultDatabasePath)).toOSString());
String defaultLMPPath = adminPluginPath + "usr" + File.separator
+ "LMP";
if (!(new File(defaultLMPPath)).exists())
defaultLMPPath="";
ps.setDefault(ADELEPreferenceConstants.ADELE_LMP_PATH, (new Path(defaultLMPPath)).toOSString());
// IEclipsePreferences ps = ADELEPlugin.getDefault().getPreferenceStore().getPluginPreferences();
//
// String adminPluginPath = Platform.getBundle("org.topcased.adele.admin").getDescriptor().getInstallURL().getPath();
// adminPluginPath = adminPluginPath.replaceFirst("/plugin/", "/plugins/");
// adminPluginPath = Platform.getInstallLocation().getURL().getFile()
// + adminPluginPath;
//
// String defaultDatabasePath = adminPluginPath + "usr" + File.separator
// + "config" + File.separator + "database.odsconfig";
// if (!(new File(defaultDatabasePath)).exists())
// defaultDatabasePath="";
// ps.setDefault(ADELEPreferenceConstants.ADELE_DATABASE_PATH, (new Path(defaultDatabasePath)).toOSString());
//
// String defaultLMPPath = adminPluginPath + "usr" + File.separator
// + "LMP";
// if (!(new File(defaultLMPPath)).exists())
// defaultLMPPath="";
// ps.setDefault(ADELEPreferenceConstants.ADELE_LMP_PATH, (new Path(defaultLMPPath)).toOSString());
}
......
......@@ -11,6 +11,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.xtext.resource.SaveOptions;
import org.osate.aadl2.NamedElement;
......@@ -136,7 +137,7 @@ public class AdeleOsateSynchronizationRelationImpl extends MoteSynchronizationRe
@Override
protected ResourceSet createResourceSet() {
return OsateResourceUtil.createXtextResourceSet();
return new ResourceSetImpl();//OsateResourceUtil.createXtextResourceSet();
}
@Override
......
......@@ -6,6 +6,7 @@ import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
......@@ -180,11 +181,11 @@ public class AadlPropertiesPanel extends AdelePropertyPanel {
public void run() {
// WOrkaround: refresh the resource which may have been modified by synchronization layer.
final Resource resource = OsateResourceUtil.getResource( currentSelectionUri.trimFragment() );
if ( resource != null ) {
resource.unload();
}
// final Resource resource = OsateResourceUtil.getResource( currentSelectionUri.trimFragment() );
//
// if ( resource != null ) {
// resource.unload();
// }
// PropertyAssociationWizard wizard = new PropertyAssociationWizard( null, getCommandStack(), currentSelectionUri, serializer, aadl2Parser, linker);
// WizardDialog dialog = new WizardDialog( getShell(), wizard );
......@@ -238,7 +239,7 @@ public class AadlPropertiesPanel extends AdelePropertyPanel {
if (currentSelectionUri != null) {
buildNewModel(getCurrentElement());
showTree();
addNewPropertyAssociationToolbarAction.setEnabled( !EMFUtil.isReadOnly( currentSelectionUri.trimFragment(), OsateResourceUtil.getResourceSet().getURIConverter() ) );
addNewPropertyAssociationToolbarAction.setEnabled( !EMFUtil.isReadOnly( currentSelectionUri.trimFragment(), ExtensibleURIConverterImpl.INSTANCE ) );
}
else {
showNoProperties();
......
......@@ -2,8 +2,6 @@ package fr.labsticc.adosate.ide.property;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IActionBars;
import org.osate.core.OsateCorePlugin;
import org.osate.xtext.aadl2.ui.internal.Aadl2Activator;
import org.topcased.adele.common.properties.AdelePropertyPanel;
import org.topcased.adele.common.properties.AdelePropertySection;
......@@ -13,7 +11,7 @@ public class AadlPropertiesPropertySection extends AdelePropertySection {
public AdelePropertyPanel createPropertyPanel( final Composite p_parent,
final IActionBars p_actionBars ) {
final AadlPropertiesPanel aadlPropPanel = new AadlPropertiesPanel( p_parent );
OsateCorePlugin.getDefault().getInjector( Aadl2Activator.ORG_OSATE_XTEXT_AADL2_AADL2 ).injectMembers( aadlPropPanel );
//OsateCorePlugin.getDefault().getInjector( Aadl2Activator.ORG_OSATE_XTEXT_AADL2_AADL2 ).injectMembers( aadlPropPanel );
aadlPropPanel.createControls( p_actionBars.getToolBarManager() );
return aadlPropPanel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment