diff --git a/build.gradle b/build.gradle index ae8b7222c86459b4015c17d6c0ee1bb67485be89..552ae10fc55545c34ce138ec7767d9caac6e242c 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,6 @@ project(":de.bmotionstudio.gef.editor") { // hardcode a specific MXParser version here. // It *should* be safe to update this when a new version is released. implementation group: "io.github.x-stream", name: "mxparser", version: "1.2.2" - implementation group: "org.codehaus.groovy", name: "groovy", version: "2.5.22" } } diff --git a/de.bmotionstudio.gef.editor/.classpath b/de.bmotionstudio.gef.editor/.classpath index ca96913a859cc30c705b7ea83bf0d4675aa2cf95..769b529f3204279f23fa7cec64186f88775eb375 100644 --- a/de.bmotionstudio.gef.editor/.classpath +++ b/de.bmotionstudio.gef.editor/.classpath @@ -4,7 +4,6 @@ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> - <classpathentry exported="true" kind="lib" path="lib/dependencies/groovy-2.5.22.jar"/> <classpathentry exported="true" kind="lib" path="lib/dependencies/mxparser-1.2.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/dependencies/xmlpull-1.1.3.1.jar"/> <classpathentry exported="true" kind="lib" path="lib/dependencies/xstream-1.4.20.jar"/> diff --git a/de.bmotionstudio.gef.editor/META-INF/MANIFEST.MF b/de.bmotionstudio.gef.editor/META-INF/MANIFEST.MF index 4c0989e01bbfef4c09e35d5fb5d6c8e2ca2879ec..3cc4e62a84e4b360d7ab4cc1acd618707eabf388 100644 --- a/de.bmotionstudio.gef.editor/META-INF/MANIFEST.MF +++ b/de.bmotionstudio.gef.editor/META-INF/MANIFEST.MF @@ -149,7 +149,6 @@ Export-Package: de.bmotionstudio.gef.editor; org.eclipse.swt.widgets, de.bmotionstudio.gef.editor" Bundle-ClassPath: ., - lib/dependencies/groovy-2.5.22.jar, lib/dependencies/mxparser-1.2.2.jar, lib/dependencies/xmlpull-1.1.3.1.jar, lib/dependencies/xstream-1.4.20.jar diff --git a/de.bmotionstudio.gef.editor/plugin.xml b/de.bmotionstudio.gef.editor/plugin.xml index f60e1074bfb563981f2f64aa5b3541c39479959b..2f254fad8295f60c884b3955105845870987acf1 100644 --- a/de.bmotionstudio.gef.editor/plugin.xml +++ b/de.bmotionstudio.gef.editor/plugin.xml @@ -348,10 +348,6 @@ class="de.bmotionstudio.gef.editor.observer.ColumnObserver" name="Column Observer"> </observer> - <observer - class="de.bmotionstudio.gef.editor.observer.ExternalObserverScript" - name="External Observer Script"> - </observer> </extension> <extension point="de.bmotionstudio.gef.editor.schedulerEvent"> @@ -577,63 +573,6 @@ id="de.bmotionstudio.gef.editor.visualization"> </control> </observer> - <observer - id="de.bmotionstudio.gef.editor.observer.ExternalObserverScript"> - <control - id="de.bmotionstudio.gef.editor.image"> - </control> - <control - id="de.bmotionstudio.gef.editor.button"> - </control> - <control - id="de.bmotionstudio.gef.editor.composite"> - </control> - <control - id="de.bmotionstudio.gef.editor.text"> - </control> - <control - id="de.bmotionstudio.gef.editor.rectangle"> - </control> - <control - id="de.bmotionstudio.gef.editor.radiobutton"> - </control> - <control - id="de.bmotionstudio.gef.editor.checkbox"> - </control> - <control - id="de.bmotionstudio.gef.editor.connection"> - </control> - <control - id="de.bmotionstudio.gef.editor.ellipse"> - </control> - <control - id="de.bmotionstudio.gef.editor.textfield"> - </control> - <control - id="de.bmotionstudio.gef.editor.tablecell"> - </control> - <control - id="de.bmotionstudio.gef.editor.table"> - </control> - <control - id="de.bmotionstudio.gef.editor.tablecolumn"> - </control> - <control - id="de.bmotionstudio.gef.editor.light"> - </control> - <control - id="de.bmotionstudio.gef.editor.signal"> - </control> - <control - id="de.bmotionstudio.gef.editor.switch"> - </control> - <control - id="de.bmotionstudio.gef.editor.track"> - </control> - <control - id="de.bmotionstudio.gef.editor.tracknode"> - </control> - </observer> <observer id="de.bmotionstudio.gef.editor.observer.SwitchImage"> <control diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ExternalObserverScript.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ExternalObserverScript.java deleted file mode 100644 index 66140364297494279a50836161fc37be784b1379..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/ExternalObserverScript.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * (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; - } - -} diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardObserverExternalObserverScript.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardObserverExternalObserverScript.java deleted file mode 100644 index 4d86d0aedb33631b15fb774f8c3a7bcee1e2307b..0000000000000000000000000000000000000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/observer/wizard/WizardObserverExternalObserverScript.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * (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.wizard; - -import org.eclipse.core.databinding.DataBindingContext; -import org.eclipse.core.databinding.beans.BeansObservables; -import org.eclipse.jface.databinding.swt.SWTObservables; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import de.bmotionstudio.gef.editor.model.BControl; -import de.bmotionstudio.gef.editor.observer.ExternalObserverScript; -import de.bmotionstudio.gef.editor.observer.Observer; -import de.bmotionstudio.gef.editor.observer.ObserverWizard; - -public class WizardObserverExternalObserverScript extends ObserverWizard { - - private class ObserverExternalObserverScriptPage extends WizardPage { - - private Text txtScriptPath; - - protected ObserverExternalObserverScriptPage(final String pageName) { - super(pageName); - } - - public Text getTxtScriptPath() { - return txtScriptPath; - } - - public void createControl(final Composite parent) { - - final DataBindingContext dbc = new DataBindingContext(); - - Composite container = new Composite(parent, SWT.NONE); - container.setLayoutData(new GridData(GridData.FILL_BOTH)); - container.setLayout(new GridLayout(2, false)); - - Label lb = new Label(container, SWT.NONE); - lb.setText("Script File:"); - - txtScriptPath = new Text(container, SWT.BORDER); - txtScriptPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - txtScriptPath.setFont(new Font(Display.getDefault(), new FontData( - "Arial", 10, SWT.NONE))); - - initBindings(dbc); - - setControl(container); - - } - - private void initBindings(DataBindingContext dbc) { - - dbc.bindValue( - SWTObservables.observeText(txtScriptPath, SWT.Modify), - BeansObservables.observeValue( - (ExternalObserverScript) getObserver(), - "scriptPath")); - - } - - - } - - public WizardObserverExternalObserverScript(BControl bcontrol, - Observer bobserver) { - super(bcontrol, bobserver); - addPage(new ObserverExternalObserverScriptPage( - "ObserverExternalObserverScriptPage")); - } - - @Override - protected Boolean prepareToFinish() { - - ObserverExternalObserverScriptPage page = (ObserverExternalObserverScriptPage) getPage("ObserverExternalObserverScriptPage"); - - String errorStr = ""; - - if (page.getTxtScriptPath().getText().length() == 0) - errorStr += "Please enter a path for a script file.\n"; - - if (errorStr.length() > 0) { - MessageDialog.openError(Display.getDefault().getActiveShell(), - "An Error occured", errorStr); - return false; - } - - return true; - - } - - @Override - public Point getSize() { - return new Point(600, 500); - } - -}