Skip to content
Snippets Groups Projects
Commit f772c4d8 authored by Alberto Debiasi's avatar Alberto Debiasi
Browse files

Merge remote-tracking branch 'Polarsys/devel' into...

Merge remote-tracking branch 'Polarsys/devel' into 123-Interact-with-Kratos-for-formal-verification-of-state-machines
parents 9a625388 3bdcac9f
No related branches found
No related tags found
No related merge requests found
Showing
with 731 additions and 1 deletion
......@@ -66,6 +66,7 @@
<module>../../plugins/org.polarsys.chess.validator</module>
<module>../../plugins/org.polarsys.chess.wizards</module>
<module>../../plugins/org.polarsys.chess.xtext.global</module>
<module>../../plugins/org.polarsys.chess.customEditors</module>
<module>../../plugins/sba/org.polarsys.chess.statebased</module>
......
......@@ -393,4 +393,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.polarsys.chess.customEditors"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
......@@ -26,6 +26,7 @@
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy-resources-from-parent</id>
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.polarsys.chess.customEditors</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: CustomEditors
Bundle-SymbolicName: org.polarsys.chess.customEditors;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.swt,
org.eclipse.papyrus.uml.properties,
org.eclipse.papyrus.uml.xtext.integration.core,
org.eclipse.papyrus.uml.xtext.integration.ui,
org.eclipse.ui.workbench,
org.eclipse.papyrus.infra.properties.ui,
org.eclipse.papyrus.uml.textedit.property.xtext.ui,
eu.fbk.tools.editor.c.expression.ui,
eu.fbk.tools.editor.c.statement.ui,
eu.fbk.tools.editor.contract.expression.ui;bundle-version="1.0.0",
eu.fbk.eclipse.standardtools.xtextService,
org.polarsys.chess.service,
eu.fbk.eclipse.standardtools.utils,
org.polarsys.chess.contracts.profile
Bundle-Vendor: Eclipse Chess Project
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>November 30, 2017</p>
<h3>License</h3>
<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>
<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="http://www.eclipse.org/">http://www.eclipse.org</a>.
</p>
</body>
</html>
\ No newline at end of file
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.papyrus.uml.properties.languageEditor">
<editor
editor="org.polarsys.chess.customEditors.editors.cleanc.CleanCEditor"
language="CleanC">
</editor>
<editor
editor="org.polarsys.chess.customEditors.editors.ocra.OcraPropertyEditor"
language="OCRA">
</editor>
</extension>
<!--extension
point="org.eclipse.papyrus.extensionpoints.editors.DirectEditor">
<DirectEditor
language="C"
objectToEdit="org.eclipse.uml2.uml.OpaqueExpression">
<popupeditor
editorConfiguration="org.polarsys.chess.customEditors.editors.cleanc.CleanCExpressionEditorConfiguration">
</popupeditor>
<Priority
name="Highest">
</Priority>
</DirectEditor>
</extension-->
</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.polarsys.chess</groupId>
<artifactId>org.polarsys.chess.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../org.polarsys.chess.parent</relativePath>
</parent>
<artifactId>org.polarsys.chess.customEditors</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
/*******************************************************************************
* Copyright (C) 2021 Fondazione Bruno Kessler.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Alberto Debiasi - initial API and implementation
******************************************************************************/
package org.polarsys.chess.customEditors.editors;
import java.util.Stack;
public class UndoRedoStack<T> {
private Stack<T> undo;
private Stack<T> redo;
public UndoRedoStack() {
undo = new Stack<T>();
redo = new Stack<T>();
}
public void pushUndo(T delta) {
undo.add(delta);
}
public void pushRedo(T delta) {
redo.add(delta);
}
public T popUndo() {
T res = undo.pop();
return res;
}
public T popRedo() {
T res = redo.pop();
return res;
}
public void clearUndo() {
undo.clear();
}
public void clearRedo() {
redo.clear();
}
public boolean hasUndo() {
return !undo.isEmpty();
}
public boolean hasRedo() {
return !redo.isEmpty();
}
}
/*******************************************************************************
* Copyright (C) 2021 Fondazione Bruno Kessler.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Alberto Debiasi - initial API and implementation
******************************************************************************/
package org.polarsys.chess.customEditors.editors;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.util.TransactionUtil;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.extensionpoints.editors.Activator;
import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.properties.ui.modelelement.ModelElement;
import org.eclipse.papyrus.infra.ui.emf.dialog.NestedEditingDialogContext;
import org.eclipse.papyrus.uml.properties.modelelement.UMLModelElement;
import org.eclipse.papyrus.uml.properties.widgets.BodyEditor;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.StyledTextXtextAdapter;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter.IContextElementProvider;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter.IContextElementProviderWithInit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ExtendedModifyEvent;
import org.eclipse.swt.custom.ExtendedModifyListener;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.uml2.uml.OpaqueBehavior;
import org.eclipse.uml2.uml.OpaqueExpression;
import org.eclipse.uml2.uml.Property;
public class XtextLanguageEditor implements BodyEditor, IContextElementProvider {
protected StyledText textControl;
UndoRedoStack<ExtendedModifyEvent> undoRedoStack;
protected boolean isUndo;
protected boolean isRedo;
private DefaultXtextDirectEditorConfiguration configuration;
private StyledTextXtextAdapter xtextAdapter;
protected EObject currentEObj;
long lastUpd = System.currentTimeMillis();
final private ContextElementAdapter contextElementAdapter = new ContextElementAdapter(this);
public void createWidget(Composite parent, int style) {
undoRedoStack = new UndoRedoStack<ExtendedModifyEvent>();
createTextControl(parent);
}
protected void createTextControl(final Composite parent) {
textControl = new StyledText(parent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.WRAP);
textControl.addFocusListener(new FocusListener() {
public void focusLost(FocusEvent e) {
System.out.println("focusLost");
updateObjBody(textControl.getText(), getEObject(), configuration.getLanguage());
IParser parser = getParser();
if (xtextAdapter == null) { // May happen under specific
// circumstances (See Bug 433647)
return;
}
if (xtextAdapter.getCompletionProposalAdapter().delayedIsPopupOpen()) {
// ignore focus lost
return;
}
if ((parser != null) && !parser.getEditString(null, 0).equals(textControl.getText())) {
if (getEObject() instanceof Property) {
ICommand command = parser.getParseCommand(new EObjectAdapter(getEObject()),
textControl.getText(), 0);
TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(getEObject());
if (domain == null) {
// can be null for opaque expression that have been
// created but have not been added to parent
// try to get resource set from nested dialog
// context
ResourceSet rs = NestedEditingDialogContext.getInstance().getResourceSet();
domain = TransactionUtil.getEditingDomain(rs);
}
if (domain != null) {
domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
}
}
}
}
public void focusGained(FocusEvent e) {
// Nothing
}
});
textControl.setAlwaysShowScrollBars(false);
textControl.setLayout(new GridLayout());
// GridDataFactory.fillDefaults().grab(true,
// true).hint(parent.getSize()).applyTo(textControl);
textControl.addExtendedModifyListener(new ExtendedModifyListener() {
public void modifyText(ExtendedModifyEvent event) {
if (isUndo) {
undoRedoStack.pushRedo(event);
} else { // is Redo or a normal user action
undoRedoStack.pushUndo(event);
if (!isRedo) {
undoRedoStack.clearRedo();
// TODO Switch to treat consecutive characters as one
// event?
}
}
}
});
textControl.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
boolean isCtrl = (e.stateMask & SWT.CTRL) > 0;
boolean isAlt = (e.stateMask & SWT.ALT) > 0;
if (isCtrl && !isAlt) {
boolean isShift = (e.stateMask & SWT.SHIFT) > 0;
if (e.keyCode == 'z') {
if (isShift) {
redo();
} else {
undo();
}
}
}
}
});
}
private void updateObjBody(String text, EObject eObject, String language) {
TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
domain.getCommandStack().execute(new RecordingCommand(domain) {
@Override
protected void doExecute() {
if (eObject instanceof OpaqueExpression) {
int ind = ((OpaqueExpression) eObject).getLanguages().indexOf(language);
((OpaqueExpression) eObject).getBodies().set(ind, text);
}
else if (eObject instanceof OpaqueBehavior) {
int ind = ((OpaqueBehavior) eObject).getLanguages().indexOf(language);
((OpaqueBehavior) eObject).getBodies().set(ind, text);
}
}
});
}
protected void undo() {
if (undoRedoStack.hasUndo()) {
isUndo = true;
revertEvent(undoRedoStack.popUndo());
isUndo = false;
}
}
protected void redo() {
if (undoRedoStack.hasRedo()) {
isRedo = true;
revertEvent(undoRedoStack.popRedo());
isRedo = false;
}
}
/**
* Reverts the given modify event, in the way as the Eclipse text editor
* does it.
*
* @param event
*/
protected void revertEvent(ExtendedModifyEvent event) {
textControl.replaceTextRange(event.start, event.length, event.replacedText);
// (causes the modifyText() listener method to be called)
textControl.setSelectionRange(event.start, event.replacedText.length());
}
protected IParser getParser() {
final EObject semanticElement = getEObject();
if (configuration != null && semanticElement != null) {
return configuration.createParser(semanticElement);
}
return null;
}
protected void updateXtextAdapters(Control styledText) {
System.out.println("updateXtextAdapters");
final Object oldObjectToEdit = configuration != null ? configuration.getObjectToEdit() : null;
final DefaultXtextDirectEditorConfiguration newConfiguration = getConfigurationFromSelection();
// Check if configuration has changed and update adapters
if (newConfiguration != null && newConfiguration != configuration) {
if (xtextAdapter != null) {
xtextAdapter.getFakeResourceContext().getFakeResource().eAdapters().remove(contextElementAdapter);
}
// System.out.println("configuration.getInjector():
// "+configuration.getInjector());
configuration = newConfiguration;
xtextAdapter = new StyledTextXtextAdapter(configuration.getInjector()
// NusmvActivator.getInstance().getInjector(NusmvActivator.EU_FBK_TOOLS_EDITOR_NUSMV_NUSMV)
);
EObject semanticElement = getEObject();
if (semanticElement != null) {
newConfiguration.preEditAction(semanticElement);
}
xtextAdapter.getFakeResourceContext().getFakeResource().eAdapters().add(contextElementAdapter);
xtextAdapter.adapt((StyledText) styledText);
}
if (configuration != null && configuration.getObjectToEdit() != oldObjectToEdit) {
IContextElementProvider provider = configuration.getContextProvider();
if (provider instanceof IContextElementProviderWithInit) {
// update resource, if required by text editor
if (xtextAdapter != null) {
((IContextElementProviderWithInit) provider)
.initResource(xtextAdapter.getFakeResourceContext().getFakeResource());
}
}
Object semanticObject = configuration.getObjectToEdit();
if (semanticObject instanceof EObject) {
currentEObj = (EObject) semanticObject;
}
}
}
protected DefaultXtextDirectEditorConfiguration getConfigurationFromSelection() {
EObject semanticElement = getEObject();
if (semanticElement != null) {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
String semanticClassName = semanticElement.eClass().getInstanceClassName();
System.out.println("semanticClassName: " + semanticClassName);
String key = IDirectEditorsIds.EDITOR_FOR_ELEMENT + semanticClassName;
String languagePreferred = store.getString(key);
// languagePreferred= "smv";
System.out.println("key: " + key);
System.out.println("languagePreferred: " + languagePreferred);
System.out.println("-----------");
if (languagePreferred != null && !languagePreferred.equals("")) { //$NON-NLS-1$
@SuppressWarnings("deprecation")
IDirectEditorConfiguration configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred,
semanticClassName);
if (configuration instanceof DefaultXtextDirectEditorConfiguration) {
DefaultXtextDirectEditorConfiguration xtextConfiguration = (DefaultXtextDirectEditorConfiguration) configuration;
xtextConfiguration.preEditAction(semanticElement);
return xtextConfiguration;
}
}
}
return null;
}
public EObject getContextObject() {
return getEObject();
}
public void setInput(String value) {
if (value != null) {
textControl.setText(value);
// clear undo redo/stack, since we do not want to give the user the
// possibility
// to undo the initial input.
undoRedoStack.clearUndo();
undoRedoStack.clearRedo();
}
}
public void dispose() {
// dispose resources to avoid memory leaks
if (textControl != null) {
textControl.dispose();
}
if (xtextAdapter != null) {
xtextAdapter.getFakeResourceContext().getFakeResource().eAdapters().remove(contextElementAdapter);
xtextAdapter.dispose();
xtextAdapter = null;
}
}
public void addChangeListener(Listener listener) {
}
public void removeChangeListener(Listener listener) {
}
public String getValue() {
return null;
}
public void setReadOnly(boolean readOnly) {
}
public void setContext(ModelElement context) {
if (context instanceof UMLModelElement) {
currentEObj = ((UMLModelElement) context).getSource();
updateXtextAdapters(textControl);
}
}
/**
* @return Returns the eObject.
*/
protected EObject getEObject() {
return currentEObj;
}
}
/*******************************************************************************
* Copyright (C) 2021 Fondazione Bruno Kessler.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Alberto Debiasi - initial API and implementation
******************************************************************************/
package org.polarsys.chess.customEditors.editors.cleanc;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.uml.textedit.property.xtext.ui.contributions.PropertyXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.OpaqueBehavior;
import org.eclipse.uml2.uml.OpaqueExpression;
import com.google.inject.Injector;
import eu.fbk.tools.editor.c.expression.ui.internal.ExpressionActivator;
import eu.fbk.tools.editor.c.statement.ui.internal.StatementActivator;
public class CleanCEditor extends org.polarsys.chess.customEditors.editors.XtextLanguageEditor{
@Override
protected DefaultXtextDirectEditorConfiguration getConfigurationFromSelection() {
EObject semanticElement = getEObject();
//String semanticClassName = semanticElement.eClass().getInstanceClassName();
//IDirectEditorConfiguration configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred,
// semanticClassName);
if (semanticElement != null) {
if(semanticElement instanceof OpaqueExpression){
DefaultXtextDirectEditorConfiguration xtextConfiguration = new CleanCExpressionEditorConfiguration();
xtextConfiguration.preEditAction(semanticElement);
return xtextConfiguration;
}else if(semanticElement instanceof OpaqueBehavior){
DefaultXtextDirectEditorConfiguration xtextConfiguration = new CleanCStatementEditorConfiguration();
xtextConfiguration.preEditAction(semanticElement);
return xtextConfiguration;
}
}
return null;
}
}
class CleanCExpressionEditorConfiguration extends PropertyXtextDirectEditorConfiguration {
@Override
public Injector getInjector() {
System.out.println("PropertyXtextDirectEditorConfiguration.getInjector");
return ExpressionActivator.getInstance()
.getInjector(ExpressionActivator.EU_FBK_TOOLS_EDITOR_C_EXPRESSION_EXPRESSION);
}
@Override
public String getLanguage() {
return "CleanC";
}
}
class CleanCStatementEditorConfiguration extends PropertyXtextDirectEditorConfiguration {
@Override
public Injector getInjector() {
System.out.println("PropertyXtextDirectEditorConfiguration.getInjector");
return StatementActivator.getInstance()
.getInjector(StatementActivator.EU_FBK_TOOLS_EDITOR_C_STATEMENT_STATEMENT);
}
@Override
public String getLanguage() {
return "CleanC";
}
}
/*******************************************************************************
* Copyright (C) 2021 Fondazione Bruno Kessler.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Alberto Debiasi - initial API and implementation
******************************************************************************/
package org.polarsys.chess.customEditors.editors.ocra;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.uml.textedit.property.xtext.ui.contributions.PropertyXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.OpaqueExpression;
import org.polarsys.chess.contracts.profile.chesscontract.util.EntityUtil;
import org.polarsys.chess.service.core.model.ChessSystemModel;
import com.google.inject.Injector;
import eu.fbk.eclipse.standardtools.xtextService.core.utils.XtextElementsUtil;
import eu.fbk.eclipse.standardtools.xtextService.ui.utils.XTextEditorViewer;
import eu.fbk.tools.editor.contract.expression.ui.internal.ExpressionActivator;
public class OcraPropertyEditor extends org.polarsys.chess.customEditors.editors.XtextLanguageEditor{
@Override
protected DefaultXtextDirectEditorConfiguration getConfigurationFromSelection() {
EObject semanticElement = getEObject();
if (semanticElement != null) {
if(semanticElement instanceof OpaqueExpression){
DefaultXtextDirectEditorConfiguration xtextConfiguration = new OcraExpressionEditorConfiguration();
xtextConfiguration.preEditAction(semanticElement);
//AbstractSystemModel
XtextElementsUtil xTextUtil = new XtextElementsUtil(ChessSystemModel.getInstance());
Element currBlock = getNearestOwnerBlock((Element)semanticElement);
//TODO add other information
XTextEditorViewer.cleanPorts();
XTextEditorViewer.addPorts(xTextUtil.getXTextPortsFromComponent(currBlock));
XTextEditorViewer.cleanParameters();
XTextEditorViewer.addParameters(xTextUtil.getXTextParametersFromComponent(currBlock));
return xtextConfiguration;
}
}
return null;
}
private Element getNearestOwnerBlock(Element currBlock) {
while(true){
if(EntityUtil.getInstance().isBlock(currBlock)){
break;
}
if(currBlock.getOwner() != null){
currBlock = currBlock.getOwner();
}else{
break;
}
}
return currBlock;
}
}
class OcraExpressionEditorConfiguration extends PropertyXtextDirectEditorConfiguration {
@Override
public Injector getInjector() {
System.out.println("PropertyXtextDirectEditorConfiguration.getInjector");
return ExpressionActivator.getInstance()
.getInjector(ExpressionActivator.EU_FBK_TOOLS_EDITOR_CONTRACT_EXPRESSION_EXPRESSION);
}
}
......@@ -71,8 +71,9 @@
<module>org.polarsys.chess.wizards</module>
<module>org.polarsys.chess.xtext.feature</module>
<module>org.polarsys.chess.xtext.global</module>
<module>org.polarsys.chess.customEditors</module>
<module>sba/org.polarsys.chess.statebased</module>
<module>sba/org.polarsys.chess.statebased.feature</module>
<module>sba/org.polarsys.chess.statebased.feature</module>
</modules>
<build>
<plugins>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment