Skip to content
Snippets Groups Projects
Commit 7a135701 authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

Merge branch 'feature/observerview' into develop

parents ac6681c2 f015d66b
No related branches found
No related tags found
No related merge requests found
Showing
with 402 additions and 734 deletions
...@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)", ...@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.databinding.beans;bundle-version="[1.1.1,2.0.0)", org.eclipse.core.databinding.beans;bundle-version="[1.1.1,2.0.0)",
org.eclipse.gef;bundle-version="[3.7.0,4.0.0)";visibility:=reexport, org.eclipse.gef;bundle-version="[3.7.0,4.0.0)";visibility:=reexport,
de.prob.core;bundle-version="[9.3.0,9.4.0)";visibility:=reexport, de.prob.core;bundle-version="[9.3.0,9.4.0)";visibility:=reexport,
org.eventb.core;bundle-version="[2.1.0,2.6.0)" org.eventb.core;bundle-version="[2.1.0,2.6.0)",
org.eclipse.help;bundle-version="3.5.100"
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: de.prob.core Eclipse-RegisterBuddy: de.prob.core
......
de.bmotionstudio.gef.editor/icons/eclipse16/linkto_help.gif

618 B

de.bmotionstudio.gef.editor/icons/icon_add.gif

386 B

de.bmotionstudio.gef.editor/icons/icon_ascript.png

489 B

de.bmotionstudio.gef.editor/icons/icon_motion.gif

1017 B

de.bmotionstudio.gef.editor/icons/icon_motion_wiz.gif

1.09 KiB

de.bmotionstudio.gef.editor/icons/icon_screenshot.gif

613 B

