Ignore:
Timestamp:
03/13/06 17:03:22 (19 years ago)
Author:
boris
Message:
  • implemented folding/callapsing/hiding of class definitions in the modelica editor
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/wizards/NewClassWizard.java

    r290 r419  
    7676import org.eclipse.ui.INewWizard;
    7777import org.eclipse.ui.IWorkbench;
    78 import org.eclipse.ui.IWorkbenchPage;
    7978import org.eclipse.ui.PartInitException;
    80 import org.eclipse.ui.PlatformUI;
    81 import org.eclipse.ui.ide.IDE;
     79import org.modelica.mdt.core.IModelicaProject;
    8280import org.modelica.mdt.core.ModelicaCore;
     81import org.modelica.mdt.core.compiler.CompilerException;
    8382import org.modelica.mdt.internal.core.CorePlugin;
     83import org.modelica.mdt.internal.core.ErrorManager;
    8484import org.modelica.mdt.ui.ModelicaImages;
    8585import org.modelica.mdt.ui.UIPlugin;
     86import org.modelica.mdt.ui.editor.EditorUtility;
    8687
    8788public class NewClassWizard extends Wizard implements INewWizard
     
    419420            public void run()
    420421            {
    421                 IWorkbenchPage page =
    422                     PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    423422                try
    424423                {
    425                     IDE.openEditor(page, file, true);
     424                    /*
     425                     * find the modelica class reference object
     426                     * and open it in the editor
     427                     */
     428                    IModelicaProject proj =
     429                        ModelicaCore.getModelicaRoot().getProject(file.getProject().
     430                                getName());
     431                    EditorUtility.openInEditor
     432                        (proj.findElement(file.getProjectRelativePath()));
    426433                }
    427434                catch (PartInitException e)
     
    434441                                    file.getName(), e)));
    435442                }
     443                catch (CompilerException e)
     444                {
     445                    ErrorManager.showCompilerError(e);
     446                }
     447                catch (CoreException e)
     448                {
     449                    ErrorManager.showCoreError(e);
     450                }
     451
    436452            }
    437453        });
Note: See TracChangeset for help on using the changeset viewer.