ソースを参照

Fix some spelling issues

Dominik Tesch 9 年 前
コミット
32acf11c60

+ 6 - 6
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/validation/STextJavaValidator.java

@@ -518,7 +518,7 @@ public class STextJavaValidator extends AbstractSTextJavaValidator implements ST
 			EList<Parameter> parameters = operation.getParameters();
 			EList<Expression> args = call.getArgs();
 			if (parameters.size() != args.size()) {
-				error("Wrong number of arguments, expected " + parameters, null);
+				error("Wrong number of arguments, expected " + parameters + ".", null);
 			}
 		}
 	}
@@ -530,7 +530,7 @@ public class STextJavaValidator extends AbstractSTextJavaValidator implements ST
 			EList<Parameter> parameters = operation.getParameters();
 			EList<Expression> args = call.getArgs();
 			if (parameters.size() != args.size()) {
-				error("Wrong number of arguments, expected " + parameters, null);
+				error("Wrong number of arguments, expected " + parameters + ".", null);
 			}
 		}
 	}
@@ -574,7 +574,7 @@ public class STextJavaValidator extends AbstractSTextJavaValidator implements ST
 			return;
 		}
 		if (call.getFeature() instanceof Scope) {
-			error("A variable, event or operation is required", ExpressionsPackage.Literals.FEATURE_CALL__FEATURE,
+			error("A variable, event or operation is required.", ExpressionsPackage.Literals.FEATURE_CALL__FEATURE,
 					INSIGNIFICANT_INDEX, FEATURE_CALL_TO_SCOPE);
 		}
 	}
@@ -585,7 +585,7 @@ public class STextJavaValidator extends AbstractSTextJavaValidator implements ST
 			return;
 		}
 		if (call.getReference() instanceof Scope) {
-			error("A variable, event or operation is required",
+			error("A variable, event or operation is required.",
 					ExpressionsPackage.Literals.ELEMENT_REFERENCE_EXPRESSION__REFERENCE, INSIGNIFICANT_INDEX,
 					FEATURE_CALL_TO_SCOPE);
 		}
@@ -596,7 +596,7 @@ public class STextJavaValidator extends AbstractSTextJavaValidator implements ST
 		for (EventSpec eventSpec : reactionTrigger.getTriggers()) {
 			if (!(reactionTrigger.eContainer() instanceof LocalReaction)
 					&& (eventSpec instanceof EntryEvent || eventSpec instanceof ExitEvent)) {
-				error("entry and exit events are allowed as local reactions only.",
+				error("Entry and exit events are allowed as local reactions only.",
 						StextPackage.Literals.REACTION_TRIGGER__TRIGGERS, INSIGNIFICANT_INDEX,
 						LOCAL_REACTIONS_NOT_ALLOWED);
 			}
@@ -790,7 +790,7 @@ public class STextJavaValidator extends AbstractSTextJavaValidator implements ST
 	public void checkImportExists(Import importDef) {
 		String importedNamespace = importDef.getImportedNamespace();
 		if (!checkImportedNamespaceExists(importDef.getImportedNamespace(), getResource(importDef))) {
-			error("The import " + importedNamespace + " cannot be resolved", importDef,
+			error("The import " + importedNamespace + " cannot be resolved.", importDef,
 					StextPackage.Literals.IMPORT__IMPORTED_NAMESPACE, IMPORT_NOT_RESOLVED);
 		}
 	}

+ 305 - 305
plugins/org.yakindu.sct.simulation.ui.sexec/src/org/yakindu/sct/simulation/ui/sexec/launch/tabs/StatechartLaunchConfigurationTab.java

@@ -1,305 +1,305 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.simulation.ui.sexec.launch.tabs;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchTab;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ResourceListSelectionDialog;
-import org.yakindu.sct.commons.WorkspaceClassLoaderFactory;
-import org.yakindu.sct.simulation.core.sexec.launch.ISCTLaunchParameters;
-import org.yakindu.sct.simulation.ui.SimulationImages;
-
-/**
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class StatechartLaunchConfigurationTab extends JavaLaunchTab implements ISCTLaunchParameters {
-
-
-	public static final String LAUNCH_TAB_ID = "org.yakindu.sct.simulation.sexec.launchTab";
-	
-	
-	private Text modelfile;
-	private Text cyclePeriod;
-	private Text operationClass;
-	private Button btnCycle;
-	private Button btnEvent;
-
-	public void createControl(Composite parent) {
-		Composite comp = new Composite(parent, SWT.NONE);
-		setControl(comp);
-		comp.setLayout(new GridLayout(1, true));
-		createFileSelectionGroup(comp);
-		new Label(comp, SWT.NONE);
-	}
-
-	private void createFileSelectionGroup(Composite comp) {
-		createModelFileGroup(comp);
-		createOperationClassGroup(comp);
-		createExecutionTypeControls(comp);
-		createCyclePeriodGroup(comp);
-	}
-
-	private void createOperationClassGroup(Composite parent) {
-		Group propertyGroup = new Group(parent, SWT.NONE);
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(propertyGroup);
-		propertyGroup.setText("Operation Class:");
-		propertyGroup.setLayout(new GridLayout(1, false));
-		operationClass = new Text(propertyGroup, SWT.BORDER);
-		operationClass.addListener(SWT.Modify, new UpdateListener());
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(operationClass);
-	}
-
-	private void createExecutionTypeControls(Composite parent) {
-		Group propertyGroup = new Group(parent, SWT.NONE);
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(propertyGroup);
-		propertyGroup.setText("Execution Type:");
-		propertyGroup.setLayout(new GridLayout(1, true));
-		btnCycle = new Button(propertyGroup, SWT.RADIO);
-		btnCycle.setText("cycle based");
-		btnCycle.addListener(SWT.Selection, new UpdateListener());
-		btnCycle.addListener(SWT.Selection, new EnableStateListener());
-		GridDataFactory.fillDefaults().applyTo(btnCycle);
-		btnEvent = new Button(propertyGroup, SWT.RADIO);
-		btnEvent.setText("event driven");
-		btnEvent.addListener(SWT.Selection, new UpdateListener());
-		btnCycle.addListener(SWT.Selection, new EnableStateListener());
-		GridDataFactory.fillDefaults().applyTo(btnEvent);
-	}
-
-	private void createCyclePeriodGroup(Composite parent) {
-		Group propertyGroup = new Group(parent, SWT.NONE);
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(propertyGroup);
-		propertyGroup.setText("Cycle Period:");
-		propertyGroup.setLayout(new GridLayout(2, false));
-		cyclePeriod = new Text(propertyGroup, SWT.BORDER);
-		cyclePeriod.addListener(SWT.Modify, new UpdateListener());
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(cyclePeriod);
-		Label lblMs = new Label(propertyGroup, SWT.NONE);
-		lblMs.setText("ms");
-		GridDataFactory.fillDefaults().applyTo(lblMs);
-	}
-
-	private void createModelFileGroup(Composite comp) {
-		Group fileGroup = new Group(comp, SWT.NONE);
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(fileGroup);
-		fileGroup.setText("Model file:");
-		fileGroup.setLayout(new GridLayout(2, false));
-
-		modelfile = new Text(fileGroup, SWT.BORDER);
-		modelfile.addListener(SWT.Modify, new UpdateListener());
-		GridDataFactory.fillDefaults().grab(true, false).applyTo(modelfile);
-
-		Button browse = new Button(fileGroup, SWT.NONE);
-		browse.setText("Search");
-		browse.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(getShell(),
-						getStatechartResources()) {
-					@Override
-					protected String adjustPattern() {
-						String pattern = super.adjustPattern();
-						if (pattern.equals("")) {
-							return "*";
-						}
-						return pattern;
-					}
-				};
-				dialog.setTitle("Select Statechart model");
-				dialog.setMessage("Please select the YAKINDU statechart model file you want to execute.");
-				if (dialog.open() == 0) {
-					Object[] files = dialog.getResult();
-					IFile file = (IFile) files[0];
-					modelfile.setText((file.getFullPath().toString()));
-				}
-			}
-
-			private IResource[] getStatechartResources() {
-				final List<IResource> resources = new ArrayList<IResource>();
-				try {
-					ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() {
-						public boolean visit(IResource resource) throws CoreException {
-							if ("sct".equalsIgnoreCase(resource.getFileExtension())) {
-								resources.add(resource);
-							}
-							return true;
-						}
-					});
-				} catch (CoreException e) {
-					e.printStackTrace();
-				}
-				return resources.toArray(new IResource[0]);
-			}
-		});
-		GridDataFactory.fillDefaults().applyTo(browse);
-	}
-
-	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
-	}
-
-	public void initializeFrom(ILaunchConfiguration configuration) {
-		try {
-			modelfile.setText(configuration.getAttribute(FILE_NAME, DEFAULT_FILE_NAME));
-			operationClass.setText(configuration.getAttribute(OPERATION_CLASS, DEFAULT_OPERATION_CLASS));
-			cyclePeriod.setText(String.valueOf(configuration.getAttribute(CYCLE_PERIOD, DEFAULT_CYCLE_PERIOD)));
-			btnCycle.setSelection(configuration.getAttribute(IS_CYCLE_BASED, DEFAULT_IS_CYCLE_BASED));
-			btnEvent.setSelection(configuration.getAttribute(IS_EVENT_DRIVEN, DEFAULT_IS_EVENT_DRIVEN));
-			cyclePeriod.setEnabled(btnCycle.getSelection());
-		} catch (CoreException e) {
-			e.printStackTrace();
-		}
-	}
-
-	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
-		configuration.setAttribute(FILE_NAME, modelfile.getText());
-		configuration.setAttribute(OPERATION_CLASS, operationClass.getText());
-		if (isCyclePeriodValid()) {
-			configuration.setAttribute(CYCLE_PERIOD, getCyclePeriod());
-		}
-		configuration.setAttribute(IS_CYCLE_BASED, btnCycle.getSelection());
-		configuration.setAttribute(IS_EVENT_DRIVEN, btnEvent.getSelection());
-	}
-
-	private int getCyclePeriod() {
-		return Integer.parseInt(cyclePeriod.getText());
-	}
-
-	public String getName() {
-		return "Main";
-	}
-
-	@Override
-	public Image getImage() {
-		return SimulationImages.LAUNCHER_ICON.image();
-	}
-
-	protected Set<String> getOperationClasses() {
-		String operationClasses = this.operationClass.getText();
-		Set<String> result = new HashSet<String>();
-		if (operationClasses.trim().length() > 0) {
-			String[] split = operationClasses.split(",");
-			for (String string : split) {
-				result.add(string.trim());
-			}
-		}
-		return result;
-	}
-
-	@Override
-	public boolean isValid(ILaunchConfiguration launchConfig) {
-		setMessage(null);
-		setErrorMessage(null);
-		String model = this.modelfile.getText().trim();
-		if (model.length() > 0)
-			if (ResourcesPlugin.getWorkspace().getRoot().findMember(model) == null) {
-				setErrorMessage("file " + model + " does not exist!");
-				return false;
-			}
-		String cyclePeriod = this.cyclePeriod.getText();
-		if (cyclePeriod.length() == 0) {
-			setErrorMessage("Empty cycle period!");
-			return false;
-		} else if (!isCyclePeriodValid()) {
-			setErrorMessage("Cycle Period must be a number!");
-			return false;
-		}
-		Set<String> operationClasses = getOperationClasses();
-		if (operationClasses.size() > 0) {
-			for (String clazz : operationClasses) {
-				// check if class exists
-				IProject project = ResourcesPlugin.getWorkspace().getRoot().findMember(model).getProject();
-				if (project != null) {
-					ClassLoader classLoader = new WorkspaceClassLoaderFactory().createClassLoader(project, getClass()
-							.getClassLoader());
-					try {
-						Class<?> loadClass = classLoader.loadClass(clazz);
-						loadClass.newInstance();
-					} catch (ClassNotFoundException e) {
-						setErrorMessage("Class " + clazz + " not found in project " + project.getName() + "!");
-						return false;
-					} catch (InstantiationException e) {
-						setErrorMessage("Could not instantiate class " + clazz
-								+ "! (No default constructor available?) ");
-						return false;
-					} catch (IllegalAccessException e) {
-						setErrorMessage("Could not access class constructor for class" + clazz + "!");
-						return false;
-					}catch(Throwable t){
-						setErrorMessage(t.getMessage());
-						return false;
-					}
-				}
-			}
-		}
-		// check for default c'tor
-		return super.isValid(launchConfig);
-	}
-
-	private boolean isCyclePeriodValid() {
-		try {
-			getCyclePeriod();
-		} catch (NumberFormatException ex) {
-			return false;
-		}
-		return true;
-	}
-	
-	
-	
-
-	@Override
-	public String getId() {
-		return LAUNCH_TAB_ID;
-	}
-
-
-
-
-	private class EnableStateListener implements Listener {
-		public void handleEvent(Event event) {
-			cyclePeriod.setEnabled(btnCycle.getSelection());
-		}
-	}
-
-	private class UpdateListener implements Listener {
-
-		public void handleEvent(Event event) {
-			StatechartLaunchConfigurationTab.this.updateLaunchConfigurationDialog();
-		}
-
-	}
-
-}
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.simulation.ui.sexec.launch.tabs;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchTab;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ResourceListSelectionDialog;
+import org.yakindu.sct.commons.WorkspaceClassLoaderFactory;
+import org.yakindu.sct.simulation.core.sexec.launch.ISCTLaunchParameters;
+import org.yakindu.sct.simulation.ui.SimulationImages;
+
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class StatechartLaunchConfigurationTab extends JavaLaunchTab implements ISCTLaunchParameters {
+
+
+	public static final String LAUNCH_TAB_ID = "org.yakindu.sct.simulation.sexec.launchTab";
+	
+	
+	private Text modelfile;
+	private Text cyclePeriod;
+	private Text operationClass;
+	private Button btnCycle;
+	private Button btnEvent;
+
+	public void createControl(Composite parent) {
+		Composite comp = new Composite(parent, SWT.NONE);
+		setControl(comp);
+		comp.setLayout(new GridLayout(1, true));
+		createFileSelectionGroup(comp);
+		new Label(comp, SWT.NONE);
+	}
+
+	private void createFileSelectionGroup(Composite comp) {
+		createModelFileGroup(comp);
+		createOperationClassGroup(comp);
+		createExecutionTypeControls(comp);
+		createCyclePeriodGroup(comp);
+	}
+
+	private void createOperationClassGroup(Composite parent) {
+		Group propertyGroup = new Group(parent, SWT.NONE);
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(propertyGroup);
+		propertyGroup.setText("Operation class:");
+		propertyGroup.setLayout(new GridLayout(1, false));
+		operationClass = new Text(propertyGroup, SWT.BORDER);
+		operationClass.addListener(SWT.Modify, new UpdateListener());
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(operationClass);
+	}
+
+	private void createExecutionTypeControls(Composite parent) {
+		Group propertyGroup = new Group(parent, SWT.NONE);
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(propertyGroup);
+		propertyGroup.setText("Execution type:");
+		propertyGroup.setLayout(new GridLayout(1, true));
+		btnCycle = new Button(propertyGroup, SWT.RADIO);
+		btnCycle.setText("cycle-based");
+		btnCycle.addListener(SWT.Selection, new UpdateListener());
+		btnCycle.addListener(SWT.Selection, new EnableStateListener());
+		GridDataFactory.fillDefaults().applyTo(btnCycle);
+		btnEvent = new Button(propertyGroup, SWT.RADIO);
+		btnEvent.setText("event-driven");
+		btnEvent.addListener(SWT.Selection, new UpdateListener());
+		btnCycle.addListener(SWT.Selection, new EnableStateListener());
+		GridDataFactory.fillDefaults().applyTo(btnEvent);
+	}
+
+	private void createCyclePeriodGroup(Composite parent) {
+		Group propertyGroup = new Group(parent, SWT.NONE);
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(propertyGroup);
+		propertyGroup.setText("Cycle period:");
+		propertyGroup.setLayout(new GridLayout(2, false));
+		cyclePeriod = new Text(propertyGroup, SWT.BORDER);
+		cyclePeriod.addListener(SWT.Modify, new UpdateListener());
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(cyclePeriod);
+		Label lblMs = new Label(propertyGroup, SWT.NONE);
+		lblMs.setText("ms");
+		GridDataFactory.fillDefaults().applyTo(lblMs);
+	}
+
+	private void createModelFileGroup(Composite comp) {
+		Group fileGroup = new Group(comp, SWT.NONE);
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(fileGroup);
+		fileGroup.setText("Model file:");
+		fileGroup.setLayout(new GridLayout(2, false));
+
+		modelfile = new Text(fileGroup, SWT.BORDER);
+		modelfile.addListener(SWT.Modify, new UpdateListener());
+		GridDataFactory.fillDefaults().grab(true, false).applyTo(modelfile);
+
+		Button browse = new Button(fileGroup, SWT.NONE);
+		browse.setText("Search");
+		browse.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(getShell(),
+						getStatechartResources()) {
+					@Override
+					protected String adjustPattern() {
+						String pattern = super.adjustPattern();
+						if (pattern.equals("")) {
+							return "*";
+						}
+						return pattern;
+					}
+				};
+				dialog.setTitle("Select Statechart model");
+				dialog.setMessage("Please select the YAKINDU statechart model file you want to execute.");
+				if (dialog.open() == 0) {
+					Object[] files = dialog.getResult();
+					IFile file = (IFile) files[0];
+					modelfile.setText((file.getFullPath().toString()));
+				}
+			}
+
+			private IResource[] getStatechartResources() {
+				final List<IResource> resources = new ArrayList<IResource>();
+				try {
+					ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() {
+						public boolean visit(IResource resource) throws CoreException {
+							if ("sct".equalsIgnoreCase(resource.getFileExtension())) {
+								resources.add(resource);
+							}
+							return true;
+						}
+					});
+				} catch (CoreException e) {
+					e.printStackTrace();
+				}
+				return resources.toArray(new IResource[0]);
+			}
+		});
+		GridDataFactory.fillDefaults().applyTo(browse);
+	}
+
+	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+	}
+
+	public void initializeFrom(ILaunchConfiguration configuration) {
+		try {
+			modelfile.setText(configuration.getAttribute(FILE_NAME, DEFAULT_FILE_NAME));
+			operationClass.setText(configuration.getAttribute(OPERATION_CLASS, DEFAULT_OPERATION_CLASS));
+			cyclePeriod.setText(String.valueOf(configuration.getAttribute(CYCLE_PERIOD, DEFAULT_CYCLE_PERIOD)));
+			btnCycle.setSelection(configuration.getAttribute(IS_CYCLE_BASED, DEFAULT_IS_CYCLE_BASED));
+			btnEvent.setSelection(configuration.getAttribute(IS_EVENT_DRIVEN, DEFAULT_IS_EVENT_DRIVEN));
+			cyclePeriod.setEnabled(btnCycle.getSelection());
+		} catch (CoreException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+		configuration.setAttribute(FILE_NAME, modelfile.getText());
+		configuration.setAttribute(OPERATION_CLASS, operationClass.getText());
+		if (isCyclePeriodValid()) {
+			configuration.setAttribute(CYCLE_PERIOD, getCyclePeriod());
+		}
+		configuration.setAttribute(IS_CYCLE_BASED, btnCycle.getSelection());
+		configuration.setAttribute(IS_EVENT_DRIVEN, btnEvent.getSelection());
+	}
+
+	private int getCyclePeriod() {
+		return Integer.parseInt(cyclePeriod.getText());
+	}
+
+	public String getName() {
+		return "Main";
+	}
+
+	@Override
+	public Image getImage() {
+		return SimulationImages.LAUNCHER_ICON.image();
+	}
+
+	protected Set<String> getOperationClasses() {
+		String operationClasses = this.operationClass.getText();
+		Set<String> result = new HashSet<String>();
+		if (operationClasses.trim().length() > 0) {
+			String[] split = operationClasses.split(",");
+			for (String string : split) {
+				result.add(string.trim());
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public boolean isValid(ILaunchConfiguration launchConfig) {
+		setMessage(null);
+		setErrorMessage(null);
+		String model = this.modelfile.getText().trim();
+		if (model.length() > 0)
+			if (ResourcesPlugin.getWorkspace().getRoot().findMember(model) == null) {
+				setErrorMessage("file " + model + " does not exist!");
+				return false;
+			}
+		String cyclePeriod = this.cyclePeriod.getText();
+		if (cyclePeriod.length() == 0) {
+			setErrorMessage("Empty cycle period!");
+			return false;
+		} else if (!isCyclePeriodValid()) {
+			setErrorMessage("Cycle Period must be a number!");
+			return false;
+		}
+		Set<String> operationClasses = getOperationClasses();
+		if (operationClasses.size() > 0) {
+			for (String clazz : operationClasses) {
+				// check if class exists
+				IProject project = ResourcesPlugin.getWorkspace().getRoot().findMember(model).getProject();
+				if (project != null) {
+					ClassLoader classLoader = new WorkspaceClassLoaderFactory().createClassLoader(project, getClass()
+							.getClassLoader());
+					try {
+						Class<?> loadClass = classLoader.loadClass(clazz);
+						loadClass.newInstance();
+					} catch (ClassNotFoundException e) {
+						setErrorMessage("Class " + clazz + " not found in project " + project.getName() + "!");
+						return false;
+					} catch (InstantiationException e) {
+						setErrorMessage("Could not instantiate class " + clazz
+								+ "! (No default constructor available?) ");
+						return false;
+					} catch (IllegalAccessException e) {
+						setErrorMessage("Could not access class constructor for class" + clazz + "!");
+						return false;
+					}catch(Throwable t){
+						setErrorMessage(t.getMessage());
+						return false;
+					}
+				}
+			}
+		}
+		// check for default c'tor
+		return super.isValid(launchConfig);
+	}
+
+	private boolean isCyclePeriodValid() {
+		try {
+			getCyclePeriod();
+		} catch (NumberFormatException ex) {
+			return false;
+		}
+		return true;
+	}
+	
+	
+	
+
+	@Override
+	public String getId() {
+		return LAUNCH_TAB_ID;
+	}
+
+
+
+
+	private class EnableStateListener implements Listener {
+		public void handleEvent(Event event) {
+			cyclePeriod.setEnabled(btnCycle.getSelection());
+		}
+	}
+
+	private class UpdateListener implements Listener {
+
+		public void handleEvent(Event event) {
+			StatechartLaunchConfigurationTab.this.updateLaunchConfigurationDialog();
+		}
+
+	}
+
+}

+ 109 - 109
plugins/org.yakindu.sct.simulation.ui/plugin.xml

@@ -1,109 +1,109 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-	<!-- Editor Highlighting Adapter -->
-   <extension
-         point="org.eclipse.core.runtime.adapters">
-      <factory
-            adaptableType="org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor"
-            class="org.yakindu.sct.simulation.ui.model.presenter.IHighlightingSupportAdapterFactory">
-         <adapter
-               type="org.yakindu.base.gmf.runtime.highlighting.IHighlightingSupport">
-         </adapter>
-      </factory>
-   </extension>
-	
-<!-- Session Listener -->
- <extension
-       point="org.eclipse.ui.views">
-    <category 
-           id="org.yakindu.sct.category"
-           name="YAKINDU SCT"/>
-    <view
-    	  category="org.yakindu.sct.category"
-          allowMultiple="false"
-          class="org.yakindu.sct.simulation.ui.view.SimulationView"
-          icon="icons/Declarations-View-16.gif"
-          id="org.yakindu.sct.simulation.ui.declarationview"
-          name="Simulation View"
-          restorable="true">
-    </view>
- </extension>
- <extension
-       point="org.eclipse.debug.core.statusHandlers">
-    <statusHandler
-          class="org.yakindu.sct.simulation.ui.handler.GenericStatusHandler"
-          code="200"
-          id="org.yakindu.sct.simulation.ui.statushandler"
-          plugin="org.yakindu.sct.simulation.core">
-    </statusHandler>
- </extension>
-  <extension
-       point="org.eclipse.debug.core.statusHandlers">
-    <statusHandler
-          class="org.yakindu.sct.simulation.ui.handler.TerminateLaunchStatusHandler"
-          code="765"
-          id="org.yakindu.sct.simulation.ui.statushandler"
-          plugin="org.yakindu.sct.simulation.core">
-    </statusHandler>
- </extension>
- 
- <!-- Source Display Adapter factory -->
- <extension
-       point="org.eclipse.core.runtime.adapters">
-    <factory
-          adaptableType="org.yakindu.sct.simulation.core.debugmodel.SCTStackFrame"
-          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
-       <adapter
-             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
-       </adapter>
-    </factory>
-     <factory
-          adaptableType="org.yakindu.sct.simulation.core.debugmodel.SCTDebugThread"
-          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
-       <adapter
-             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
-       </adapter>
-    </factory>
-     <factory
-          adaptableType="org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget"
-          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
-       <adapter
-             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
-       </adapter>
-    </factory>
-     <factory
-          adaptableType="org.eclipse.debug.core.Launch"
-          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
-       <adapter
-             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
-       </adapter>
-    </factory>
- </extension>
- <extension
-       point="org.eclipse.ui.preferencePages">
-    <page
-          class="org.yakindu.sct.simulation.ui.preferences.SimulationPreferencePage"
-          id="org.yakindu.sct.simulation.ui.preferences.SimulationPreferencePage"
-          name="Simulation"
-          category="org.yakindu.sct.ui.preferences.root">
-    </page>
- </extension>
- <extension
-       point="org.eclipse.core.runtime.preferences">
-    <initializer
-          class="org.yakindu.sct.simulation.ui.preferences.PreferenceInitializer">
-    </initializer>
- </extension>
- <extension
-       point="org.eclipse.ui.startup">
-    <startup
-          class="org.yakindu.sct.simulation.ui.SimulationActivator"></startup>
- </extension>
-    <!-- Decoration Providers -->
-   <extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders"> 
-		<decoratorProvider class="org.yakindu.sct.simulation.ui.view.decorator.HighlightingSubmachineDecorationProvider"> 
-			<Priority name="Medium" />
- 		</decoratorProvider> 
- </extension> 
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+	<!-- Editor Highlighting Adapter -->
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor"
+            class="org.yakindu.sct.simulation.ui.model.presenter.IHighlightingSupportAdapterFactory">
+         <adapter
+               type="org.yakindu.base.gmf.runtime.highlighting.IHighlightingSupport">
+         </adapter>
+      </factory>
+   </extension>
+	
+<!-- Session Listener -->
+ <extension
+       point="org.eclipse.ui.views">
+    <category 
+           id="org.yakindu.sct.category"
+           name="YAKINDU SCT"/>
+    <view
+    	  category="org.yakindu.sct.category"
+          allowMultiple="false"
+          class="org.yakindu.sct.simulation.ui.view.SimulationView"
+          icon="icons/Declarations-View-16.gif"
+          id="org.yakindu.sct.simulation.ui.declarationview"
+          name="Simulation"
+          restorable="true">
+    </view>
+ </extension>
+ <extension
+       point="org.eclipse.debug.core.statusHandlers">
+    <statusHandler
+          class="org.yakindu.sct.simulation.ui.handler.GenericStatusHandler"
+          code="200"
+          id="org.yakindu.sct.simulation.ui.statushandler"
+          plugin="org.yakindu.sct.simulation.core">
+    </statusHandler>
+ </extension>
+  <extension
+       point="org.eclipse.debug.core.statusHandlers">
+    <statusHandler
+          class="org.yakindu.sct.simulation.ui.handler.TerminateLaunchStatusHandler"
+          code="765"
+          id="org.yakindu.sct.simulation.ui.statushandler"
+          plugin="org.yakindu.sct.simulation.core">
+    </statusHandler>
+ </extension>
+ 
+ <!-- Source Display Adapter factory -->
+ <extension
+       point="org.eclipse.core.runtime.adapters">
+    <factory
+          adaptableType="org.yakindu.sct.simulation.core.debugmodel.SCTStackFrame"
+          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
+       <adapter
+             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
+       </adapter>
+    </factory>
+     <factory
+          adaptableType="org.yakindu.sct.simulation.core.debugmodel.SCTDebugThread"
+          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
+       <adapter
+             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
+       </adapter>
+    </factory>
+     <factory
+          adaptableType="org.yakindu.sct.simulation.core.debugmodel.SCTDebugTarget"
+          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
+       <adapter
+             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
+       </adapter>
+    </factory>
+     <factory
+          adaptableType="org.eclipse.debug.core.Launch"
+          class="org.yakindu.sct.simulation.ui.model.presenter.SCTSourceDisplayAdapterFactory">
+       <adapter
+             type="org.eclipse.debug.ui.sourcelookup.ISourceDisplay">
+       </adapter>
+    </factory>
+ </extension>
+ <extension
+       point="org.eclipse.ui.preferencePages">
+    <page
+          class="org.yakindu.sct.simulation.ui.preferences.SimulationPreferencePage"
+          id="org.yakindu.sct.simulation.ui.preferences.SimulationPreferencePage"
+          name="Simulation"
+          category="org.yakindu.sct.ui.preferences.root">
+    </page>
+ </extension>
+ <extension
+       point="org.eclipse.core.runtime.preferences">
+    <initializer
+          class="org.yakindu.sct.simulation.ui.preferences.PreferenceInitializer">
+    </initializer>
+ </extension>
+ <extension
+       point="org.eclipse.ui.startup">
+    <startup
+          class="org.yakindu.sct.simulation.ui.SimulationActivator"></startup>
+ </extension>
+    <!-- Decoration Providers -->
+   <extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders"> 
+		<decoratorProvider class="org.yakindu.sct.simulation.ui.view.decorator.HighlightingSubmachineDecorationProvider"> 
+			<Priority name="Medium" />
+ 		</decoratorProvider> 
+ </extension> 
+</plugin>

+ 1 - 1
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/wizards/DomainWizardPage.java

@@ -61,7 +61,7 @@ public class DomainWizardPage extends WizardPage {
 		GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
 		GridLayoutFactory.fillDefaults().applyTo(composite);
 		final Group domainSelectionGroup = new Group(composite, SWT.NONE);
-		domainSelectionGroup.setText("Select the Statechart domain:");
+		domainSelectionGroup.setText("Select the statechart domain:");
 
 		GridLayoutFactory.fillDefaults().numColumns(2).applyTo(domainSelectionGroup);
 		GridDataFactory.fillDefaults().grab(true, true).applyTo(domainSelectionGroup);