Browse Source

removed plugin generator.ui -> Execution action moved to genmodel.ui

Andreas Mülder 13 years ago
parent
commit
0e536cb9f6

+ 0 - 7
plugins/org.yakindu.sct.generator.ui/.classpath

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

+ 0 - 28
plugins/org.yakindu.sct.generator.ui/.project

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.yakindu.sct.generator.ui</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

+ 0 - 8
plugins/org.yakindu.sct.generator.ui/.settings/org.eclipse.jdt.core.prefs

@@ -1,8 +0,0 @@
-#Wed Nov 09 15:17:14 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5

+ 0 - 15
plugins/org.yakindu.sct.generator.ui/META-INF/MANIFEST.MF

@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Generator UI Plugin
-Bundle-SymbolicName: org.yakindu.sct.generator.ui;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.yakindu.sct.generator.ui.GeneratorUIActivator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources;bundle-version="3.7.100",
- org.eclipse.emf;bundle-version="2.6.0",
- org.eclipse.emf.ecore;bundle-version="2.7.0",
- org.yakindu.sct.model.sgen;bundle-version="1.0.0",
- org.yakindu.sct.generator.core;bundle-version="1.0.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5

+ 0 - 5
plugins/org.yakindu.sct.generator.ui/build.properties

@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml

+ 0 - 18
plugins/org.yakindu.sct.generator.ui/plugin.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-<extension point = "org.eclipse.ui.popupMenus">
-     <objectContribution
-        id="org.yakindu.sct.generator.ui"
-        objectClass="org.eclipse.core.resources.IFile"
-	    nameFilter="*.sgen">
-	    <action
-           class="org.yakindu.sct.generator.ui.action.GenerateModelAction"
-           enablesFor="1"
-           id="org.yakindu.sct.generator.ui.generateaction"
-           label="Generate Model"
-           menubarPath="additions">
-	    </action>
-	 </objectContribution>
-	</extension>
-</plugin>

+ 0 - 60
plugins/org.yakindu.sct.generator.ui/src/org/yakindu/sct/generator/ui/GeneratorUIActivator.java

@@ -1,60 +0,0 @@
-/**
- * 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.generator.ui;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class GeneratorUIActivator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "org.yakindu.sct.generator.ui"; //$NON-NLS-1$
-
-	// The shared instance
-	private static GeneratorUIActivator plugin;
-	
-	/**
-	 * The constructor
-	 */
-	public GeneratorUIActivator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static GeneratorUIActivator getDefault() {
-		return plugin;
-	}
-
-}

+ 0 - 108
plugins/org.yakindu.sct.generator.ui/src/org/yakindu/sct/generator/ui/action/GenerateModelAction.java

@@ -1,108 +0,0 @@
-/**
- * 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.generator.ui.action;
-
-import java.io.IOException;
-import java.util.Collections;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.Resource.Factory;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.yakindu.sct.generator.core.ISCTGenerator;
-import org.yakindu.sct.generator.core.extensions.GeneratorExtensions;
-import org.yakindu.sct.generator.core.extensions.GeneratorExtensions.GeneratorDescriptor;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgen.GeneratorModel;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class GenerateModelAction implements IObjectActionDelegate {
-
-	private ISelection selection;
-
-	public void run(IAction action) {
-		IFile file = unwrap();
-		URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(),
-				true);
-		Resource resource = loadResource(uri);
-		GeneratorModel model = (GeneratorModel) resource.getContents().get(0);
-		String generatorId = model.getGeneratorId();
-		GeneratorDescriptor description = GeneratorExtensions
-				.getGeneratorDescriptorForId(generatorId);
-		final ISCTGenerator generator = description.createGenerator();
-		final EList<GeneratorEntry> entries = model.getEntries();
-		Job generatorJob = new Job("Execute SCT Genmodel " + file.getName()) {
-
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				for (GeneratorEntry generatorEntry : entries) {
-					if (monitor.isCanceled()) {
-						break;
-					}
-					generator.generate(generatorEntry);
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		generatorJob.schedule();
-
-	}
-
-	protected static Resource loadResource(URI uri) {
-		Factory factory = ResourceFactoryRegistryImpl.INSTANCE.getFactory(uri);
-		ResourceSet resourceSet = new ResourceSetImpl();
-		Resource resource = factory.createResource(uri);
-		resourceSet.getResources().add(resource);
-		try {
-			resource.load(Collections.emptyMap());
-		} catch (IOException e) {
-			e.printStackTrace();
-			return null;
-		}
-		return resource;
-	}
-
-	private IFile unwrap() {
-		if (selection instanceof StructuredSelection) {
-			Object firstElement = ((StructuredSelection) selection)
-					.getFirstElement();
-			if (firstElement instanceof IFile) {
-				return (IFile) firstElement;
-			}
-		}
-		return null;
-	}
-
-	public void selectionChanged(IAction action, ISelection selection) {
-		this.selection = selection;
-	}
-
-	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
-	}
-
-}