Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
#899 removed UI dependencies, removed Image from IGeneratorDescriptor
Browse files Browse the repository at this point in the history
Interface
  • Loading branch information
andreasmuelder committed Aug 12, 2016
1 parent bd66dcd commit c635b25
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 56 deletions.
13 changes: 4 additions & 9 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ Bundle-SymbolicName: org.yakindu.sct.generator.core;singleton:=true
Bundle-Version: 2.7.1.qualifier
Bundle-Activator: org.yakindu.sct.generator.core.GeneratorActivator
Bundle-Vendor: statecharts.org
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime;visibility:=reexport,
org.yakindu.sct.model.sexec;visibility:=reexport,
org.eclipse.core.resources;visibility:=reexport,
Require-Bundle: org.yakindu.sct.model.sexec;visibility:=reexport,
org.yakindu.sct.model.stext,
org.eclipse.jdt.core,
org.eclipse.jdt.launching,
org.eclipse.xtext.xbase,
org.yakindu.sct.model.sgen,
org.eclipse.core.expressions,
org.yakindu.base.types,
org.yakindu.sct.commons,
org.yakindu.sct.domain,
com.google.guava,
org.eclipse.emf.workspace
org.eclipse.emf.workspace,
org.eclipse.core.resources;visibility:=reexport,
org.eclipse.core.runtime;visibility:=reexport
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: org.yakindu.sct.generator.core,
Expand Down
16 changes: 10 additions & 6 deletions src/org/yakindu/sct/generator/core/GeneratorActivator.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
*/
package org.yakindu.sct.generator.core;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

/**
* The activator class controls the plug-in life cycle
*/
public class GeneratorActivator extends AbstractUIPlugin {
public class GeneratorActivator extends Plugin {

// The plug-in ID
public static final String PLUGIN_ID = "org.yakindu.sct.generator.core"; //$NON-NLS-1$

// The shared instance
private static GeneratorActivator plugin;
//Preference constant for automatic code generation
// Preference constant for automatic code generation
public static final String PREF_GENERATE_AUTOMATICALLY = "generate.automatically";

/**
* The constructor
*/
Expand All @@ -34,7 +34,9 @@ public GeneratorActivator() {

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
* BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
Expand All @@ -43,7 +45,9 @@ public void start(BundleContext context) throws Exception {

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
* BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Bundle;
import org.yakindu.sct.generator.core.ISCTGenerator;

Expand Down Expand Up @@ -49,7 +47,7 @@ private static class GeneratorDescriptor implements IGeneratorDescriptor {

private final IConfigurationElement configElement;

private Image image;
private URL image;

GeneratorDescriptor(IConfigurationElement configElement) {
this.configElement = configElement;
Expand Down Expand Up @@ -88,17 +86,15 @@ public String getName() {
}

@Override
public Image getImage() {
public URL getImagePath() {
if (image != null)
return image;
String path = configElement.getAttribute(ATTRIBUTE_ICON);
if (path == null)
return null;

Bundle extensionBundle = Platform.getBundle(configElement.getContributor().getName());
URL entry = extensionBundle.getEntry(path);
ImageDescriptor descriptor = ImageDescriptor.createFromURL(entry);
image = descriptor.createImage();
image = extensionBundle.getEntry(path);
return image;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
*/
package org.yakindu.sct.generator.core.extensions;

import java.net.URL;
import java.util.List;

import org.eclipse.swt.graphics.Image;
import org.yakindu.sct.generator.core.ISCTGenerator;

/**
*
* @author andreas muelder - Initial contribution and API
*
*/
public interface IGeneratorDescriptor {

ISCTGenerator createGenerator();
Expand All @@ -26,10 +30,7 @@ public interface IGeneratorDescriptor {

String getName();

/**
* may return null!!
*/
Image getImage();
URL getImagePath();

String getContentType();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
/**
* Copyright (c) 2016 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.core.extensions;

import org.eclipse.emf.common.util.URI;
import org.yakindu.sct.generator.core.library.IDefaultFeatureValueProvider;

/**
*
* @author andreas muelder - Initial contribution and API
*
*/
public interface ILibraryDescriptor {

URI getURI();
Expand Down

This file was deleted.

0 comments on commit c635b25

Please sign in to comment.