Go to the documentation of this file.00001 package com.generalrobotix.ui;
00002
00003 import java.lang.reflect.Constructor;
00004 import org.eclipse.swt.widgets.Composite;
00005 import org.eclipse.ui.part.ViewPart;
00006 import com.generalrobotix.ui.grxui.Activator;
00007
00008 public class GrxBaseViewPart extends ViewPart {
00009
00010 protected GrxBaseView v=null;
00011
00012
00013
00014 public GrxBaseView getGrxBaseView() {
00015 return v;
00016 }
00017
00018 public void createPartControl(Composite parent) {
00019 createView( GrxBaseView.class, "Base View", this, parent );
00020 }
00021
00022 public void createView(Class <?extends GrxBaseView> cls, String name, GrxBaseViewPart vp, Composite p ){
00023 Constructor<? extends GrxBaseView> c = null;
00024 Activator act = Activator.getDefault();
00025 if(act != null){
00026 try {
00027 c = cls.getConstructor(new Class[] { String.class, GrxPluginManager.class, GrxBaseViewPart.class, Composite.class });
00028 v = (GrxBaseView) c.newInstance(new Object[] { name, act.manager_, vp, p });
00029 if(v!=null)
00030 v.restoreProperties();
00031 } catch (Exception e) {
00032 e.printStackTrace();
00033 }
00034 }
00035 }
00036
00037 @Override
00038 public void setFocus() {}
00039
00040 public void dispose(){
00041 if(v!=null)
00042 v.shutdown();
00043 }
00044 }