blob: cafe17c101e95987986e77dc58a7b6b43cfbbe81 [file] [log] [blame]
<!doctype html>
<title>CodeMirror: Properties files mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="lib/styles/docs.css">
<link rel="stylesheet" href="lib/styles/codemirror.css">
<link rel="stylesheet" href="lib/styles/show-hint.css">
<script src="lib/scripts/codemirror.js"></script>
<script src="lib/scripts/show-hint.js"></script>
<script src="scripts/utils.js"></script>
<script src="scripts/logFunction.js"></script>
<script src="scripts/readingTokens.js"></script>
<script src="scripts/statesTypesAndLabels.js"></script>
<script src="scripts/autoComplete.js"></script>
<script src="scripts/errorManagment.js"></script>
<script src="scripts/editorStateMachine.js"></script>
<script src="scripts/propertyManagment.js"></script>
<style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style>
<style>
.line-error {
/*background: #FBC2C4 !important;
color: #8a1f11 !important;*/
border-bottom: 2px red solid;
}
</style>
<body>
<textarea id="code" name="code">
class Try
+/nom : String [0..1] {unique , seq }
/age : int
zeOper ( in p1 : Integer [0..1] {ordered , unique },out p2 : String, in p3 : Boolean {ordered}) : String {unique}
</textarea>
<script>
CodeMirror.commands.autocomplete = function(cm) {
cm.showHint({hint: CodeMirror.hint.umlClass});
}
CodeMirror.commands.out = function(cm) {
console.log("TEST");
}
window.editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: false,
lineWrapping: true,
gutters: [Errors.gutterLabel],
extraKeys: {
"Ctrl-Space": "autocomplete",
"Shift-Enter":"out"
},
});
editor.getGutterElement().style.width="15px";
editor.display.sizer.style.marginLeft="15px";
function getProperties () {
return "{\n" +
" \"name\" : \"Class2\",\n" +
" \"properties\" : [ ],\n" +
" \"operations\" : [ ]\n" +
"}";
};
Mapping.FromPapyrus.setEditorValueWithClassSpecification();
Errors.startObserving();
</script>
</body>
</html>