...@@ -49,7 +49,17 @@ ...@@ -49,7 +49,17 @@
class="de.bmotionstudio.gef.editor.library.LibraryView" class="de.bmotionstudio.gef.editor.library.LibraryView"
icon="icons/icon_library.gif" icon="icons/icon_library.gif"
id="de.bmotionstudio.gef.editor.LibraryView" id="de.bmotionstudio.gef.editor.LibraryView"
name="BMS Library"> name="Library"
restorable="true">
</view>
<view
allowMultiple="false"
category="de.bmotionstudio.views"
class="de.bmotionstudio.gef.editor.observer.view.ObserverView"
icon="icons/icon_observer.gif"
id="de.bmotionstudio.gef.editor.ObserverView"
name="Observer"
restorable="true">
</view> </view>
</extension> </extension>
<extension <extension
...@@ -336,10 +346,6 @@ ...@@ -336,10 +346,6 @@
description="Observer for switching the coordinates of the control" description="Observer for switching the coordinates of the control"
name="Switch Coordinates"> name="Switch Coordinates">
</observer> </observer>
<observer
class="de.bmotionstudio.gef.editor.observer.ExternalObserverScript"
name="External Observer Script">
</observer>
<observer <observer
class="de.bmotionstudio.gef.editor.observer.TableObserver" class="de.bmotionstudio.gef.editor.observer.TableObserver"
name="Table Observer"> name="Table Observer">
...@@ -399,270 +405,255 @@ ...@@ -399,270 +405,255 @@
point="de.bmotionstudio.gef.editor.includeObserver"> point="de.bmotionstudio.gef.editor.includeObserver">
<include <include
language="EventB"> language="EventB">
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
<control <control
id="de.bmotionstudio.gef.editor.image"> id="de.bmotionstudio.gef.editor.image">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
id="de.bmotionstudio.gef.editor.button"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SwitchImage">
id="de.bmotionstudio.gef.editor.composite"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SetAttribute">
id="de.bmotionstudio.gef.editor.text">
</control>
<control
id="de.bmotionstudio.gef.editor.ellipse">
</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.tablecell">
</control>
<control
id="de.bmotionstudio.gef.editor.table">
</control>
<control
id="de.bmotionstudio.gef.editor.tablecolumn">
</control>
<control
id="de.bmotionstudio.gef.editor.signal">
</control>
<control
id="de.bmotionstudio.gef.editor.tank">
</control>
<control
id="de.bmotionstudio.gef.editor.switch">
</control>
<control
id="de.bmotionstudio.gef.editor.track">
</control>
<control
id="de.bmotionstudio.gef.editor.light">
</control>
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates"> id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
<control </observer>
id="de.bmotionstudio.gef.editor.image">
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.button"> id="de.bmotionstudio.gef.editor.button">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay">
id="de.bmotionstudio.gef.editor.composite"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
id="de.bmotionstudio.gef.editor.text"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SetAttribute">
id="de.bmotionstudio.gef.editor.rectangle"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
id="de.bmotionstudio.gef.editor.radiobutton"> </observer>
</control>
<control
id="de.bmotionstudio.gef.editor.textfield">
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.checkbox"> id="de.bmotionstudio.gef.editor.checkbox">
</control>
<control
id="de.bmotionstudio.gef.editor.ellipse">
</control>
<control
id="de.bmotionstudio.gef.editor.table">
</control>
<control
id="de.bmotionstudio.gef.editor.signal">
</control>
<control
id="de.bmotionstudio.gef.editor.tank">
</control>
<control
id="de.bmotionstudio.gef.editor.switch">
</control>
</observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay"> id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay">
<control </observer>
id="de.bmotionstudio.gef.editor.text"> <observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.radiobutton"> id="de.bmotionstudio.gef.editor.radiobutton">
<observer
id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.textfield"> id="de.bmotionstudio.gef.editor.textfield">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay">
id="de.bmotionstudio.gef.editor.button"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
id="de.bmotionstudio.gef.editor.tablecell">
</control>
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute"> id="de.bmotionstudio.gef.editor.observer.SetAttribute">
<control </observer>
id="de.bmotionstudio.gef.editor.image"> <observer
</control> id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
<control </observer>
id="de.bmotionstudio.gef.editor.button">
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.composite"> id="de.bmotionstudio.gef.editor.composite">
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchImage">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchChildCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.text"> id="de.bmotionstudio.gef.editor.text">
<observer
id="de.bmotionstudio.gef.editor.observer.SimpleValueDisplay">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.rectangle"> id="de.bmotionstudio.gef.editor.rectangle">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
id="de.bmotionstudio.gef.editor.radiobutton"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SwitchImage">
id="de.bmotionstudio.gef.editor.checkbox"> </observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.connection"> id="de.bmotionstudio.gef.editor.connection">
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.ellipse"> id="de.bmotionstudio.gef.editor.ellipse">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
id="de.bmotionstudio.gef.editor.textfield"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SwitchImage">
id="de.bmotionstudio.gef.editor.tablecell"> </observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.table"> id="de.bmotionstudio.gef.editor.table">
<observer
id="de.bmotionstudio.gef.editor.observer.TableObserver">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.tablecolumn"> id="de.bmotionstudio.gef.editor.tablecolumn">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ColumnObserver">
id="de.bmotionstudio.gef.editor.signal">
</control>
<control
id="de.bmotionstudio.gef.editor.tank">
</control>
<control
id="de.bmotionstudio.gef.editor.switch">
</control>
<control
id="de.bmotionstudio.gef.editor.track">
</control>
<control
id="de.bmotionstudio.gef.editor.light">
</control>
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.SwitchChildCoordinates"> id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
<control
id="de.bmotionstudio.gef.editor.composite">
</control>
<control
id="de.bmotionstudio.gef.editor.visualization">
</control>
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.ExternalObserverScript"> id="de.bmotionstudio.gef.editor.observer.SetAttribute">
<control </observer>
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>
<control <control
id="de.bmotionstudio.gef.editor.tablecell"> id="de.bmotionstudio.gef.editor.tablecell">
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
id="de.bmotionstudio.gef.editor.table"> </observer>
</control> <observer
<control id="de.bmotionstudio.gef.editor.observer.SetAttribute">
id="de.bmotionstudio.gef.editor.tablecolumn"> </observer>
</control>
<control
id="de.bmotionstudio.gef.editor.light">
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.signal"> id="de.bmotionstudio.gef.editor.signal">
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.switch"> id="de.bmotionstudio.gef.editor.light">
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.track"> id="de.bmotionstudio.gef.editor.tank">
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.tracknode"> id="de.bmotionstudio.gef.editor.tracknode">
</control> <observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.SwitchImage"> id="de.bmotionstudio.gef.editor.observer.SetAttribute">
<control </observer>
id="de.bmotionstudio.gef.editor.image"> <observer
</control> id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
<control </observer>
id="de.bmotionstudio.gef.editor.composite">
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.rectangle"> id="de.bmotionstudio.gef.editor.track">
<observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer>
<observer
id="de.bmotionstudio.gef.editor.observer.SetAttribute">
</observer>
</control> </control>
<control <control
id="de.bmotionstudio.gef.editor.ellipse"> id="de.bmotionstudio.gef.editor.switch">
</control> <observer
id="de.bmotionstudio.gef.editor.observer.ListenOperationByPredicate">
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.ColumnObserver"> id="de.bmotionstudio.gef.editor.observer.SetAttribute">
<control
id="de.bmotionstudio.gef.editor.tablecolumn">
</control>
</observer> </observer>
<observer <observer
id="de.bmotionstudio.gef.editor.observer.TableObserver"> id="de.bmotionstudio.gef.editor.observer.SwitchCoordinates">
<control
id="de.bmotionstudio.gef.editor.table">
</control>
</observer> </observer>
</control>
</include> </include>
</extension> </extension>
</plugin> </plugin>
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
</appInfo> </appInfo>
</annotation> </annotation>
<complexType> <complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="observer"/>
</sequence>
<attribute name="id" type="string" use="required"> <attribute name="id" type="string" use="required">
<annotation> <annotation>
<documentation> <documentation>
...@@ -71,9 +74,6 @@ ...@@ -71,9 +74,6 @@
</appInfo> </appInfo>
</annotation> </annotation>
<complexType> <complexType>
<sequence minOccurs="1" maxOccurs="unbounded">
<element ref="control"/>
</sequence>
<attribute name="id" type="string" use="required"> <attribute name="id" type="string" use="required">
<annotation> <annotation>
<documentation> <documentation>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<element name="include"> <element name="include">
<complexType> <complexType>
<sequence minOccurs="1" maxOccurs="unbounded"> <sequence minOccurs="1" maxOccurs="unbounded">
<element ref="observer"/> <element ref="control"/>
</sequence> </sequence>
<attribute name="language" type="string" use="required"> <attribute name="language" type="string" use="required">
<annotation> <annotation>
......
...@@ -25,7 +25,6 @@ import org.eclipse.ui.actions.ActionFactory; ...@@ -25,7 +25,6 @@ import org.eclipse.ui.actions.ActionFactory;
import de.bmotionstudio.gef.editor.action.OpenSchedulerEventAction; import de.bmotionstudio.gef.editor.action.OpenSchedulerEventAction;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.model.ObserverRootVirtualTreeNode;
import de.bmotionstudio.gef.editor.model.Visualization; import de.bmotionstudio.gef.editor.model.Visualization;
import de.bmotionstudio.gef.editor.scheduler.SchedulerEvent; import de.bmotionstudio.gef.editor.scheduler.SchedulerEvent;
...@@ -120,8 +119,6 @@ public class BMSContextMenuProvider extends ContextMenuProvider { ...@@ -120,8 +119,6 @@ public class BMSContextMenuProvider extends ContextMenuProvider {
if (model instanceof BControl) if (model instanceof BControl)
bcontrol = (BControl) model; bcontrol = (BControl) model;
else if (model instanceof ObserverRootVirtualTreeNode)
bcontrol = ((ObserverRootVirtualTreeNode) model).getControl();
else else
return; return;
...@@ -131,51 +128,9 @@ public class BMSContextMenuProvider extends ContextMenuProvider { ...@@ -131,51 +128,9 @@ public class BMSContextMenuProvider extends ContextMenuProvider {
"icons/icon_observer.gif"), "observerMenu"); "icons/icon_observer.gif"), "observerMenu");
menu.appendToGroup(GEFActionConstants.GROUP_ADD, handleObserverMenu); menu.appendToGroup(GEFActionConstants.GROUP_ADD, handleObserverMenu);
IExtensionPoint extensionPoint = registry IExtensionPoint extensionPoint = Platform.getExtensionRegistry()
.getExtensionPoint("de.bmotionstudio.gef.editor.observer"); .getExtensionPoint(
for (IExtension extension : extensionPoint.getExtensions()) { "de.bmotionstudio.gef.editor.includeObserver");
for (IConfigurationElement configurationElement : extension
.getConfigurationElements()) {
if ("observer".equals(configurationElement.getName())) {
final String observerClassName = configurationElement
.getAttribute("class");
final String observerName = configurationElement
.getAttribute("name");
if (checkIncludeObserver(observerClassName, bcontrol)) {
IAction action = getActionRegistry().getAction(
"de.bmotionstudio.gef.editor.observerAction."
+ observerClassName);
action.setText(observerName);
action.setToolTipText(observerName);
if (bcontrol.hasObserver(observerClassName)) {
action.setImageDescriptor(BMotionStudioImage
.getImageDescriptor(
BMotionEditorPlugin.PLUGIN_ID,
"icons/icon_chop.gif"));
} else {
action.setImageDescriptor(null);
}
handleObserverMenu.add(action);
}
}
}
}
}
private boolean checkIncludeObserver(String observerID, BControl control) {
IExtensionPoint extensionPoint = registry
.getExtensionPoint("de.bmotionstudio.gef.editor.includeObserver");
for (IExtension extension : extensionPoint.getExtensions()) { for (IExtension extension : extensionPoint.getExtensions()) {
for (IConfigurationElement configurationElement : extension for (IConfigurationElement configurationElement : extension
...@@ -187,25 +142,35 @@ public class BMSContextMenuProvider extends ContextMenuProvider { ...@@ -187,25 +142,35 @@ public class BMSContextMenuProvider extends ContextMenuProvider {
.getAttribute("language"); .getAttribute("language");
if (langID != null if (langID != null
&& langID.equals(control.getVisualization() && langID.equals(bcontrol.getVisualization().getLanguage())) {
.getLanguage())) {
for (IConfigurationElement configC : configurationElement
.getChildren("control")) {
for (IConfigurationElement cObserver : configurationElement String cID = configC.getAttribute("id");
if (bcontrol.getType().equals(cID)) {
for (IConfigurationElement configO : configC
.getChildren("observer")) { .getChildren("observer")) {
String oID = cObserver.getAttribute("id"); String oID = configO.getAttribute("id");
IAction action = getActionRegistry()
.getAction(
"de.bmotionstudio.gef.editor.observerAction."
+ oID);
if (observerID.equals(oID)) { String name = oID;
for (IConfigurationElement configBControl : cObserver IConfigurationElement observerExtension = BMotionEditorPlugin
.getChildren("control")) { .getObserverExtension(oID);
if (observerExtension != null)
name = observerExtension
.getAttribute("name");
String bID = configBControl action.setText(name);
.getAttribute("id");
if (control.getType().equals(bID)) { handleObserverMenu.add(action);
return true;
}
} }
...@@ -220,8 +185,6 @@ public class BMSContextMenuProvider extends ContextMenuProvider { ...@@ -220,8 +185,6 @@ public class BMSContextMenuProvider extends ContextMenuProvider {
} }
} }
return false;
} }
private void buildEventMenu(IMenuManager menu, AbstractEditPart editPart) { private void buildEventMenu(IMenuManager menu, AbstractEditPart editPart) {
...@@ -282,14 +245,6 @@ public class BMSContextMenuProvider extends ContextMenuProvider { ...@@ -282,14 +245,6 @@ public class BMSContextMenuProvider extends ContextMenuProvider {
action.setText(configSchedulerElement action.setText(configSchedulerElement
.getAttribute("name")); .getAttribute("name"));
// if (bcontrol.hasEvent(eventIDs[0])) {
// action
// .setImageDescriptor(BMotionStudioImage
// .getImageDescriptor(
// BMotionEditorPlugin.PLUGIN_ID,
// "icons/icon_chop.gif"));
// } else {
action.setImageDescriptor(null); action.setImageDescriptor(null);
// } // }
......
...@@ -6,29 +6,79 @@ ...@@ -6,29 +6,79 @@
package de.bmotionstudio.gef.editor; package de.bmotionstudio.gef.editor;
import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
public abstract class BMotionAbstractWizard extends Wizard { public abstract class BMotionAbstractWizard extends TrayDialog {
private BControl control; private BControl control;
public BMotionAbstractWizard(BControl control) { public static final int CLOSE = 2;
this.control = control;
}
@Override public BMotionAbstractWizard(Shell shell, BControl control) {
public boolean performFinish() { super(shell);
return prepareToFinish(); this.control = control;
} }
public BControl getBControl() { public BControl getBControl() {
return this.control; return this.control;
} }
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
}
public abstract String getName(); public abstract String getName();
protected abstract Boolean prepareToFinish(); @Override
protected int getShellStyle() {
return SWT.SHELL_TRIM;
}
@Override
protected Control createDialogArea(Composite parent) {
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.verticalSpacing = 0;
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(layout);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
createWizardContent(container);
return container;
}
@Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.CLOSE_ID,
IDialogConstants.CLOSE_LABEL, true);
}
@Override
protected void buttonPressed(int buttonId) {
if (IDialogConstants.CLOSE_ID == buttonId)
closePressed();
}
protected void closePressed() {
setReturnCode(CLOSE);
close();
}
public abstract Control createWizardContent(Composite parent);
} }
...@@ -8,7 +8,7 @@ package de.bmotionstudio.gef.editor; ...@@ -8,7 +8,7 @@ package de.bmotionstudio.gef.editor;
public class EditorImageRegistry implements IBMotionStudioImageRegistry { public class EditorImageRegistry implements IBMotionStudioImageRegistry {
public static final String IMG_ICON_ADD = "icon_add"; // public static final String IMG_ICON_ADD = "icon_add";
public static final String IMG_ICON_CHOP = "icon_chop"; public static final String IMG_ICON_CHOP = "icon_chop";
public static final String IMG_ICON_DELETE = "icon_delete"; public static final String IMG_ICON_DELETE = "icon_delete";
public static final String IMG_ICON_DELETE21 = "icon_delete21"; public static final String IMG_ICON_DELETE21 = "icon_delete21";
...@@ -18,7 +18,6 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -18,7 +18,6 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
public static final String IMG_ICON_OBSERVER = "icon_observer"; public static final String IMG_ICON_OBSERVER = "icon_observer";
public static final String IMG_ICON_LOADING = "icon_loading"; public static final String IMG_ICON_LOADING = "icon_loading";
public static final String IMG_ICON_LIBRARY = "icon_library"; public static final String IMG_ICON_LIBRARY = "icon_library";
public static final String IMG_ICON_ASCRIPT = "icon_ascript";
public static final String IMG_ICON_UP = "icon_up"; public static final String IMG_ICON_UP = "icon_up";
public static final String IMG_ICON_DOWN = "icon_down"; public static final String IMG_ICON_DOWN = "icon_down";
public static final String IMG_ICON_CONNECTION16 = "icon_connection16"; public static final String IMG_ICON_CONNECTION16 = "icon_connection16";
...@@ -28,6 +27,7 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -28,6 +27,7 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
public static final String IMG_ICON_TR_UP = "icon_tr_up"; public static final String IMG_ICON_TR_UP = "icon_tr_up";
public static final String IMG_ICON_TR_LEFT = "icon_tr_left"; public static final String IMG_ICON_TR_LEFT = "icon_tr_left";
public static final String IMG_ICON_CONTROL_HIDDEN = "icon_control_hidden"; public static final String IMG_ICON_CONTROL_HIDDEN = "icon_control_hidden";
public static final String IMG_ICON_HELP = "icon_help";
public static final String IMG_ICON_JPG = "icon_jpg"; public static final String IMG_ICON_JPG = "icon_jpg";
public static final String IMG_ICON_GIF = "icon_gif"; public static final String IMG_ICON_GIF = "icon_gif";
...@@ -36,8 +36,8 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -36,8 +36,8 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
public void registerImages() { public void registerImages() {
BMotionStudioImage.registerImage(IMG_ICON_ADD, // BMotionStudioImage.registerImage(IMG_ICON_ADD,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_add.gif"); // BMotionEditorPlugin.PLUGIN_ID, "icons/icon_add.gif");
BMotionStudioImage.registerImage(IMG_ICON_CHOP, BMotionStudioImage.registerImage(IMG_ICON_CHOP,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_chop.gif"); BMotionEditorPlugin.PLUGIN_ID, "icons/icon_chop.gif");
BMotionStudioImage.registerImage(IMG_ICON_DELETE, BMotionStudioImage.registerImage(IMG_ICON_DELETE,
...@@ -54,8 +54,6 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -54,8 +54,6 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_loading.gif"); BMotionEditorPlugin.PLUGIN_ID, "icons/icon_loading.gif");
BMotionStudioImage.registerImage(IMG_ICON_LIBRARY, BMotionStudioImage.registerImage(IMG_ICON_LIBRARY,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_library.gif"); BMotionEditorPlugin.PLUGIN_ID, "icons/icon_library.gif");
BMotionStudioImage.registerImage(IMG_ICON_ASCRIPT,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_ascript.png");
BMotionStudioImage.registerImage(IMG_ICON_UP, BMotionStudioImage.registerImage(IMG_ICON_UP,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_up.gif"); BMotionEditorPlugin.PLUGIN_ID, "icons/icon_up.gif");
BMotionStudioImage.registerImage(IMG_ICON_DOWN, BMotionStudioImage.registerImage(IMG_ICON_DOWN,
...@@ -72,6 +70,9 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -72,6 +70,9 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
"org.eclipse.ui", "$nl$/icons/full/etool16/delete_edit.gif"); "org.eclipse.ui", "$nl$/icons/full/etool16/delete_edit.gif");
BMotionStudioImage.registerImage(IMG_ICON_DELETE_EDIT, BMotionStudioImage.registerImage(IMG_ICON_DELETE_EDIT,
"org.eclipse.ui", "$nl$/icons/full/etool16/delete_edit.gif"); "org.eclipse.ui", "$nl$/icons/full/etool16/delete_edit.gif");
BMotionStudioImage.registerImage(IMG_ICON_HELP,
BMotionEditorPlugin.PLUGIN_ID,
"icons/eclipse16/linkto_help.gif");
BMotionStudioImage BMotionStudioImage
.registerImage(IMG_ICON_TR_UP, BMotionEditorPlugin.PLUGIN_ID, .registerImage(IMG_ICON_TR_UP, BMotionEditorPlugin.PLUGIN_ID,
"icons/eclipse16/updated_co.gif"); "icons/eclipse16/updated_co.gif");
......
/**
* (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.action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IWorkbenchPart;
import de.bmotionstudio.gef.editor.BMotionStudioImage;
import de.bmotionstudio.gef.editor.EditorImageRegistry;
public abstract class BMotionAbstractWizardDialog extends WizardDialog {
public static final int DELETE = 3;
private IWorkbenchPart workbenchPart;
private String deleteToolTip;
public BMotionAbstractWizardDialog(IWorkbenchPart workbenchPart, IWizard newWizard) {
super(workbenchPart.getSite().getShell(), newWizard);
this.workbenchPart = workbenchPart;
}
@Override
protected Control createButtonBar(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
layout.horizontalSpacing = 0;
composite.setLayout(layout);
composite
.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
composite.setFont(parent.getFont());
// create help control if needed
if (isHelpAvailable()) {
Control helpControl = createHelpControl(composite);
((GridData) helpControl.getLayoutData()).horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
}
Control deleteControl = createDeleteControl(composite);
((GridData) deleteControl.getLayoutData()).horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
setHelpAvailable(false);
Control buttonSection = super.createButtonBar(composite);
((GridData) buttonSection.getLayoutData()).grabExcessHorizontalSpace = true;
return composite;
}
private Control createDeleteControl(Composite parent) {
return createDeleteImageButton(parent,
BMotionStudioImage
.getImage(EditorImageRegistry.IMG_ICON_DELETE21));
}
private ToolBar createDeleteImageButton(Composite parent, Image image) {
ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
((GridLayout) parent.getLayout()).numColumns++;
toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
toolBar.setCursor(cursor);
toolBar.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
cursor.dispose();
}
});
ToolItem deleteToolItem = new ToolItem(toolBar, SWT.NONE);
deleteToolItem.setImage(image);
deleteToolItem.setToolTipText(deleteToolTip);
deleteToolItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
deletePressed();
}
});
return toolBar;
}
protected abstract void deletePressed();
public IWorkbenchPart getWorkbenchPart() {
return workbenchPart;
}
protected void setDeleteToolTip(String msg) {
this.deleteToolTip = msg;
}
}
/**
* (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.action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPart;
public class BMotionObserverWizardDialog extends BMotionAbstractWizardDialog {
public BMotionObserverWizardDialog(IWorkbenchPart workbenchPart, IWizard newWizard) {
super(workbenchPart, newWizard);
setShellStyle(SWT.CLOSE | SWT.RESIZE);
setDeleteToolTip("Delete Observer");
}
@Override
protected void deletePressed() {
if (MessageDialog.openConfirm(Display.getDefault().getActiveShell(),
"Do you really want to delete this Observer?",
"Do you really want to delete this Observer?")) {
setReturnCode(DELETE);
close();
}
}
}
/**
* (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.action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPart;
import de.bmotionstudio.gef.editor.scheduler.SchedulerWizard;
public class BMotionSchedulerEventWizardDialog extends BMotionAbstractWizardDialog {
public BMotionSchedulerEventWizardDialog(IWorkbenchPart workbenchPart,
IWizard newWizard) {
super(workbenchPart, newWizard);
setShellStyle(SWT.CLOSE);
setDeleteToolTip("Delete Event");
}
@Override
protected void deletePressed() {
if (MessageDialog.openConfirm(Display.getDefault().getActiveShell(),
"Do you really want to delete this Event?",
"Do you really want to delete this Event?")) {
RemoveSchedulerEventAction action = new RemoveSchedulerEventAction(
getWorkbenchPart());
action.setControl(((SchedulerWizard) getWizard()).getBControl());
action.setSchedulerEvent(((SchedulerWizard) getWizard())
.getScheduler());
action.run();
setReturnCode(DELETE);
close();
}
}
}
...@@ -8,18 +8,12 @@ package de.bmotionstudio.gef.editor.action; ...@@ -8,18 +8,12 @@ package de.bmotionstudio.gef.editor.action;
import java.util.List; import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPart;
import org.eclipse.gef.ui.actions.SelectionAction; import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchPart;
import de.bmotionstudio.gef.editor.BMotionEditorPlugin;
import de.bmotionstudio.gef.editor.BMotionStudioImage;
import de.bmotionstudio.gef.editor.command.RemoveObserverCommand;
import de.bmotionstudio.gef.editor.command.SetObserverCommand;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.model.ObserverRootVirtualTreeNode;
import de.bmotionstudio.gef.editor.observer.Observer; import de.bmotionstudio.gef.editor.observer.Observer;
import de.bmotionstudio.gef.editor.observer.ObserverWizard; import de.bmotionstudio.gef.editor.observer.ObserverWizard;
import de.prob.logging.Logger; import de.prob.logging.Logger;
...@@ -50,79 +44,23 @@ public class OpenObserverAction extends SelectionAction { ...@@ -50,79 +44,23 @@ public class OpenObserverAction extends SelectionAction {
if (actionControl != null) { if (actionControl != null) {
Observer oldObserver = null;
Observer observer = getControl().getObserver(getClassName()); Observer observer = getControl().getObserver(getClassName());
// If an observer does not exist, add one ObserverWizard wizard = observer.getWizard(Display.getDefault()
if (observer == null) { .getActiveShell(), actionControl);
try {
observer = (Observer) BMotionEditorPlugin
.getObserverExtension(getClassName())
.createExecutableExtension("class");
} catch (CoreException e) {
}
} else { // else edit the current observer
// therefore, clone the current observer, if the user aborts
// editing the current observer
try {
oldObserver = observer.clone();
} catch (CloneNotSupportedException e) {
}
}
ObserverWizard wizard = observer.getWizard(actionControl);
if (wizard != null) { if (wizard != null) {
wizard.create();
BMotionObserverWizardDialog dialog = new BMotionObserverWizardDialog( wizard.getShell().setSize(wizard.getSize());
getWorkbenchPart(), wizard); String title = "Observer: " + observer.getName() + " Control: "
dialog.create(); + getControl().getID();
dialog.getShell().setSize(wizard.getSize()); wizard.getShell().setText(title);
String title = "Observer: " + observer.getName() // wizard.setWindowTitle("BMotion Studio Observer Wizard");
+ " Control: " + getControl().getID(); // wizard.setTitle(title);
wizard.setWindowTitle("BMotion Studio Observer Wizard"); // wizard.setMessage(observer.getDescription());
dialog.setTitle(title); // wizard.setTitleImage(BMotionStudioImage
dialog.setMessage(observer.getDescription()); // .getImage(BMotionStudioImage.IMG_LOGO_BMOTION64));
dialog.setTitleImage(BMotionStudioImage wizard.open();
.getImage(BMotionStudioImage.IMG_LOGO_BMOTION64));
int status = dialog.open();
// The user clicked on the "OK" button in order to confirm his
// changes on the observer
if (status == WizardDialog.OK) {
// If the observer delete flag is set to true, delete the
// observer anyway
if (wizard.isObserverDelete()) {
RemoveObserverCommand cmd = createRemoveObserverCommand(
observer, actionControl);
execute(cmd);
} else {
SetObserverCommand cmd = createObserverSetCommand(
actionControl, observer, oldObserver);
execute(cmd);
}
// else the user canceled his changes on the observer
} else if (status == WizardDialog.CANCEL) {
// Reset observer without using a command!
if (oldObserver != null)
actionControl.getObservers().put(oldObserver.getID(),
oldObserver);
// else the user clicked on the delete button in order to
// delete the observer
} else if (status == BMotionObserverWizardDialog.DELETE) {
RemoveObserverCommand cmd = createRemoveObserverCommand(
observer, actionControl);
execute(cmd);
}
} else { } else {
Logger.notifyUserWithoutBugreport("The Observer \"" Logger.notifyUserWithoutBugreport("The Observer \""
+ observer.getName() + observer.getName()
...@@ -132,28 +70,6 @@ public class OpenObserverAction extends SelectionAction { ...@@ -132,28 +70,6 @@ public class OpenObserverAction extends SelectionAction {
} }
private RemoveObserverCommand createRemoveObserverCommand(
Observer observer, BControl control) {
RemoveObserverCommand cmd = new RemoveObserverCommand();
cmd.setControl(control);
cmd.setObserver(observer);
return cmd;
}
public SetObserverCommand createObserverSetCommand(BControl control,
Observer newObserver, Observer oldObserver) {
SetObserverCommand cmd = new SetObserverCommand();
cmd.setNewObserver(newObserver);
cmd.setOldObserver(oldObserver);
cmd.setControl(control);
return cmd;
}
public SetObserverCommand createObserverSetCommand(BControl control,
Observer newObserver) {
return createObserverSetCommand(control, newObserver, null);
}
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
} }
...@@ -172,10 +88,7 @@ public class OpenObserverAction extends SelectionAction { ...@@ -172,10 +88,7 @@ public class OpenObserverAction extends SelectionAction {
if ((objects.get(0) instanceof EditPart)) { if ((objects.get(0) instanceof EditPart)) {
EditPart part = (EditPart) objects.get(0); EditPart part = (EditPart) objects.get(0);
BControl control = null; BControl control = null;
if (part.getModel() instanceof ObserverRootVirtualTreeNode) if (part.getModel() instanceof BControl)
control = ((ObserverRootVirtualTreeNode) part.getModel())
.getControl();
else if (part.getModel() instanceof BControl)
control = (BControl) part.getModel(); control = (BControl) part.getModel();
return control; return control;
} }
......
...@@ -8,16 +8,12 @@ package de.bmotionstudio.gef.editor.action; ...@@ -8,16 +8,12 @@ package de.bmotionstudio.gef.editor.action;
import java.util.List; import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPart;
import org.eclipse.gef.ui.actions.SelectionAction; import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchPart;
import de.bmotionstudio.gef.editor.AttributeConstants; import de.bmotionstudio.gef.editor.AttributeConstants;
import de.bmotionstudio.gef.editor.BMotionEditorPlugin;
import de.bmotionstudio.gef.editor.BMotionStudioImage;
import de.bmotionstudio.gef.editor.command.SchedulerEventCommand;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.scheduler.SchedulerEvent; import de.bmotionstudio.gef.editor.scheduler.SchedulerEvent;
import de.bmotionstudio.gef.editor.scheduler.SchedulerWizard; import de.bmotionstudio.gef.editor.scheduler.SchedulerWizard;
...@@ -27,7 +23,6 @@ public class OpenSchedulerEventAction extends SelectionAction { ...@@ -27,7 +23,6 @@ public class OpenSchedulerEventAction extends SelectionAction {
private String className; private String className;
private String eventID; private String eventID;
private SchedulerEvent clonedSchedulerEvent;
public OpenSchedulerEventAction(IWorkbenchPart part) { public OpenSchedulerEventAction(IWorkbenchPart part) {
super(part); super(part);
...@@ -46,82 +41,33 @@ public class OpenSchedulerEventAction extends SelectionAction { ...@@ -46,82 +41,33 @@ public class OpenSchedulerEventAction extends SelectionAction {
public void run() { public void run() {
BControl bcontrol = getControl(); BControl bcontrol = getControl();
clonedSchedulerEvent = null;
if (bcontrol != null) { if (bcontrol != null) {
SchedulerEvent newSchedulerEvent = bcontrol.getEvent(getEventID()); SchedulerEvent newSchedulerEvent = bcontrol.getEvent(getEventID());
// Add Scheduler Event
if (newSchedulerEvent == null) {
try {
newSchedulerEvent = (SchedulerEvent) BMotionEditorPlugin
.getSchedulerExtension(getClassName())
.createExecutableExtension("class");
} catch (CoreException e) {
}
} else { // Edit Scheduler Event
// Clone Scheduler Event
try {
clonedSchedulerEvent = newSchedulerEvent.clone();
} catch (CloneNotSupportedException e) {
}
}
if (newSchedulerEvent != null) { if (newSchedulerEvent != null) {
newSchedulerEvent.setEventID(getEventID()); newSchedulerEvent.setEventID(getEventID());
SchedulerWizard wizard = newSchedulerEvent.getWizard(bcontrol); SchedulerWizard wizard = newSchedulerEvent.getWizard(Display
.getDefault().getActiveShell(), bcontrol);
if (wizard != null) { if (wizard != null) {
BMotionSchedulerEventWizardDialog dialog = new BMotionSchedulerEventWizardDialog( wizard.create();
getWorkbenchPart(), wizard); wizard.getShell().setSize(wizard.getSize());
dialog.create();
dialog.getShell().setSize(wizard.getSize());
String title = "Scheduler Event: " String title = "Scheduler Event: "
+ newSchedulerEvent.getName() + newSchedulerEvent.getName()
+ " Control: " + " Control: "
+ bcontrol + bcontrol
.getAttributeValue(AttributeConstants.ATTRIBUTE_ID); .getAttributeValue(AttributeConstants.ATTRIBUTE_ID);
wizard.setWindowTitle("BMotion Studio Scheduler Event Wizard"); wizard.getShell().setText(title);
dialog.setTitle(title); // wizard.setWindowTitle("BMotion Studio Scheduler Event Wizard");
dialog.setMessage(newSchedulerEvent.getDescription()); // wizard.setTitle(title);
dialog.setTitleImage(BMotionStudioImage // wizard.setMessage(newSchedulerEvent.getDescription());
.getImage(BMotionStudioImage.IMG_LOGO_BMOTION64)); // wizard.setTitleImage(BMotionStudioImage
int status = dialog.open(); // .getImage(BMotionStudioImage.IMG_LOGO_BMOTION64));
wizard.open();
if (status == WizardDialog.OK) {
SchedulerEventCommand schedulerEventCommand = createSchedulerEventCommand();
schedulerEventCommand
.setNewSchedulerEvent(newSchedulerEvent);
if (wizard.isEventDelete()) {
RemoveSchedulerEventAction action = new RemoveSchedulerEventAction(
getWorkbenchPart());
action.setControl(getControl());
action.setSchedulerEvent(clonedSchedulerEvent);
action.run();
} else {
if (clonedSchedulerEvent != null) {
schedulerEventCommand
.setClonedSchedulerEvent(clonedSchedulerEvent);
}
execute(schedulerEventCommand);
}
} else if (status == WizardDialog.CANCEL) {
if (clonedSchedulerEvent != null)
bcontrol.addEvent(getEventID(),
clonedSchedulerEvent);
}
} else { } else {
Logger.notifyUserWithoutBugreport("The Scheduler Event \"" Logger.notifyUserWithoutBugreport("The Scheduler Event \""
...@@ -137,14 +83,6 @@ public class OpenSchedulerEventAction extends SelectionAction { ...@@ -137,14 +83,6 @@ public class OpenSchedulerEventAction extends SelectionAction {
} }
public SchedulerEventCommand createSchedulerEventCommand() {
SchedulerEventCommand command = new SchedulerEventCommand();
command.setClassName(getClassName());
command.setEventID(getEventID());
command.setControl(getControl());
return command;
}
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
package de.bmotionstudio.gef.editor.command; package de.bmotionstudio.gef.editor.command;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.model.BControlPropertyConstants;
public class BringToBottomCommand extends AbstractBringToCommand { public class BringToBottomCommand extends AbstractBringToCommand {
...@@ -17,8 +18,8 @@ public class BringToBottomCommand extends AbstractBringToCommand { ...@@ -17,8 +18,8 @@ public class BringToBottomCommand extends AbstractBringToCommand {
getOldIndexMap().put(control, oldIndex); getOldIndexMap().put(control, oldIndex);
parent.getChildrenArray().remove(control); parent.getChildrenArray().remove(control);
parent.getChildrenArray().add(0, control); parent.getChildrenArray().add(0, control);
parent.getListeners().firePropertyChange(BControl.PROPERTY_ADD, parent.getListeners().firePropertyChange(
null, null); BControlPropertyConstants.PROPERTY_ADD_CHILD, null, null);
} }
} }
...@@ -28,8 +29,8 @@ public class BringToBottomCommand extends AbstractBringToCommand { ...@@ -28,8 +29,8 @@ public class BringToBottomCommand extends AbstractBringToCommand {
parent.getChildrenArray().remove(control); parent.getChildrenArray().remove(control);
parent.getChildrenArray().add(getOldIndexMap().get(control), parent.getChildrenArray().add(getOldIndexMap().get(control),
control); control);
parent.getListeners().firePropertyChange(BControl.PROPERTY_ADD, parent.getListeners().firePropertyChange(
null, null); BControlPropertyConstants.PROPERTY_ADD_CHILD, null, null);
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
package de.bmotionstudio.gef.editor.command; package de.bmotionstudio.gef.editor.command;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.model.BControlPropertyConstants;
public class BringToBottomStepCommand extends AbstractBringToCommand { public class BringToBottomStepCommand extends AbstractBringToCommand {
...@@ -18,8 +19,9 @@ public class BringToBottomStepCommand extends AbstractBringToCommand { ...@@ -18,8 +19,9 @@ public class BringToBottomStepCommand extends AbstractBringToCommand {
if (oldIndex > 0) { if (oldIndex > 0) {
parent.getChildrenArray().remove(control); parent.getChildrenArray().remove(control);
parent.getChildrenArray().add(oldIndex - 1, control); parent.getChildrenArray().add(oldIndex - 1, control);
parent.getListeners().firePropertyChange(BControl.PROPERTY_ADD, parent.getListeners().firePropertyChange(
null, null); BControlPropertyConstants.PROPERTY_ADD_CHILD, null,
null);
} }
} }
} }
...@@ -30,8 +32,8 @@ public class BringToBottomStepCommand extends AbstractBringToCommand { ...@@ -30,8 +32,8 @@ public class BringToBottomStepCommand extends AbstractBringToCommand {
parent.getChildrenArray().remove(control); parent.getChildrenArray().remove(control);
parent.getChildrenArray().add(getOldIndexMap().get(control), parent.getChildrenArray().add(getOldIndexMap().get(control),
control); control);
parent.getListeners().firePropertyChange(BControl.PROPERTY_ADD, parent.getListeners().firePropertyChange(
null, null); BControlPropertyConstants.PROPERTY_ADD_CHILD, null, null);
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
package de.bmotionstudio.gef.editor.command; package de.bmotionstudio.gef.editor.command;
import de.bmotionstudio.gef.editor.model.BControl; import de.bmotionstudio.gef.editor.model.BControl;
import de.bmotionstudio.gef.editor.model.BControlPropertyConstants;
public class BringToTopCommand extends AbstractBringToCommand { public class BringToTopCommand extends AbstractBringToCommand {
...@@ -18,8 +19,8 @@ public class BringToTopCommand extends AbstractBringToCommand { ...@@ -18,8 +19,8 @@ public class BringToTopCommand extends AbstractBringToCommand {
parent.getChildrenArray().remove(control); parent.getChildrenArray().remove(control);
parent.getChildrenArray().add(parent.getChildrenArray().size(), parent.getChildrenArray().add(parent.getChildrenArray().size(),
control); control);
parent.getListeners().firePropertyChange(BControl.PROPERTY_ADD, parent.getListeners().firePropertyChange(
null, null); BControlPropertyConstants.PROPERTY_ADD_CHILD, null, null);
} }
} }
...@@ -29,8 +30,8 @@ public class BringToTopCommand extends AbstractBringToCommand { ...@@ -29,8 +30,8 @@ public class BringToTopCommand extends AbstractBringToCommand {
parent.getChildrenArray().remove(control); parent.getChildrenArray().remove(control);
parent.getChildrenArray().add(getOldIndexMap().get(control), parent.getChildrenArray().add(getOldIndexMap().get(control),
control); control);
parent.getListeners().firePropertyChange(BControl.PROPERTY_ADD, parent.getListeners().firePropertyChange(
null, null); BControlPropertyConstants.PROPERTY_ADD_CHILD, null, null);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment