Math2mat

/home/ythoma/docs/math2mat/svn/wp1/framework/m2mGUI/src/m2m/frontend/actions/ViewDynamicStructure.java

Go to the documentation of this file.
00001 
00018 package m2m.frontend.actions;
00019 
00020 import org.eclipse.ui.IWorkbenchPage;
00021 import org.eclipse.ui.IWorkbenchWindow;
00022 import org.eclipse.ui.PlatformUI;
00023 
00024 
00025 import m2m.frontend.actions.M2MAction;
00026 import m2m.frontend.dynamicview.Model;
00027 import m2m.frontend.dynamicview.MyGraphicalEditor;
00028 import m2m.frontend.dynamicview.MyGraphicalProperty;
00029 
00030 public class ViewDynamicStructure extends M2MAction 
00031 {
00036         public ViewDynamicStructure(IWorkbenchWindow window, String label) {
00037                 super(window,label);
00038                 setId(ICommandIds.CMD_DYNAMICVIEW);
00039                 setActionDefinitionId(ICommandIds.CMD_DYNAMICVIEW);
00040         }
00041         
00042         
00046         public void run() 
00047         {       
00048                 if (!getEditor("Error","Select the tab with the code you want to transform in VHDL"))
00049                         return;
00050                 activateConsole();
00051                 
00052                 /* Show the dynamic view */
00053                 if(editor.getM2MProject().getStructTreatment().getTop() != null) {
00054                 try {       
00055                         editor.getM2MProject().getStructTreatment().setProject(editor.getM2MProject());
00056                         editor.setModel(new Model (editor.getM2MProject().getStructTreatment(), editor.getM2MProject()));                       
00057                         try {                  
00058                                 IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();     
00059                                 /* Creation of two editors */
00060                             page.showView(MyGraphicalEditor.ID);     
00061                             page.showView(MyGraphicalProperty.ID);   
00062                         } 
00063                         catch (Exception e) {
00064                             e.printStackTrace();
00065                         }
00066                 } 
00067                 catch (Exception e) 
00068                 {
00069                         System.out.println("Cannot launch the dynamic view!");
00070                 }
00071                 }
00072         else
00073                 System.out.println("Cannot launch the dynamic view! Please parse the octave code.");            
00074         }
00075 }
 All Classes Namespaces Files Functions Variables Enumerations