Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ProB Rodin Plugin
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
ProB Rodin Plugin
Commits
69181ee0
Commit
69181ee0
authored
12 years ago
by
Sebastian Krings
Browse files
Options
Downloads
Patches
Plain Diff
add a second text field to output the inferred pragma
parent
6303d930
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
de.prob.core/plugin.xml
+5
-0
5 additions, 0 deletions
de.prob.core/plugin.xml
de.prob.ui/plugin.xml
+15
-0
15 additions, 0 deletions
de.prob.ui/plugin.xml
de.prob.ui/src/de/prob/ui/pragmas/InferredUnitPragma.java
+74
-0
74 additions, 0 deletions
de.prob.ui/src/de/prob/ui/pragmas/InferredUnitPragma.java
with
94 additions
and
0 deletions
de.prob.core/plugin.xml
+
5
−
0
View file @
69181ee0
...
...
@@ -30,5 +30,10 @@
kind=
"string"
name=
"Content of a unit Pragma to send to ProB"
>
</attributeType>
<attributeType
id=
"inferredUnitPragma"
kind=
"string"
name=
"Content of a unit Pragma received from ProB"
>
</attributeType>
</extension>
</plugin>
This diff is collapsed.
Click to expand it.
de.prob.ui/plugin.xml
+
15
−
0
View file @
69181ee0
...
...
@@ -1268,12 +1268,27 @@
<attributeReference
descriptionId=
"de.prob.ui.unitPragma"
>
</attributeReference>
<attributeReference
descriptionId=
"de.prob.ui.inferredUnitPragma"
>
</attributeReference>
</attributeRelation>
<attributeRelation
elementTypeId=
"org.eventb.core.constant"
>
<attributeReference
descriptionId=
"de.prob.ui.unitPragma"
>
</attributeReference>
<attributeReference
descriptionId=
"de.prob.ui.inferredUnitPragma"
>
</attributeReference>
</attributeRelation>
<textAttribute
class=
"de.prob.ui.pragmas.InferredUnitPragma"
expandsHorizontally=
"true"
id=
"de.prob.ui.inferredUnitPragma"
isMath=
"true"
prefix=
"Inferred Physical Unit:"
style=
"de.prob.ui.inferredUnitPragma"
typeId=
"de.prob.core.inferredUnitPragma"
>
</textAttribute>
</extension>
</plugin>
This diff is collapsed.
Click to expand it.
de.prob.ui/src/de/prob/ui/pragmas/InferredUnitPragma.java
0 → 100644
+
74
−
0
View file @
69181ee0
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen, Heinrich
* Heine Universitaet Duesseldorf This software is licenced under EPL 1.0
* (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package
de.prob.ui.pragmas
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eventb.core.IVariable
;
import
org.eventb.core.basis.Constant
;
import
org.eventb.internal.ui.eventbeditor.manipulation.IAttributeManipulation
;
import
org.rodinp.core.IAttributeType
;
import
org.rodinp.core.IInternalElement
;
import
org.rodinp.core.IRodinElement
;
import
org.rodinp.core.RodinCore
;
import
org.rodinp.core.RodinDBException
;
import
de.prob.core.internal.Activator
;
public
class
InferredUnitPragma
implements
IAttributeManipulation
{
public
static
IAttributeType
.
String
ATTRIBUTE
=
RodinCore
.
getStringAttrType
(
Activator
.
PLUGIN_ID
+
".inferredUnitPragma"
);
public
InferredUnitPragma
()
{
// empty constructor
}
private
IInternalElement
asInternalElement
(
IRodinElement
element
)
{
if
(
element
instanceof
IVariable
)
{
return
(
IVariable
)
element
;
}
else
if
(
element
instanceof
Constant
)
{
return
(
Constant
)
element
;
}
return
null
;
}
@Override
public
String
[]
getPossibleValues
(
IRodinElement
element
,
IProgressMonitor
monitor
)
{
return
new
String
[]
{
""
,
"a"
,
"b"
,
"c"
};
}
@Override
public
String
getValue
(
IRodinElement
element
,
IProgressMonitor
monitor
)
throws
RodinDBException
{
return
asInternalElement
(
element
).
getAttributeValue
(
ATTRIBUTE
);
}
@Override
public
boolean
hasValue
(
IRodinElement
element
,
IProgressMonitor
monitor
)
throws
RodinDBException
{
return
asInternalElement
(
element
).
hasAttribute
(
ATTRIBUTE
);
}
@Override
public
void
removeAttribute
(
IRodinElement
element
,
IProgressMonitor
monitor
)
throws
RodinDBException
{
asInternalElement
(
element
).
removeAttribute
(
ATTRIBUTE
,
monitor
);
}
@Override
public
void
setDefaultValue
(
IRodinElement
element
,
IProgressMonitor
monitor
)
throws
RodinDBException
{
asInternalElement
(
element
).
setAttributeValue
(
ATTRIBUTE
,
""
,
monitor
);
}
@Override
public
void
setValue
(
IRodinElement
element
,
String
value
,
IProgressMonitor
monitor
)
throws
RodinDBException
{
asInternalElement
(
element
).
setAttributeValue
(
ATTRIBUTE
,
value
,
monitor
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment