Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mbe-tools
OSATE-DIM
Commits
7c2987b7
Commit
7c2987b7
authored
May 05, 2022
by
Rakshit Mittal
Browse files
removed extension preference from UI for time-being
parent
28d66026
Changes
3
Hide whitespace changes
Inline
Side-by-side
fr.mem4csd.osatedim.ui/src/fr/mem4csd/osatedim/ui/DeinstantiationPropertyPage.java
View file @
7c2987b7
...
...
@@ -25,7 +25,6 @@ import org.eclipse.ui.dialogs.PropertyPage;
import
org.osate.ui.internal.preferences.InstantiationPreferencePage
;
import
org.osgi.service.prefs.BackingStoreException
;
import
org.osgi.service.prefs.Preferences
;
import
fr.mem4csd.osatedim.viatra.preference.ClassifierExtensionPreference
;
public
class
DeinstantiationPropertyPage
extends
PropertyPage
{
...
...
@@ -36,7 +35,7 @@ public class DeinstantiationPropertyPage extends PropertyPage {
private
Preferences
preferences
;
private
Button
noClassifierExtensionButton
,
requiredClassifierExtensionButton
,
alwaysClassifierExtensionButton
;
//
private Button noClassifierExtensionButton, requiredClassifierExtensionButton, alwaysClassifierExtensionButton;
Button
useWorkspaceSettingsButton
;
Button
useProjectSettingsButton
;
...
...
@@ -114,25 +113,25 @@ public class DeinstantiationPropertyPage extends PropertyPage {
label3
.
setText
(
"ADD DIM_Classifier Property to newly created classifiers"
);
label3
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
false
,
false
,
1
,
1
));
final
Composite
radioGroup1
=
new
Composite
(
composite
,
SWT
.
NONE
);
radioGroup1
.
setLayout
(
new
GridLayout
());
radioGroup1
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
noClassifierExtensionButton
=
new
Button
(
radioGroup1
,
SWT
.
RADIO
);
noClassifierExtensionButton
.
setText
(
"NONE"
);
requiredClassifierExtensionButton
=
new
Button
(
radioGroup1
,
SWT
.
RADIO
);
requiredClassifierExtensionButton
.
setText
(
"ONLY REQUIRED (Structural changes)"
);
alwaysClassifierExtensionButton
=
new
Button
(
radioGroup1
,
SWT
.
RADIO
);
alwaysClassifierExtensionButton
.
setText
(
"ALWAYS"
);
if
(
getExtendClassifier
()
==
"none"
)
{
noClassifierExtensionButton
.
setSelection
(
true
);
}
else
if
(
getExtendClassifier
()
==
"required"
)
{
requiredClassifierExtensionButton
.
setSelection
(
true
);
}
else
{
alwaysClassifierExtensionButton
.
setSelection
(
true
);
}
//
final Composite radioGroup1 = new Composite(composite, SWT.NONE);
//
radioGroup1.setLayout(new GridLayout());
//
radioGroup1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//
//
noClassifierExtensionButton = new Button(radioGroup1, SWT.RADIO);
//
noClassifierExtensionButton.setText("NONE");
//
//
requiredClassifierExtensionButton = new Button(radioGroup1, SWT.RADIO);
//
requiredClassifierExtensionButton.setText("ONLY REQUIRED (Structural changes)");
//
//
alwaysClassifierExtensionButton = new Button(radioGroup1, SWT.RADIO);
//
alwaysClassifierExtensionButton.setText("ALWAYS");
//
if (getExtendClassifier() == "none") {
//
noClassifierExtensionButton.setSelection(true);
//
} else if (getExtendClassifier() == "required") {
//
requiredClassifierExtensionButton.setSelection(true);
//
} else {
//
alwaysClassifierExtensionButton.setSelection(true);
//
}
// Configure property fields enabled status
if
(
useWorkspacePreferences
(
project
))
{
...
...
@@ -143,7 +142,7 @@ public class DeinstantiationPropertyPage extends PropertyPage {
inheritModeButton
.
setEnabled
(
false
);
modifyReusedButton
.
setEnabled
(
false
);
addClassifierPropertyButton
.
setEnabled
(
false
);
radioGroup1
.
setEnabled
(
false
);
//
radioGroup1.setEnabled(false);
}
else
{
useWorkspaceSettingsButton
.
setSelection
(
false
);
useProjectSettingsButton
.
setSelection
(
true
);
...
...
@@ -152,7 +151,7 @@ public class DeinstantiationPropertyPage extends PropertyPage {
inheritModeButton
.
setEnabled
(
true
);
modifyReusedButton
.
setEnabled
(
true
);
addClassifierPropertyButton
.
setEnabled
(
true
);
radioGroup1
.
setEnabled
(
true
);
//
radioGroup1.setEnabled(true);
}
// Add listeners
...
...
@@ -164,7 +163,7 @@ public class DeinstantiationPropertyPage extends PropertyPage {
inheritModeButton
.
setEnabled
(
false
);
modifyReusedButton
.
setEnabled
(
false
);
addClassifierPropertyButton
.
setEnabled
(
false
);
radioGroup1
.
setEnabled
(
false
);
//
radioGroup1.setEnabled(false);
}
});
...
...
@@ -176,7 +175,7 @@ public class DeinstantiationPropertyPage extends PropertyPage {
inheritModeButton
.
setEnabled
(
true
);
modifyReusedButton
.
setEnabled
(
true
);
addClassifierPropertyButton
.
setEnabled
(
true
);
radioGroup1
.
setEnabled
(
true
);
//
radioGroup1.setEnabled(true);
}
});
...
...
@@ -211,10 +210,10 @@ public class DeinstantiationPropertyPage extends PropertyPage {
return
preferences
.
getBoolean
(
DIMUIPlugin
.
PREF_ADD_CLASSIFIER_PROPERTY
,
DIMUIPlugin
.
ADD_CLASSIFIER_PROPERTY_DEFAULT
);
}
private
String
getExtendClassifier
()
{
DIMUIPlugin
.
getInstance
();
return
preferences
.
get
(
DIMUIPlugin
.
PREF_EXTEND_CLASSIFIER
,
DIMUIPlugin
.
EXTEND_CLASSIFIER_DEFAULT
);
}
//
private String getExtendClassifier() {
//
DIMUIPlugin.getInstance();
//
return preferences.get(DIMUIPlugin.PREF_EXTEND_CLASSIFIER, DIMUIPlugin.EXTEND_CLASSIFIER_DEFAULT);
//
}
private
boolean
useWorkspacePreferences
(
IProject
project
)
{
return
preferences
.
getBoolean
(
DIMUIPlugin
.
PREF_USE_WORKSPACE
,
true
);
...
...
@@ -227,13 +226,13 @@ public class DeinstantiationPropertyPage extends PropertyPage {
preferences
.
putBoolean
(
DIMUIPlugin
.
PREF_INHERIT_MODE
,
inheritModeButton
.
getSelection
());
preferences
.
putBoolean
(
DIMUIPlugin
.
PREF_MODIFY_REUSED
,
modifyReusedButton
.
getSelection
());
preferences
.
putBoolean
(
DIMUIPlugin
.
PREF_ADD_CLASSIFIER_PROPERTY
,
addClassifierPropertyButton
.
getSelection
());
if
(
noClassifierExtensionButton
.
getSelection
())
{
preferences
.
put
(
DIMUIPlugin
.
PREF_EXTEND_CLASSIFIER
,
ClassifierExtensionPreference
.
NONE_EXTENSION
.
getLiteral
());
}
else
if
(
requiredClassifierExtensionButton
.
getSelection
())
{
preferences
.
put
(
DIMUIPlugin
.
PREF_EXTEND_CLASSIFIER
,
ClassifierExtensionPreference
.
REQUIRED_EXTENSION
.
getLiteral
());
}
else
{
preferences
.
put
(
DIMUIPlugin
.
PREF_EXTEND_CLASSIFIER
,
ClassifierExtensionPreference
.
ALWAYS_EXTENSION
.
getLiteral
());
}
//
if (noClassifierExtensionButton.getSelection()) {
//
preferences.put(DIMUIPlugin.PREF_EXTEND_CLASSIFIER, ClassifierExtensionPreference.NONE_EXTENSION.getLiteral());
//
} else if (requiredClassifierExtensionButton.getSelection()) {
//
preferences.put(DIMUIPlugin.PREF_EXTEND_CLASSIFIER, ClassifierExtensionPreference.REQUIRED_EXTENSION.getLiteral());
//
} else {
//
preferences.put(DIMUIPlugin.PREF_EXTEND_CLASSIFIER, ClassifierExtensionPreference.ALWAYS_EXTENSION.getLiteral());
//
}
try
{
preferences
.
flush
();
}
catch
(
final
BackingStoreException
e
)
{
...
...
@@ -255,12 +254,12 @@ public class DeinstantiationPropertyPage extends PropertyPage {
modifyReusedButton
.
setEnabled
(
false
);
addClassifierPropertyButton
.
setSelection
(
DIMUIPlugin
.
ADD_CLASSIFIER_PROPERTY_DEFAULT
);
addClassifierPropertyButton
.
setEnabled
(
false
);
noClassifierExtensionButton
.
setSelection
(
false
);
requiredClassifierExtensionButton
.
setSelection
(
true
);
alwaysClassifierExtensionButton
.
setSelection
(
false
);
noClassifierExtensionButton
.
setEnabled
(
false
);
requiredClassifierExtensionButton
.
setEnabled
(
false
);
alwaysClassifierExtensionButton
.
setEnabled
(
false
);
//
noClassifierExtensionButton.setSelection(false);
//
requiredClassifierExtensionButton.setSelection(true);
//
alwaysClassifierExtensionButton.setSelection(false);
//
noClassifierExtensionButton.setEnabled(false);
//
requiredClassifierExtensionButton.setEnabled(false);
//
alwaysClassifierExtensionButton.setEnabled(false);
// Why? Because the default implementation does this
updateApplyButton
();
}
...
...
fr.mem4csd.osatedim.viatra/src/fr/mem4csd/osatedim/viatra/transformations/DIMTransformationDeltaInplace.xtend
View file @
7c2987b7
...
...
@@ -72,7 +72,7 @@ class DIMTransformationDeltaInplace extends DIMTransformationRules{
}
return
}
private
def
createTransformation
()
{
this
.
manipulation
=
new
SimpleModelManipulations
(
engine
)
var
fixedPriorityResolver
=
new
InvertedDisappearancePriorityConflictResolver
...
...
@@ -114,7 +114,7 @@ class DIMTransformationDeltaInplace extends DIMTransformationRules{
].
addLifeCycle
(
Lifecycles
.
getDefault
(
true
,
true
)).
build
///////////////////////////////////////////
//
SUB
COMPONENT
INSTANCE
DEINSTANTIATION
//
//
COMPONENT
INSTANCE
DEINSTANTIATION
//
///////////////////////////////////////////
val
componentInstance2Declarative
=
createRule
(
FindSubcomponent
.
Matcher
.
querySpecification
)
.
action
(
CRUDActivationStateEnum
.
CREATED
)
[
...
...
@@ -131,14 +131,14 @@ class DIMTransformationDeltaInplace extends DIMTransformationRules{
println
(
"DIM: Declarative of component instance "
+
subcompinst
.
name
+
" already exists!"
)
}
].
action
(
CRUDActivationStateEnum
.
UPDATED
)
[
//
Subc
omponent
name
change
//
C
omponent
name
change
if
(
subcompinst
.
name
!== subcompinst.subcomponent.name) {
changeParentSubcomponentDefinition
(
subcompinst
,
subcompinst
.
eContainer
as
ComponentInstance
)
subcompinst
.
subcomponent
.
set
(
namedElement_Name
,
subcompinst
.
name
)
subcompinst
.
classifier
.
set
(
namedElement_Name
,
subcompinst
.
name
)
println
(
"DIM: Name of component instance "
+
subcompinst
.
name
+
" updated"
)
}
//
Subc
omponent
classifier
change
//
C
omponent
classifier
change
if
(
subcompinst
.
classifier
!== subcompinst.subcomponent.classifier) {
if
(
LibraryUtils
.
isLibraryClassifier
(
subcompinst
.
classifier
,
aadlPublicPackage
))
{
aadlPublicPackage
.
add
(
packageSection_ImportedUnit
,
subcompinst
.
classifier
.
eContainer
.
eContainer
as
ModelUnit
)
...
...
fr.mem4csd.osatedim.viatra/src/fr/mem4csd/osatedim/viatra/transformations/DIMTransformationRulesComponent.xtend
View file @
7c2987b7
...
...
@@ -69,7 +69,7 @@ class DIMTransformationRulesComponent extends DIMTransformationRules {
}
//
Parent
Component
Instance
Subcomponent
Definition
if
(
compinst
!== topSystemInst) {
if
(
LibraryUtils
.
isSubcomponent
AffectingLibrary
(
compinst
.
subcomponent
,
compinst
.
eContainer
as
ComponentInstance
,
aadlPublicPackage
)
||
(
LibraryUtils
.
isSubcomponentAffectingReusedClassifier
(
compinst
.
subcomponent
,
compinst
.
eContainer
as
ComponentInstance
,
engine
)
&&
!
preferences.
isM
odifyReused)) {
if
(
LibraryUtils
.
is
Affecting
Subcomponent
(
compinst
.
subcomponent
,
compinst
.
eContainer
as
ComponentInstance
,
aadlPublicPackage
,
engine
,
preferences
.
m
odifyReused
))
{
changeParentSubcomponentDefinition
(
compinst
,
compinst
.
eContainer
as
ComponentInstance
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment