From 5c06c6cdc2484b498c9eb8bc5bd2d80755bee2e8 Mon Sep 17 00:00:00 2001
From: Andreas Wandinger <wandinger@fortiss.org>
Date: Fri, 25 May 2012 16:42:51 +0000
Subject: [PATCH] Removed Windows line encoding. refs 587

---
 .../kernel/ui/internal/views/LibraryView.java | 570 +++++++++---------
 .../views/LibraryViewDragSourceAdapter.java   | 104 ++--
 ...ableMultiPageEditorPageChangeListener.java |  68 +--
 3 files changed, 371 insertions(+), 371 deletions(-)

diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java
index 836975e2b..1f3cd5700 100644
--- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java
+++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java
@@ -1,285 +1,285 @@
-/*--------------------------------------------------------------------------+
-$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
-|                                                                          |
-| 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.ui.internal.views;
-
-import java.util.Set;
-
-import org.conqat.lib.commons.collections.IdentityHashSet;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.dialogs.FilteredTree;
-import org.eclipse.ui.dialogs.PatternFilter;
-import org.eclipse.ui.part.ViewPart;
-import org.fortiss.tooling.kernel.extension.data.Prototype;
-import org.fortiss.tooling.kernel.service.IPrototypeService;
-import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
-import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
-import org.fortiss.tooling.kernel.ui.internal.editor.ExtendableMultiPageEditor;
-import org.fortiss.tooling.kernel.ui.listener.ExtendableMultiPageEditorPageChangeListener;
-import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
-
-/**
- * {@link ViewPart} for the model element library view.
- * 
- * @author hoelzl
- * @author eder
- * @author $Author: hoelzl $
- * @version $Rev: 18709 $
- * @ConQAT.Rating GREEN Hash: BCCA1EB912DDAD468B639287D818733B
- */
-public class LibraryView extends ViewPart {
-
-	/** The viewer. */
-	private TreeViewer viewer;
-
-	/** Filter text field for the tree viewer. */
-	private FilteredTree filteredTree;
-
-	/** Current active {@link ExtendableMultiPageEditor}. */
-	private ExtendableMultiPageEditor activeBindingEditor = null;
-
-	/** Stores the editor activation listener. */
-	private EditorActivationListener editorActivationListener = new EditorActivationListener();
-
-	/** The container object used. */
-	private EObject containerObject = null;
-
-	/** The prototypes supported by the current editor. */
-	private Set<Prototype> supportedBaseClasses = new IdentityHashSet<Prototype>();
-
-	/** Listener for reacting to changes of the embedded editor. */
-	private final ExtendableMultiPageEditorPageChangeListener bindingEditorPageChangeListener = new ExtendableMultiPageEditorPageChangeListener() {
-		@Override
-		public void pageChanged() {
-			updateEditorFilters(activeBindingEditor.getActiveModelEditor());
-		}
-	};
-
-	/** {@inheritDoc} */
-	@Override
-	public void createPartControl(Composite parent) {
-		PatternFilter patternFilter = new PatternFilter();
-		patternFilter.setIncludeLeadingWildcard(true);
-
-		filteredTree = new FilteredTree(parent, SWT.SINGLE | SWT.H_SCROLL
-				| SWT.V_SCROLL, patternFilter, false);
-		viewer = filteredTree.getViewer();
-
-		viewer.setContentProvider(new LibraryTreeContentProvider());
-		viewer.setLabelProvider(new LibraryLabelProvider());
-
-		LibraryViewDragSourceAdapter dndAdapter = new LibraryViewDragSourceAdapter(
-				viewer);
-		viewer.addDragSupport(dndAdapter.getSupportedDNDOperations(),
-				new Transfer[] { dndAdapter.getPreferredTransfer() },
-				dndAdapter);
-
-		viewer.setInput(IPrototypeService.INSTANCE.getAllPrototypes().toArray());
-
-		viewer.addFilter(new LibraryViewerFilter());
-
-		getViewSite().setSelectionProvider(viewer);
-		getSite().getWorkbenchWindow().getPartService()
-				.addPartListener(editorActivationListener);
-	}
-
-	/** Switches to the given workbench editor part. */
-	private void switchWorkbenchEditor(IEditorPart editor) {
-		if (activeBindingEditor != null) {
-			activeBindingEditor
-					.removeBindingEditorListener(bindingEditorPageChangeListener);
-			activeBindingEditor = null;
-		}
-
-		if (editor instanceof ExtendableMultiPageEditor) {
-			activeBindingEditor = (ExtendableMultiPageEditor) editor;
-			activeBindingEditor
-					.addBindingEditorListener(bindingEditorPageChangeListener);
-			updateEditorFilters(activeBindingEditor.getActiveModelEditor());
-		} else if (editor != null) {
-			updateEditorFilters(editor);
-		}
-	}
-
-	/** Updates the filters according to the given editor. */
-	@SuppressWarnings("unchecked")
-	private void updateEditorFilters(IEditorPart editor) {
-		supportedBaseClasses.clear();
-		if (editor instanceof EditorBase
-				&& ((EditorBase<? extends EObject>) editor).enableLibraryView()) {
-			EditorBase<? extends EObject> editorBase = (EditorBase<? extends EObject>) editor;
-			containerObject = editorBase.getEditedObject();
-			for (Class<? extends EObject> clazz : editorBase
-					.getVisibleEObjectTypes()) {
-				supportedBaseClasses.addAll(IPrototypeService.INSTANCE
-						.getComposablePrototypes(clazz));
-			}
-		} else {
-			containerObject = null;
-		}
-
-		if (!viewer.getControl().isDisposed()) {
-			viewer.refresh();
-		}
-	}
-
-	/** {@inheritDoc} */
-	@Override
-	public void setFocus() {
-		viewer.getControl().setFocus();
-	}
-
-	/** The label provider used in the library view. */
-	private class LibraryLabelProvider extends LabelProvider {
-
-		/** {@inheritDoc} */
-		@Override
-		public String getText(Object element) {
-			if (element instanceof Prototype) {
-				Prototype prototype = (Prototype) element;
-				return prototype.getName();
-			}
-			return super.getText(element);
-
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public Image getImage(Object element) {
-			if (element instanceof Prototype) {
-				Prototype prototype = (Prototype) element;
-				// delegate to the model element handlers
-				IModelElementHandler<EObject> handler = IModelElementHandlerService.INSTANCE
-						.getModelElementHandler(prototype.getPrototype());
-				if (handler != null) {
-					return handler.getIcon();
-				}
-			}
-			return super.getImage(element);
-		}
-	}
-
-	/** The content provider used in the library view. */
-	private class LibraryTreeContentProvider implements ITreeContentProvider {
-
-		/** {@inheritDoc} */
-		@Override
-		public Object[] getElements(Object inputElement) {
-			if (inputElement instanceof Object[]) {
-				return (Object[]) inputElement;
-			}
-			return new Object[0];
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public void dispose() {
-			// ignore
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-			// ignore
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public Object[] getChildren(Object parentElement) {
-			return null;
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public Object getParent(Object element) {
-			return null;
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public boolean hasChildren(Object element) {
-			return false;
-		}
-	}
-
-	/** The filter used in the library view. */
-	private class LibraryViewerFilter extends ViewerFilter {
-
-		/** {@inheritDoc} */
-		@Override
-		public boolean select(Viewer viewer, Object parentElement,
-				Object element) {
-			if (containerObject == null || supportedBaseClasses.isEmpty()) {
-				return false;
-			}
-			return supportedBaseClasses.contains(element);
-		}
-	}
-
-	/** If an editor in a different Project is opened the Model is reinitialized */
-	private class EditorActivationListener implements IPartListener {
-
-		/**
-		 * Change the tree viewer content whenever workbench part changes.
-		 */
-		@Override
-		public void partActivated(IWorkbenchPart workbenchPart) {
-			if (!(workbenchPart instanceof IEditorPart)) {
-				return;
-			}
-
-			IEditorPart part = (IEditorPart) workbenchPart;
-			switchWorkbenchEditor(part);
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public void partBroughtToTop(IWorkbenchPart part) {
-			// to react on activated is enough
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public void partClosed(IWorkbenchPart part) {
-			// nothing to do
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public void partDeactivated(IWorkbenchPart part) {
-			// nothing to do
-		}
-
-		/** {@inheritDoc} */
-		@Override
-		public void partOpened(IWorkbenchPart part) {
-			// nothing to do
-		}
-	}
-}
+/*--------------------------------------------------------------------------+
+$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
+|                                                                          |
+| 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.ui.internal.views;
+
+import java.util.Set;
+
+import org.conqat.lib.commons.collections.IdentityHashSet;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.ui.part.ViewPart;
+import org.fortiss.tooling.kernel.extension.data.Prototype;
+import org.fortiss.tooling.kernel.service.IPrototypeService;
+import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
+import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
+import org.fortiss.tooling.kernel.ui.internal.editor.ExtendableMultiPageEditor;
+import org.fortiss.tooling.kernel.ui.listener.ExtendableMultiPageEditorPageChangeListener;
+import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
+
+/**
+ * {@link ViewPart} for the model element library view.
+ * 
+ * @author hoelzl
+ * @author eder
+ * @author $Author: hoelzl $
+ * @version $Rev: 18709 $
+ * @ConQAT.Rating GREEN Hash: BCCA1EB912DDAD468B639287D818733B
+ */
+public class LibraryView extends ViewPart {
+
+	/** The viewer. */
+	private TreeViewer viewer;
+
+	/** Filter text field for the tree viewer. */
+	private FilteredTree filteredTree;
+
+	/** Current active {@link ExtendableMultiPageEditor}. */
+	private ExtendableMultiPageEditor activeBindingEditor = null;
+
+	/** Stores the editor activation listener. */
+	private EditorActivationListener editorActivationListener = new EditorActivationListener();
+
+	/** The container object used. */
+	private EObject containerObject = null;
+
+	/** The prototypes supported by the current editor. */
+	private Set<Prototype> supportedBaseClasses = new IdentityHashSet<Prototype>();
+
+	/** Listener for reacting to changes of the embedded editor. */
+	private final ExtendableMultiPageEditorPageChangeListener bindingEditorPageChangeListener = new ExtendableMultiPageEditorPageChangeListener() {
+		@Override
+		public void pageChanged() {
+			updateEditorFilters(activeBindingEditor.getActiveModelEditor());
+		}
+	};
+
+	/** {@inheritDoc} */
+	@Override
+	public void createPartControl(Composite parent) {
+		PatternFilter patternFilter = new PatternFilter();
+		patternFilter.setIncludeLeadingWildcard(true);
+
+		filteredTree = new FilteredTree(parent, SWT.SINGLE | SWT.H_SCROLL
+				| SWT.V_SCROLL, patternFilter, false);
+		viewer = filteredTree.getViewer();
+
+		viewer.setContentProvider(new LibraryTreeContentProvider());
+		viewer.setLabelProvider(new LibraryLabelProvider());
+
+		LibraryViewDragSourceAdapter dndAdapter = new LibraryViewDragSourceAdapter(
+				viewer);
+		viewer.addDragSupport(dndAdapter.getSupportedDNDOperations(),
+				new Transfer[] { dndAdapter.getPreferredTransfer() },
+				dndAdapter);
+
+		viewer.setInput(IPrototypeService.INSTANCE.getAllPrototypes().toArray());
+
+		viewer.addFilter(new LibraryViewerFilter());
+
+		getViewSite().setSelectionProvider(viewer);
+		getSite().getWorkbenchWindow().getPartService()
+				.addPartListener(editorActivationListener);
+	}
+
+	/** Switches to the given workbench editor part. */
+	private void switchWorkbenchEditor(IEditorPart editor) {
+		if (activeBindingEditor != null) {
+			activeBindingEditor
+					.removeBindingEditorListener(bindingEditorPageChangeListener);
+			activeBindingEditor = null;
+		}
+
+		if (editor instanceof ExtendableMultiPageEditor) {
+			activeBindingEditor = (ExtendableMultiPageEditor) editor;
+			activeBindingEditor
+					.addBindingEditorListener(bindingEditorPageChangeListener);
+			updateEditorFilters(activeBindingEditor.getActiveModelEditor());
+		} else if (editor != null) {
+			updateEditorFilters(editor);
+		}
+	}
+
+	/** Updates the filters according to the given editor. */
+	@SuppressWarnings("unchecked")
+	private void updateEditorFilters(IEditorPart editor) {
+		supportedBaseClasses.clear();
+		if (editor instanceof EditorBase
+				&& ((EditorBase<? extends EObject>) editor).enableLibraryView()) {
+			EditorBase<? extends EObject> editorBase = (EditorBase<? extends EObject>) editor;
+			containerObject = editorBase.getEditedObject();
+			for (Class<? extends EObject> clazz : editorBase
+					.getVisibleEObjectTypes()) {
+				supportedBaseClasses.addAll(IPrototypeService.INSTANCE
+						.getComposablePrototypes(clazz));
+			}
+		} else {
+			containerObject = null;
+		}
+
+		if (!viewer.getControl().isDisposed()) {
+			viewer.refresh();
+		}
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public void setFocus() {
+		viewer.getControl().setFocus();
+	}
+
+	/** The label provider used in the library view. */
+	private class LibraryLabelProvider extends LabelProvider {
+
+		/** {@inheritDoc} */
+		@Override
+		public String getText(Object element) {
+			if (element instanceof Prototype) {
+				Prototype prototype = (Prototype) element;
+				return prototype.getName();
+			}
+			return super.getText(element);
+
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public Image getImage(Object element) {
+			if (element instanceof Prototype) {
+				Prototype prototype = (Prototype) element;
+				// delegate to the model element handlers
+				IModelElementHandler<EObject> handler = IModelElementHandlerService.INSTANCE
+						.getModelElementHandler(prototype.getPrototype());
+				if (handler != null) {
+					return handler.getIcon();
+				}
+			}
+			return super.getImage(element);
+		}
+	}
+
+	/** The content provider used in the library view. */
+	private class LibraryTreeContentProvider implements ITreeContentProvider {
+
+		/** {@inheritDoc} */
+		@Override
+		public Object[] getElements(Object inputElement) {
+			if (inputElement instanceof Object[]) {
+				return (Object[]) inputElement;
+			}
+			return new Object[0];
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public void dispose() {
+			// ignore
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+			// ignore
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public Object[] getChildren(Object parentElement) {
+			return null;
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public Object getParent(Object element) {
+			return null;
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public boolean hasChildren(Object element) {
+			return false;
+		}
+	}
+
+	/** The filter used in the library view. */
+	private class LibraryViewerFilter extends ViewerFilter {
+
+		/** {@inheritDoc} */
+		@Override
+		public boolean select(Viewer viewer, Object parentElement,
+				Object element) {
+			if (containerObject == null || supportedBaseClasses.isEmpty()) {
+				return false;
+			}
+			return supportedBaseClasses.contains(element);
+		}
+	}
+
+	/** If an editor in a different Project is opened the Model is reinitialized */
+	private class EditorActivationListener implements IPartListener {
+
+		/**
+		 * Change the tree viewer content whenever workbench part changes.
+		 */
+		@Override
+		public void partActivated(IWorkbenchPart workbenchPart) {
+			if (!(workbenchPart instanceof IEditorPart)) {
+				return;
+			}
+
+			IEditorPart part = (IEditorPart) workbenchPart;
+			switchWorkbenchEditor(part);
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public void partBroughtToTop(IWorkbenchPart part) {
+			// to react on activated is enough
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public void partClosed(IWorkbenchPart part) {
+			// nothing to do
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public void partDeactivated(IWorkbenchPart part) {
+			// nothing to do
+		}
+
+		/** {@inheritDoc} */
+		@Override
+		public void partOpened(IWorkbenchPart part) {
+			// nothing to do
+		}
+	}
+}
diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryViewDragSourceAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryViewDragSourceAdapter.java
index 9472ff0b2..f62195879 100644
--- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryViewDragSourceAdapter.java
+++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryViewDragSourceAdapter.java
@@ -1,52 +1,52 @@
-/*--------------------------------------------------------------------------+
-$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
-|                                                                          |
-| 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.ui.internal.views;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.fortiss.tooling.kernel.extension.data.Prototype;
-import org.fortiss.tooling.kernel.ui.dnd.ElementCompositionDragSourceAdapter;
-
-/**
- * Drag and drop support for {@link LibraryView}.
- * 
- * @author eder
- * @author $Author: hoelzl $
- * @version $Rev: 18709 $
- * @ConQAT.Rating GREEN Hash: C27A60ED7A9CF15253ED52862AACC49F
- */
-public class LibraryViewDragSourceAdapter extends
-		ElementCompositionDragSourceAdapter {
-
-	/** Library tree viewer */
-	private final TreeViewer libraryViewer;
-
-	/** Constructor */
-	public LibraryViewDragSourceAdapter(TreeViewer libraryViewer) {
-		this.libraryViewer = libraryViewer;
-	}
-
-	/** {@inheritDoc} */
-	@Override
-	protected EObject getSourceElement() {
-		IStructuredSelection sel = (IStructuredSelection) libraryViewer
-				.getSelection();
-		return ((Prototype) sel.getFirstElement()).getPrototypeCopy();
-	}
-}
+/*--------------------------------------------------------------------------+
+$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
+|                                                                          |
+| 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.ui.internal.views;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.fortiss.tooling.kernel.extension.data.Prototype;
+import org.fortiss.tooling.kernel.ui.dnd.ElementCompositionDragSourceAdapter;
+
+/**
+ * Drag and drop support for {@link LibraryView}.
+ * 
+ * @author eder
+ * @author $Author: hoelzl $
+ * @version $Rev: 18709 $
+ * @ConQAT.Rating GREEN Hash: C27A60ED7A9CF15253ED52862AACC49F
+ */
+public class LibraryViewDragSourceAdapter extends
+		ElementCompositionDragSourceAdapter {
+
+	/** Library tree viewer */
+	private final TreeViewer libraryViewer;
+
+	/** Constructor */
+	public LibraryViewDragSourceAdapter(TreeViewer libraryViewer) {
+		this.libraryViewer = libraryViewer;
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	protected EObject getSourceElement() {
+		IStructuredSelection sel = (IStructuredSelection) libraryViewer
+				.getSelection();
+		return ((Prototype) sel.getFirstElement()).getPrototypeCopy();
+	}
+}
diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/listener/ExtendableMultiPageEditorPageChangeListener.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/listener/ExtendableMultiPageEditorPageChangeListener.java
index 43e818fd8..73d86ab54 100644
--- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/listener/ExtendableMultiPageEditorPageChangeListener.java
+++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/listener/ExtendableMultiPageEditorPageChangeListener.java
@@ -1,34 +1,34 @@
-/*--------------------------------------------------------------------------+
-$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
-|                                                                          |
-| 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.ui.listener;
-
-import org.fortiss.tooling.kernel.ui.internal.editor.ExtendableMultiPageEditor;
-
-/**
- * Listener for page changes of the {@link ExtendableMultiPageEditor}.
- * 
- * @author hoelzl
- * @author $Author: hoelzl $
- * @version $Rev: 18709 $
- * @ConQAT.Rating GREEN Hash: 91B289F5381A5A8C733F4A3E702E455D
- */
-public interface ExtendableMultiPageEditorPageChangeListener {
-
-	/** Indicates a page change. */
-	void pageChanged();
-}
+/*--------------------------------------------------------------------------+
+$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
+|                                                                          |
+| 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.ui.listener;
+
+import org.fortiss.tooling.kernel.ui.internal.editor.ExtendableMultiPageEditor;
+
+/**
+ * Listener for page changes of the {@link ExtendableMultiPageEditor}.
+ * 
+ * @author hoelzl
+ * @author $Author: hoelzl $
+ * @version $Rev: 18709 $
+ * @ConQAT.Rating GREEN Hash: 91B289F5381A5A8C733F4A3E702E455D
+ */
+public interface ExtendableMultiPageEditorPageChangeListener {
+
+	/** Indicates a page change. */
+	void pageChanged();
+}
-- 
GitLab