source: trunk/org.modelica.mdt.ui/src/org/modelica/mdt/ui/view/ModelicaConsoleView.java

Last change on this file was 483, checked in by adrpo, 18 years ago

moving towards 0.7.0

  • a lot of changes
  • debugging support
  • better hovering
  • bug fixes
  • many more other stuff
File size: 1.6 KB
Line 
1/*
2 * This file is part of Modelica Development Tooling.
3 *
4 * Copyright (c) 2006, Adrian Pop, adrpo@ida.liu.se
5 *
6 * created Februrary 19, 2006
7 */
8
9package org.modelica.mdt.ui.view;
10
11import org.eclipse.jface.text.IDocument;
12import org.eclipse.swt.widgets.Composite;
13import org.eclipse.ui.part.*;
14import org.modelica.mdt.ui.UIPlugin;
15import org.modelica.mdt.ui.console.ModelicaTextConsole;
16import org.modelica.mdt.ui.console.ModelicaTextConsoleViewer;
17
18/**
19 * @author Adrian Pop
20 * The ModelicaConsole is used to display the Modelica compiler's output
21 * @see ViewPart
22 */
23public class ModelicaConsoleView extends ViewPart
24{
25
26    private ModelicaTextConsoleViewer viewer = null;
27    private ModelicaTextConsole console = null; 
28    public static final String ID = "org.modelica.mdt.ui.view.ModelicaConsoleView";
29
30    /**
31     * The constructor.
32     */
33    public ModelicaConsoleView() 
34    {       
35        console = UIPlugin.getDefault().getModelicaTextConsole();
36    }
37   
38    public IDocument getDocument() 
39    { 
40        return console.getDocument(); 
41    } 
42    public ModelicaTextConsole getConsole() 
43    { 
44        return console; 
45    } 
46   
47    public ModelicaTextConsoleViewer getViewer(Composite parent)
48    {
49        viewer = new ModelicaTextConsoleViewer(parent, console);
50        return viewer;
51    }
52
53    /**
54     * Insert the method's description here.
55     * @see ViewPart#createPartControl
56     */
57    public void createPartControl(Composite parent) 
58    {
59        viewer = getViewer(parent);
60        viewer.setDocument(getDocument());
61        viewer.setEditable(true);
62    }
63
64    /**
65     * Passing the focus request to the viewer's control.
66     */
67    public void setFocus() 
68    {
69        viewer.getControl().setFocus();
70    }
71
72}
73
Note: See TracBrowser for help on using the repository browser.