Skip to content
Snippets Groups Projects
Commit ba31e728 authored by Daniel Plagge's avatar Daniel Plagge
Browse files

Merge branch 'develop' into feature/theory_plugin

Conflicts:
	de.prob.core/.classpath
	de.prob.core/META-INF/MANIFEST.MF
	de.prob.core/src/de/prob/eventb/translator/internal/EventBTranslator.java
parents 0eaf49d1 fe287ca8
No related branches found
No related tags found
No related merge requests found
Showing
with 44 additions and 159 deletions
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -3,7 +3,7 @@
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import de.bmotionstudio.gef.editor.AbstractBControlService;
import de.bmotionstudio.gef.editor.IBControlService;
......
......@@ -4,7 +4,7 @@
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.service;
package de.bmotionstudio.gef.editor.model.service;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.gef.palette.ConnectionCreationToolEntry;
......
......@@ -3,6 +3,8 @@ package de.bmotionstudio.gef.editor.observer;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import de.bmotionstudio.gef.editor.Animation;
import de.bmotionstudio.gef.editor.AttributeConstants;
import de.bmotionstudio.gef.editor.attribute.AbstractAttribute;
......@@ -92,8 +94,8 @@ public class ColumnObserver extends Observer {
}
@Override
public ObserverWizard getWizard(BControl control) {
return new WizardColumnObserver(control, this);
public ObserverWizard getWizard(Shell shell, BControl control) {
return new WizardColumnObserver(shell, control, this);
}
}
\ No newline at end of file
/**
* (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.bmotionstudio.gef.editor.observer;
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyObject;
import java.io.File;
import java.io.IOException;
import org.codehaus.groovy.control.CompilationFailedException;
import org.eclipse.core.resources.IFile;
import de.bmotionstudio.gef.editor.Animation;
import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.observer.wizard.WizardObserverExternalObserverScript;
public class ExternalObserverScript extends Observer {
public static String ID = "de.bmotionstudio.gef.editor.observer.ExternalObserverScript";
private transient GroovyObject groovyObject;
private String scriptPath;
// private String language;
@Override
public void check(Animation animation, BControl control) {
try {
if (groovyObject == null) {
IFile pFile = control.getVisualization().getProjectFile();
String myPath = (pFile.getProject().getLocation() + "/" + scriptPath)
.replace("file:", "");
ClassLoader parent = getClass().getClassLoader();
GroovyClassLoader loader = new GroovyClassLoader(parent);
Class<?> groovyClass;
groovyClass = loader.parseClass(new File(myPath));
// let's call some method on an instance
groovyObject = (GroovyObject) groovyClass.newInstance();
}
Object[] args = { animation, control };
groovyObject.invokeMethod("check", args);
} catch (CompilationFailedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
@Override
public ObserverWizard getWizard(BControl control) {
return new WizardObserverExternalObserverScript(control, this);
}
public String getScriptPath() {
return scriptPath;
}
public void setScriptPath(String scriptPath) {
this.scriptPath = scriptPath;
}
}
......@@ -9,6 +9,8 @@ package de.bmotionstudio.gef.editor.observer;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.widgets.Shell;
import de.be4.classicalb.core.parser.exceptions.BException;
import de.bmotionstudio.gef.editor.Animation;
import de.bmotionstudio.gef.editor.AttributeConstants;
......@@ -154,8 +156,9 @@ public class ListenOperationByPredicate extends Observer {
}
@Override
public ObserverWizard getWizard(BControl control) {
return new WizardObserverListenOperationByPredicate(control, this);
public ObserverWizard getWizard(Shell shell, BControl control) {
return new WizardObserverListenOperationByPredicate(shell, control,
this);
}
public void setList(ArrayList<PredicateOperation> list) {
......
......@@ -8,6 +8,7 @@ package de.bmotionstudio.gef.editor.observer;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.draw2d.IFigure;
import org.eclipse.swt.widgets.Shell;
import de.bmotionstudio.gef.editor.AbstractExpressionControl;
import de.bmotionstudio.gef.editor.BMotionEditorPlugin;
......@@ -68,7 +69,7 @@ public abstract class Observer extends AbstractExpressionControl implements
* The corresponding control
* @return the corresponding wizard
*/
public abstract ObserverWizard getWizard(BControl control);
public abstract ObserverWizard getWizard(Shell shell, BControl control);
public IFigure getToolTip(BControl control) {
return null;
......
......@@ -10,20 +10,12 @@ import de.bmotionstudio.gef.editor.BindingObject;
public class ObserverEvalObject extends BindingObject implements Cloneable {
private String type; // unused
private String eval;
private String eval; // Predicate
private String attribute;
private Object value;
private String attribute;
/**
* If true, value attribute is an ExpressionValueElement otherwise value
* attribute is an simple value object (e.g. background image)
*
* @see ExpressionValueElement
*/
private Boolean isExpressionMode;
private transient Boolean hasError;
......@@ -32,24 +24,13 @@ public class ObserverEvalObject extends BindingObject implements Cloneable {
this.isExpressionMode = false;
}
public ObserverEvalObject(String type, String eval, Boolean isExpressionMode) {
this.type = type;
public ObserverEvalObject(String eval, Boolean isExpressionMode) {
this.eval = eval;
this.isExpressionMode = isExpressionMode;
}
public ObserverEvalObject(String type, String eval) {
this(type, eval, false);
}
public void setType(String type) {
Object oldValue = this.type;
this.type = type;
firePropertyChange("type", oldValue, this.type);
}
public String getType() {
return type;
public ObserverEvalObject(String eval) {
this(eval, false);
}
public void setEval(String eval) {
......
......@@ -7,6 +7,8 @@
package de.bmotionstudio.gef.editor.observer;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import de.bmotionstudio.gef.editor.BMotionAbstractWizard;
import de.bmotionstudio.gef.editor.model.BControl;
......@@ -24,10 +26,8 @@ public abstract class ObserverWizard extends BMotionAbstractWizard {
private Observer observer;
protected Boolean observerDelete = false;
public ObserverWizard(BControl control, Observer observer) {
super(control);
public ObserverWizard(Shell shell, BControl control, Observer observer) {
super(shell, control);
this.observer = observer;
}
......@@ -35,14 +35,6 @@ public abstract class ObserverWizard extends BMotionAbstractWizard {
return this.observer;
}
protected void setObserverDelete(Boolean b) {
this.observerDelete = b;
}
public Boolean isObserverDelete() {
return this.observerDelete;
}
public abstract Point getSize();
@Override
......@@ -50,4 +42,11 @@ public abstract class ObserverWizard extends BMotionAbstractWizard {
return observer.getName();
}
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
PlatformUI.getWorkbench().getHelpSystem()
.setHelp(newShell, observer.getID());
}
}
......@@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.draw2d.IFigure;
import org.eclipse.swt.widgets.Shell;
import de.bmotionstudio.gef.editor.Animation;
import de.bmotionstudio.gef.editor.attribute.AbstractAttribute;
......@@ -64,14 +65,6 @@ public class SetAttribute extends Observer {
attributeVal.toString(), control, animation);
String er = attributeObj.validateValue(strAtrVal, null);
if (er != null) {
// addError(
// control,
// animation,
// "You selected "
// + attributeObj.getName()
// +
// " as attribute. There is a problem with your value: "
// + strAtrVal + " - Reason: " + er);
obj.setHasError(true);
} else {
attributeVal = attributeObj.unmarshal(strAtrVal);
......@@ -108,8 +101,8 @@ public class SetAttribute extends Observer {
}
@Override
public ObserverWizard getWizard(BControl control) {
return new WizardObserverSetAttribute(control, this);
public ObserverWizard getWizard(Shell shell, BControl control) {
return new WizardObserverSetAttribute(shell, control, this);
}
public void setSetAttributeObjects(
......@@ -133,23 +126,6 @@ public class SetAttribute extends Observer {
@Override
public IFigure getToolTip(BControl control) {
// // TODO: This method need rework!!!
// StringBuilder builder = new StringBuilder();
// builder.append("Set Attribute Observer:\n\n");
// for (SetAttributeObject obj : getSetAttributeObjects()) {
// if (obj.getEval() != null) {
// builder.append("[Predicate: " + obj.getEval());
// }
// if (obj.getAttribute() != null) {
// builder.append(" | Attribute: "
// + control.getAttribute(obj.getAttribute()).getName());
// }
// if (obj.getValue() != null) {
// builder.append(" | Value: " + obj.getValue() + "]");
// }
// builder.append("\n");
// }
// Label lb = new Label(builder.toString());
return null;
}
......
......@@ -13,8 +13,8 @@ public class SetAttributeObject extends ObserverEvalObject implements Cloneable
super();
}
public SetAttributeObject(String type, String eval) {
super(type, eval);
public SetAttributeObject(String eval) {
super(eval);
}
public SetAttributeObject clone() throws CloneNotSupportedException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment