src/main/java/xelfi/debugger/LocalsView.java
author Jaroslav Tulach <jaroslav.tulach@xelfi.cz>
Tue, 17 Jan 2017 21:12:37 +0100
branchDirtyFix
changeset 10 fe294d0f1297
parent 0 189280700bc7
permissions -rw-r--r--
Making the project compilable
     1 /**
     2  * LocalsView
     3  *
     4  * @author Roman Blazevic
     5  * @version 970208
     6  */
     7 
     8 package xelfi.debugger;
     9 
    10 import java.awt.*;
    11 import xelfi.top.TopLevel;
    12 import xelfi.top.TopDialog;
    13 
    14 //import symantec.tools.debug.*; // doesn't need TCP/IP
    15 
    16 /**
    17  * This is a view on the data given by the Debugger document.
    18  * It is a view on local variables of the currently executed method in the currently
    19  * debugged thread.
    20  */
    21 
    22 public class LocalsView extends TopDialog
    23 {
    24 	private Debugger document;
    25 	private List list;
    26 
    27 	static final int KEY_ENTER = 10;
    28 
    29 	static final int HINT_COMPLETE_UPDATE = 0;
    30 
    31 	/**
    32 	 * LocalsView constructor.
    33 	 *
    34 	 * debugger - the document for this view
    35 	 */
    36 	LocalsView(Debugger debugger)
    37 	{
    38 		super(TopLevel.getMenu(), false);
    39 		setTitle("Locals");
    40 		//super("Locals");
    41 		setBackground(Color.lightGray);
    42 
    43 		document = debugger;
    44 		list = new List();
    45 		add("Center", list);
    46 	}
    47 
    48 	/**
    49 	 * This method is called when the content of the view must be
    50 	 * updated.
    51 	 */
    52 	void update(int hint, int index)
    53 	{
    54 		if (!isVisible())
    55 			return;
    56 
    57 		if (hint != HINT_COMPLETE_UPDATE)
    58 		{
    59 			System.out.println("unsupported hint");
    60 			return;
    61 		}
    62 
    63 	}
    64 
    65 	/**
    66 	 * My show() implementation.
    67 	 */
    68 	public void show()
    69 	{
    70 		super.show();
    71 		list.requestFocus();
    72 		document.localsViewShown();
    73 	}
    74 }