diff --git a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF index 882bdac3c7abe5378f49e4e0155d15854b1500d0..fd68a2c858208fdb4ed614d6cfeb7b6e2fe1ce65 100644 --- a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF +++ b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF @@ -15,7 +15,9 @@ Require-Bundle: org.eclipse.ui;visibility:=reexport, Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Export-Package: org.fortiss.tooling.kernel, + org.fortiss.tooling.kernel.base, org.fortiss.tooling.kernel.interfaces, org.fortiss.tooling.kernel.model, org.fortiss.tooling.kernel.model.impl, - org.fortiss.tooling.kernel.model.util + org.fortiss.tooling.kernel.model.util, + org.fortiss.tooling.kernel.services diff --git a/org.fortiss.tooling.kernel/trunk/icons/project.png b/org.fortiss.tooling.kernel/trunk/icons/project.png new file mode 100644 index 0000000000000000000000000000000000000000..87a02f12f5be5b4c6b7967723664178b592875c0 Binary files /dev/null and b/org.fortiss.tooling.kernel/trunk/icons/project.png differ diff --git a/org.fortiss.tooling.kernel/trunk/icons/unknown.png b/org.fortiss.tooling.kernel/trunk/icons/unknown.png new file mode 100644 index 0000000000000000000000000000000000000000..c0566b2742c049219c71ef4477baf97a36947abf Binary files /dev/null and b/org.fortiss.tooling.kernel/trunk/icons/unknown.png differ diff --git a/org.fortiss.tooling.kernel/trunk/plugin.xml b/org.fortiss.tooling.kernel/trunk/plugin.xml index 3dc4495721e8a08ff09ba54d3fbe13c72b431cbc..8d113b69498ade4f42e2ff222e81c4c1e1de9a33 100644 --- a/org.fortiss.tooling.kernel/trunk/plugin.xml +++ b/org.fortiss.tooling.kernel/trunk/plugin.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> + <extension-point id="modelElementHandler" name="Model Element Handler" schema="schema/modelElementHandler.exsd"/> <extension point="org.eclipse.ui.views"> <view @@ -13,10 +14,17 @@ <extension point="org.eclipse.emf.ecore.generated_package"> <package - class="org.fortiss.tooling.kernel.model.KernelPackage" + class="org.fortiss.tooling.kernel.model.FortissToolingKernelPackage" genModel="model/kernel.genmodel" uri="http://www.fortiss.org/tooling/kernel"> </package> </extension> + <extension + point="org.fortiss.tooling.kernel.modelElementHandler"> + <modelElementHandler + handler="org.fortiss.tooling.kernel.internal.handler.ECPProjectModelElementHandler" + modelElementClass="org.unicase.ecp.model.workSpaceModel.ECPProject"> + </modelElementHandler> + </extension> </plugin> diff --git a/org.fortiss.tooling.kernel/trunk/schema/modelElementHandler.exsd b/org.fortiss.tooling.kernel/trunk/schema/modelElementHandler.exsd new file mode 100644 index 0000000000000000000000000000000000000000..667ffd97e40091b3dfb9d4f0b0dad3dd66028fab --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/schema/modelElementHandler.exsd @@ -0,0 +1,112 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.fortiss.tooling.kernel" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appinfo> + <meta.schema plugin="org.fortiss.tooling.kernel" id="modelElementHandler" name="Model Element Handler"/> + </appinfo> + <documentation> + Extension point for model element handlers. + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appinfo> + <meta.element /> + </appinfo> + </annotation> + <complexType> + <sequence> + <element ref="modelElementHandler" minOccurs="1" maxOccurs="unbounded"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute translatable="true"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="modelElementHandler"> + <complexType> + <attribute name="modelElementClass" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.eclipse.emf.ecore.EObject"/> + </appinfo> + </annotation> + </attribute> + <attribute name="handler" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.fortiss.tooling.kernel.interfaces.IModelElementHandler"/> + </appinfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appinfo> + <meta.section type="since"/> + </appinfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="examples"/> + </appinfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="apiinfo"/> + </appinfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appinfo> + <meta.section type="implementation"/> + </appinfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java index 119eb71c2884405cfba9da6d3d510f73c97d5f99..3919bac2027ee9c49ce91d0fe39e3a8a8b0eb1b7 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java @@ -17,6 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.fortiss.tooling.kernel.internal.ServiceManager; import org.osgi.framework.BundleContext; @@ -64,4 +65,9 @@ public class ToolingKernelActivator extends AbstractUIPlugin { public static ToolingKernelActivator getDefault() { return plugin; } + + /** Returns image descriptor of the image in the kernel plugin. */ + public static ImageDescriptor getImageDescriptor(String iconPath) { + return imageDescriptorFromPlugin(PLUGIN_ID, iconPath); + } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/ModelElementHandlerBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/ModelElementHandlerBase.java new file mode 100644 index 0000000000000000000000000000000000000000..ee42b3b60cd3635d480e9b2e904988eea68145a1 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/ModelElementHandlerBase.java @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| Licensed under the Apache License, Version 2.0 (the "License"); | +| you may not use this file except in compliance with the License. | +| You may obtain a copy of the License at | +| | +| http://www.apache.org/licenses/LICENSE-2.0 | +| | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, | +| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | +| See the License for the specific language governing permissions and | +| limitations under the License. | ++--------------------------------------------------------------------------*/ +package org.fortiss.tooling.kernel.base; + +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.graphics.Image; +import org.fortiss.tooling.kernel.ToolingKernelActivator; +import org.fortiss.tooling.kernel.interfaces.IModelElementHandler; + +/** + * Base implementation for {@link IModelElementHandler}s. + * + * @author hoelzlf + * @author $Author$ + * @version $Rev$ + * @levd.rating RED Rev: + */ +public abstract class ModelElementHandlerBase<T extends EObject> implements + IModelElementHandler<T> { + + /** Stores the singleton of the icon image. */ + private Image iconImage; + + /** {@inheritDoc} */ + @Override + public String getDescription(T element) { + return ""; + } + + /** {@inheritDoc} */ + @Override + public final Image getIcon(T element) { + if (iconImage == null) { + ImageDescriptor descr = getImageDescriptor(); + if (descr != null) { + iconImage = descr.createImage(); + } + } + return iconImage; + } + + /** Returns image descriptor to be used as icon image. */ + protected ImageDescriptor getImageDescriptor() { + return ToolingKernelActivator.getImageDescriptor("icons/unknown.png"); + } + + /** {@inheritDoc} */ + @Override + public List<EObject> getSubnodes(T element) { + return Collections.emptyList(); + } + + /** {@inheritDoc} */ + @Override + public List<EObject> getConnectors(T element) { + return Collections.emptyList(); + } + + /** {@inheritDoc} */ + @Override + public List<EObject> getIncomingConnections(T element) { + return Collections.emptyList(); + } + + /** {@inheritDoc} */ + @Override + public List<EObject> getOutgoingConnections(T element) { + return Collections.emptyList(); + } + + /** {@inheritDoc} */ + @Override + public List<EObject> getSpecifications(T element) { + return Collections.emptyList(); + } +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IModelElementHandler.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IModelElementHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..b752acde165d2185731ebc3120adab5de462f413 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IModelElementHandler.java @@ -0,0 +1,59 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| Licensed under the Apache License, Version 2.0 (the "License"); | +| you may not use this file except in compliance with the License. | +| You may obtain a copy of the License at | +| | +| http://www.apache.org/licenses/LICENSE-2.0 | +| | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, | +| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | +| See the License for the specific language governing permissions and | +| limitations under the License. | ++--------------------------------------------------------------------------*/ +package org.fortiss.tooling.kernel.interfaces; + +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.swt.graphics.Image; + +/** + * A model element handler provides information about a specific type of model + * elements. + * + * @author hoelzlf + * @author $Author$ + * @version $Rev$ + * @levd.rating RED Rev: + */ +public interface IModelElementHandler<T extends EObject> { + + /** Returns the name of the model element (if any). */ + String getName(T element); + + /** Returns a description of the model element (if any). */ + String getDescription(T element); + + /** Returns the icon of the model element. */ + Image getIcon(T element); + + /** Returns all children acting as nodes. */ + List<EObject> getSubnodes(T element); + + /** Returns all children acting as connectors. */ + List<EObject> getConnectors(T element); + + /** Returns all connections entering this element. */ + List<EObject> getIncomingConnections(T element); + + /** Returns all connections leaving this element. */ + List<EObject> getOutgoingConnections(T element); + + /** Returns all children acting as a (visible) specification. */ + List<EObject> getSpecifications(T element); +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java index 4397eec693b4e68308336a0a6d0bc091896fe9b6..2b2d2b88147b9ec27cef5cab33502fbe229b1695 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.ICommandStackService; +import org.fortiss.tooling.kernel.services.ICommandStackService; /** * This class implements the {@link ICommandStackService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java index 874baa7d1f595648f42aaa1270674bf081b54b3f..3e0cc1375f8cf5b98ad528af3f02751f873180ed 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.ICompositorService; +import org.fortiss.tooling.kernel.services.ICompositorService; /** * This class implements the {@link ICompositorService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectorService.java index c8d19c6b32617bd9f5d02a9706c6816a7c1ebe23..b3cc2e1d1094ae7034972e7d0e7029300fb48969 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectorService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IConnectorService; +import org.fortiss.tooling.kernel.services.IConnectorService; /** * This class implements the {@link IConnectorService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java index 14ccc4ab21e46147ec20d8cd0eec26a91a7938b3..12c11d756043ea77d83b9d905f626455e6780fe3 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IConstraintService; +import org.fortiss.tooling.kernel.services.IConstraintService; /** * This class implements the {@link IConstraintService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ContextMenuService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ContextMenuService.java index 10d91c5e6c6e3521bc7a25ed578afc9b4e24f93b..d9945d0b08634efc6d162bcaab4fc9e9b438395b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ContextMenuService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ContextMenuService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IContextMenuService; +import org.fortiss.tooling.kernel.services.IContextMenuService; /** * This class implements the {@link IContextMenuService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/EditorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/EditorService.java index 4cf5d1cdad090e8e11f83fc07dbd88c25cdb11c3..ef889a25a574aa7cd8456557ab333d1ae5528c99 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/EditorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/EditorService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IEditorService; +import org.fortiss.tooling.kernel.services.IEditorService; /** * This class implements the {@link IEditorService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java index 905616250b53a365252130307ff47697998abf14..4b51efe14f8fa67cac12fbf577bd5823f7f3ce79 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IExecutionService; +import org.fortiss.tooling.kernel.services.IExecutionService; /** * This class implements the {@link IExecutionService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java index 5d78a11d192e99d50cf29c9104e85fe16e2d14ac..8da356cf4ae15928ca84b4393707816e40b7b295 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.ILibraryService; +import org.fortiss.tooling.kernel.services.ILibraryService; /** * This class implements the {@link ILibraryService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MarkerService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MarkerService.java index 3b4352f06d328f5ab7082b7110e1027aad3a2f61..f3ee9a0debd2ccee64eee9e2a2d79432e4d9bd24 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MarkerService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MarkerService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IMarkerService; +import org.fortiss.tooling.kernel.services.IMarkerService; /** * This class implements the {@link IMarkerService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ModelElementService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ModelElementService.java index 9baf1ae6d95b72fa07fcc8f592f8e4b3a367b062..dc0ff60be2fa9d1b4e96c2f44a3e475c3297bbc1 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ModelElementService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ModelElementService.java @@ -17,7 +17,18 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IModelElementService; +import java.util.HashMap; +import java.util.Map; + +import org.conqat.ide.commons.ui.extension.ExtensionPointUtils; +import org.conqat.ide.commons.ui.logging.LoggingUtils; +import org.conqat.lib.commons.reflect.ReflectionUtils; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.emf.ecore.EObject; +import org.fortiss.tooling.kernel.ToolingKernelActivator; +import org.fortiss.tooling.kernel.interfaces.IModelElementHandler; +import org.fortiss.tooling.kernel.services.IModelElementService; +import org.osgi.framework.Bundle; /** * This class implements the {@link IModelElementService} interface. @@ -29,4 +40,59 @@ import org.fortiss.tooling.kernel.interfaces.IModelElementService; */ public class ModelElementService implements IModelElementService { + /** The model element handler extension point ID. */ + private static final String HANDLER_EXTENSION_POINT_NAME = "org.fortiss.tooling.kernel.modelElementHandler"; + + /** The model element handler configuration element name. */ + private static final String HANDLER_CONFIGURATION_ELEMENT_NAME = "modelElementHandler"; + + /** Stores the model element handler for each model element class. */ + private Map<Class<?>, IModelElementHandler<EObject>> handlerMap; + + /** Constructor. */ + public ModelElementService() { + setupHandlerMap(); + } + + /** Initializes the handler map from plugin extensions. */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + private void setupHandlerMap() { + handlerMap = new HashMap<Class<?>, IModelElementHandler<EObject>>(); + for (IConfigurationElement ce : ExtensionPointUtils + .getConfigurationElements(HANDLER_EXTENSION_POINT_NAME, + HANDLER_CONFIGURATION_ELEMENT_NAME)) { + Bundle bundle = ExtensionPointUtils.getBundle(ce); + try { + Class<?> modelElementClass = ExtensionPointUtils.loadClass( + ce.getAttribute("modelElementClass"), bundle); + Class<?> handlerClass = ExtensionPointUtils.loadClass( + ce.getAttribute("handler"), bundle); + IModelElementHandler<EObject> handler = (IModelElementHandler) handlerClass + .getConstructor().newInstance(); + handlerMap.put(modelElementClass, handler); + } catch (Exception ex) { + LoggingUtils.error(ToolingKernelActivator.getDefault(), + ex.getMessage(), ex); + } + } + + } + + /** {@inheritDoc} */ + @Override + public IModelElementHandler<EObject> getModelElementHandler( + EObject modelElement) { + Class<? extends EObject> clazz = modelElement.getClass(); + IModelElementHandler<EObject> handler = handlerMap.get(clazz); + if (handler == null) { + handler = ReflectionUtils.performNearestClassLookup(clazz, + handlerMap); + if (handler == null) { + LoggingUtils.error(ToolingKernelActivator.getDefault(), + "No matching model element handler found for " + clazz, + null); + } + } + return handler; + } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MultiUserService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MultiUserService.java index 99e3bcc03c273d23ae00137ae4dd6d6cec507f47..08059515545c0168094ba76547ce3401783fafbd 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MultiUserService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MultiUserService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IMultiUserService; +import org.fortiss.tooling.kernel.services.IMultiUserService; /** * This class implements the {@link IMultiUserService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/NavigatorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/NavigatorService.java index e8f24f96b7484a964ceba66e9b4a07e08a1ca0d6..2b36fe1d62779e298a11e10952bda7c2eaa787c0 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/NavigatorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/NavigatorService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.INavigatorService; +import org.fortiss.tooling.kernel.services.INavigatorService; /** * This class implements the {@link INavigatorService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java index 63292f61207f48bba85835b8fb3cd6ae28e30e70..1231b3ea9123e16894811f37cd24505983c45224 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IPersistencyService; +import org.fortiss.tooling.kernel.services.IPersistencyService; /** * This class implements the {@link IPersistencyService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PropertiesService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PropertiesService.java index 845d213a78793b0c44ea24e14a581466a8cc3952..d5d8012b637cd367de3216c2b3e7935ca647e3a6 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PropertiesService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PropertiesService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IPropertiesService; +import org.fortiss.tooling.kernel.services.IPropertiesService; /** * This class implements the {@link IPropertiesService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java index 0701ebe5630d65423871c75258311e9ab187362f..6cd03d4304cd97456227acc2a1cd8efcef3a80b7 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.IPrototypeService; +import org.fortiss.tooling.kernel.services.IPrototypeService; /** * This class implements the {@link IPrototypeService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java index 1e7cfce275ac4a2d6b1a2e776dd0083b8e23ab98..22cf8bad0d60fb8b253b0a302c5834873c7d366d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java @@ -17,7 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; -import org.fortiss.tooling.kernel.interfaces.ITransformationService; +import org.fortiss.tooling.kernel.services.ITransformationService; /** * This class implements the {@link ITransformationService} interface. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/handler/ECPProjectModelElementHandler.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/handler/ECPProjectModelElementHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..3c5dfa14daca8a41f83e1a6dc30d9304b2657c8b --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/handler/ECPProjectModelElementHandler.java @@ -0,0 +1,71 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| Licensed under the Apache License, Version 2.0 (the "License"); | +| you may not use this file except in compliance with the License. | +| You may obtain a copy of the License at | +| | +| http://www.apache.org/licenses/LICENSE-2.0 | +| | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, | +| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | +| See the License for the specific language governing permissions and | +| limitations under the License. | ++--------------------------------------------------------------------------*/ +package org.fortiss.tooling.kernel.internal.handler; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.resource.ImageDescriptor; +import org.fortiss.tooling.kernel.ToolingKernelActivator; +import org.fortiss.tooling.kernel.base.ModelElementHandlerBase; +import org.fortiss.tooling.kernel.interfaces.IModelElementHandler; +import org.fortiss.tooling.kernel.model.IProjectRootElement; +import org.unicase.ecp.model.workSpaceModel.ECPProject; + +/** + * {@link IModelElementHandler} for {@link ECPProject}s. + * + * @author hoelzlf + * @author $Author$ + * @version $Rev$ + * @levd.rating RED Rev: + */ +public final class ECPProjectModelElementHandler extends + ModelElementHandlerBase<ECPProject> { + + /** {@inheritDoc} */ + @Override + public String getName(ECPProject element) { + return "Project"; + } + + /** {@inheritDoc} */ + @Override + public String getDescription(ECPProject element) { + return "EMFStore Project"; + } + + /** {@inheritDoc} */ + @Override + protected ImageDescriptor getImageDescriptor() { + return ToolingKernelActivator.getImageDescriptor("icons/project.png"); + } + + /** {@inheritDoc} */ + @Override + public List<EObject> getSubnodes(ECPProject element) { + List<EObject> projectRootElements = new ArrayList<EObject>(); + for (EObject pContent : element.eContents()) { + if (pContent instanceof IProjectRootElement) { + projectRootElements.add(pContent); + } + } + return projectRootElements; + } +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorTreeContentProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorTreeContentProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..fbe50590fafeb0b377906cf62e9ac5ed959d2dd6 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorTreeContentProvider.java @@ -0,0 +1,85 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| Licensed under the Apache License, Version 2.0 (the "License"); | +| you may not use this file except in compliance with the License. | +| You may obtain a copy of the License at | +| | +| http://www.apache.org/licenses/LICENSE-2.0 | +| | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, | +| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | +| See the License for the specific language governing permissions and | +| limitations under the License. | ++--------------------------------------------------------------------------*/ +package org.fortiss.tooling.kernel.internal.navigator; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.fortiss.tooling.kernel.interfaces.IModelElementHandler; +import org.fortiss.tooling.kernel.services.IModelElementService; +import org.unicase.ecp.model.workSpaceModel.ECPWorkspace; + +/** + * Content provider for the model navigator tree viewer. + * + * @author hoelzlf + * @author $Author$ + * @version $Rev$ + * @levd.rating RED Rev: + */ +public class NavigatorTreeContentProvider implements ITreeContentProvider { + + /** {@inheritDoc} */ + @Override + public Object[] getElements(Object inputElement) { + if (inputElement instanceof ECPWorkspace) { + return ((ECPWorkspace) inputElement).getProjects().toArray(); + } + return null; + } + + /** {@inheritDoc} */ + @Override + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof EObject) { + IModelElementHandler<EObject> handler = IModelElementService.INSTANCE + .getModelElementHandler((EObject) parentElement); + if (handler != null) { + return handler.getSubnodes((EObject) parentElement).toArray(); + } + } + return new Object[0]; + } + + /** {@inheritDoc} */ + @Override + public Object getParent(Object element) { + if (element instanceof EObject) { + return ((EObject) element).eContainer(); + } + return null; + } + + /** {@inheritDoc} */ + @Override + public boolean hasChildren(Object element) { + return getChildren(element).length > 0; + } + + /** {@inheritDoc} */ + @Override + public void dispose() { + // nothing to do + } + + /** {@inheritDoc} */ + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + // FIXME (FH): ignore? + } +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorTreeLabelProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorTreeLabelProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..04ddff01a8e891192400e8fef5a1bfb22c5fbca6 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorTreeLabelProvider.java @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| Licensed under the Apache License, Version 2.0 (the "License"); | +| you may not use this file except in compliance with the License. | +| You may obtain a copy of the License at | +| | +| http://www.apache.org/licenses/LICENSE-2.0 | +| | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, | +| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | +| See the License for the specific language governing permissions and | +| limitations under the License. | ++--------------------------------------------------------------------------*/ +package org.fortiss.tooling.kernel.internal.navigator; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.viewers.BaseLabelProvider; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.swt.graphics.Image; +import org.fortiss.tooling.kernel.interfaces.IModelElementHandler; +import org.fortiss.tooling.kernel.services.IModelElementService; + +/** + * {@link ILabelProvider} for the model navigator tree. + * + * @author hoelzlf + * @author $Author$ + * @version $Rev$ + * @levd.rating RED Rev: + */ +public final class NavigatorTreeLabelProvider extends BaseLabelProvider + implements ILabelProvider { + + /** {@inheritDoc} */ + @Override + public Image getImage(Object element) { + if (element instanceof EObject) { + IModelElementHandler<EObject> handler = IModelElementService.INSTANCE + .getModelElementHandler((EObject) element); + if (handler != null) { + return handler.getIcon((EObject) element); + } + } + return null; + } + + /** {@inheritDoc} */ + @Override + public String getText(Object element) { + if (element instanceof EObject) { + IModelElementHandler<EObject> handler = IModelElementService.INSTANCE + .getModelElementHandler((EObject) element); + if (handler != null) { + return handler.getName((EObject) element); + } + } + return ""; + } +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java index da858a3916edb9cd817f7c0c53ed68b81f4d1e3f..8eb9ee1c0609b31aa033b2fa6691bed13835cd08 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/navigator/NavigatorViewPart.java @@ -18,16 +18,27 @@ $Id$ package org.fortiss.tooling.kernel.internal.navigator; import org.conqat.ide.commons.ui.logging.LoggingUtils; +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.impl.AdapterImpl; +import org.eclipse.emf.ecore.EObject; import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.progress.UIJob; import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.unicase.ecp.model.ECPWorkspaceManager; import org.unicase.ecp.model.NoWorkspaceException; +import org.unicase.ecp.model.workSpaceModel.ECPProject; +import org.unicase.ecp.model.workSpaceModel.ECPProjectListener; import org.unicase.ecp.model.workSpaceModel.ECPWorkspace; +import org.unicase.ecp.model.workSpaceModel.WorkSpaceModelPackage; /** + * {@link ViewPart} of the model navigator provided by the tooling kernel. * * @author hoelzlf * @author $Author$ @@ -42,6 +53,12 @@ public final class NavigatorViewPart extends ViewPart { /** Stores the EmfStore workspace. */ private ECPWorkspace workspace; + /** Stores the workspace listener. */ + private AdapterImpl workspaceListener; + + /** Stores the project listener. */ + private ECPProjectListener projectListener; + /** Constructor. */ public NavigatorViewPart() { try { @@ -51,20 +68,94 @@ public final class NavigatorViewPart extends ViewPart { e.getMessage(), IStatus.ERROR, e); return; } + + createProjectListener(); + for (ECPProject project : workspace.getProjects()) { + project.addECPProjectListener(projectListener); + } + + createWorkspaceListener(); + workspace.eAdapters().add(workspaceListener); + } + + /** + * Creates the workspace listener, which registers the project listener on + * added projects. It also unregisters the project listener from removed + * projects. + */ + private void createWorkspaceListener() { + workspaceListener = new AdapterImpl() { + + @Override + public void notifyChanged(Notification msg) { + if ((msg.getFeatureID(ECPWorkspace.class)) == WorkSpaceModelPackage.ECP_WORKSPACE__PROJECTS) { + if (msg.getEventType() == Notification.ADD + && WorkSpaceModelPackage.eINSTANCE.getECPProject() + .isInstance(msg.getNewValue())) { + ECPProject projectSpace = (ECPProject) msg + .getNewValue(); + projectSpace.addECPProjectListener(projectListener); + } else if (msg.getEventType() == Notification.REMOVE + && WorkSpaceModelPackage.eINSTANCE.getECPProject() + .isInstance(msg.getOldValue())) { + ECPProject projectSpace = (ECPProject) msg + .getOldValue(); + projectSpace.removeECPProjectListener(projectListener); + } + } + super.notifyChanged(msg); + } + }; + } + + /** + * Creates the project listener, which refreshes the viewer upon any + * changes. + */ + private void createProjectListener() { + projectListener = new ECPProjectListener() { + @Override + public void projectDeleted() { + // ignore + } + + @Override + public void projectChanged() { + new UIJob("Update Model Navigator") { + + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + viewer.refresh(); + return Status.OK_STATUS; + } + }.schedule(); + } + + @Override + public void modelelementDeleted(EObject eobject) { + // ignore + } + }; } /** {@inheritDoc} */ @Override public void createPartControl(Composite parent) { - // TODO Auto-generated method stub + viewer = new TreeViewer(parent, SWT.MULTI); + + if (workspace != null) { + // TODO (FH): DecoratorManager + viewer.setLabelProvider(new NavigatorTreeLabelProvider()); + viewer.setContentProvider(new NavigatorTreeContentProvider()); + viewer.setInput(workspace); + } + // TODO (FH): SelectionProvider } /** {@inheritDoc} */ @Override public void setFocus() { - // TODO Auto-generated method stub - + viewer.getControl().setFocus(); } - } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ICommandStackService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ICommandStackService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ICommandStackService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ICommandStackService.java index 83db7e8bc8dd9b3da795ace4a7dc24370f66cb18..6f1451f61349a02e4e841e62d0b84d4bd9174e4d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ICommandStackService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ICommandStackService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.CommandStackService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ICompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ICompositorService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ICompositorService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ICompositorService.java index 08f2ccbc7e4637b075999c8f866aa3f145c3355e..8048dfb7a0b7fbca97ba5e104ba7ee551e73e153 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ICompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ICompositorService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.CompositorService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConnectorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConnectorService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConnectorService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConnectorService.java index 39d1b8fb2ac2ee7bc1dd138ce8bd2442178dd6b2..8a46e814b4145eb69963e5b5ca331952149c5ed2 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConnectorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConnectorService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.ConnectorService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java index 33ca2f17ff876011ce82af378d9d49792299c126..e42e4ce88b218e57d998ee06abeefbef57271ffb 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.ConstraintService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IContextMenuService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IContextMenuService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IContextMenuService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IContextMenuService.java index 09d7edd517cf1ad7816222b748d39f77ae971bb8..e5a94923e4c8c67308a1635d6f53c53b05813a6b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IContextMenuService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IContextMenuService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.ContextMenuService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IEditorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IEditorService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IEditorService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IEditorService.java index a378a095315e444cfbd03a5b5d9cb8e06c789a2b..84097c756a3324282036e839a4f78fbe60acb887 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IEditorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IEditorService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.EditorService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IExecutionService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IExecutionService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IExecutionService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IExecutionService.java index 1af907c54911fcdfe27d9a31662f3c6b89e831ba..31b2772f60b9f9a66f0bc7739788d5645fc63567 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IExecutionService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IExecutionService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.ExecutionService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ILibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ILibraryService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ILibraryService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ILibraryService.java index 53eda3d23ca883710acee13b2a4d9bd21268b53b..bfcaa70100f9ada3dbbca054b078891f246a3b75 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ILibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ILibraryService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.LibraryService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IMarkerService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IMarkerService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IMarkerService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IMarkerService.java index 6ec27d520eef7fbd345ced1710e843b1c9853cfb..17ac866309fbfab42fa6adc3b767346133a080dc 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IMarkerService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IMarkerService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.MarkerService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IModelElementService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IModelElementService.java similarity index 84% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IModelElementService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IModelElementService.java index 3f3b04c42ef0dfe7eacfa2c745a458fac3215a7d..5af9ac0d5b1f94d9e86e010b052948f6114d70a3 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IModelElementService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IModelElementService.java @@ -15,8 +15,10 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; +import org.eclipse.emf.ecore.EObject; +import org.fortiss.tooling.kernel.interfaces.IModelElementHandler; import org.fortiss.tooling.kernel.internal.ModelElementService; /** @@ -33,5 +35,6 @@ public interface IModelElementService { /** Returns the singleton instance of the service. */ public static final IModelElementService INSTANCE = new ModelElementService(); - // TODO (FH): define + /** Returns the model element handler for the given model element. */ + IModelElementHandler<EObject> getModelElementHandler(EObject modelElement); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IMultiUserService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IMultiUserService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IMultiUserService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IMultiUserService.java index c90a2befef7b7fa7822bc6436aa171e6afb7b540..d96acac024b1076f94dbfd93e01537a592f89892 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IMultiUserService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IMultiUserService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.MultiUserService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/INavigatorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/INavigatorService.java similarity index 89% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/INavigatorService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/INavigatorService.java index 2eb49f521bbb5b43869d7d222018cefeaadfcc46..abc85cd04e94662560a435f7e634a73d0b8376e5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/INavigatorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/INavigatorService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.NavigatorService; @@ -32,5 +32,8 @@ public interface INavigatorService { /** Returns the singleton instance of the service. */ public static final INavigatorService INSTANCE = new NavigatorService(); + /** Returns view id of the navigator view. */ + public static final String NAVIGATOR_VIEW = "org.fortiss.tooling.kernel.model.navigator"; + // TODO (FH): define } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPersistencyService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPersistencyService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPersistencyService.java index d86a569b12dd04f059728dc3c3e230523cdc06d3..6f90f1efcc83ed00e98283e4d55f80ac21af4da5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPersistencyService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.PersistencyService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPropertiesService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPropertiesService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPropertiesService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPropertiesService.java index e793c34a5465c811b23115f3368c418d2040a2ad..d5fdebf85a9931809277d7ee23f952c8674d13e3 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPropertiesService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPropertiesService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.PropertiesService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPrototypeService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPrototypeService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPrototypeService.java index a28b8a6c36903a32b0bbac2aec3f171062bb31d0..005450ca508a515748ddb7e5e5fd29e6ae3472e5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IPrototypeService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IPrototypeService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.PrototypeService; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITransformationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ITransformationService.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITransformationService.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ITransformationService.java index 9d4bae75e1f00f3ad6d1900d64bab05c4afb8be8..fd7cd862cf3fe21679a2d0d7eea7830c11c8c4fa 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITransformationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/ITransformationService.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.interfaces; +package org.fortiss.tooling.kernel.services; import org.fortiss.tooling.kernel.internal.TransformationService;