diff options
Diffstat (limited to 'bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIViewPart.java')
-rw-r--r-- | bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIViewPart.java | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIViewPart.java b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIViewPart.java deleted file mode 100644 index 46a29f69..00000000 --- a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/parts/DIViewPart.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 BestSolution.at 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: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - ******************************************************************************/ -package org.eclipse.e4.tools.compat.parts; - -import org.eclipse.e4.core.contexts.ContextInjectionFactory; -import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.core.di.InjectionException; -import org.eclipse.e4.tools.compat.internal.PartHelper; -import org.eclipse.e4.ui.di.Focus; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IViewSite; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.part.ViewPart; - -public abstract class DIViewPart<C> extends ViewPart { - private IEclipseContext context; - private Class<C> clazz; - private C component; - - public DIViewPart(Class<C> clazz) { - this.clazz = clazz; - } - - @Override - public void init(IViewSite site) throws PartInitException { - super.init(site); - context = PartHelper.createPartContext(this); - - context.declareModifiable(IViewPart.class); - - context.set(IViewPart.class, this); - } - - @Override - public void createPartControl(Composite parent) { - component = PartHelper.creatComponent(parent, context, clazz, this); - } - - protected IEclipseContext getContext() { - return context; - } - - public C getComponent() { - return component; - } - - @Override - public void setFocus() { - try { - ContextInjectionFactory.invoke(component, Focus.class, context); - } catch (InjectionException e) { - // TODO: handle exception - } - } -}
\ No newline at end of file |