if (progressMonitor.isCanceled())
if (progressMonitor.isCanceled() || !PluginDebugManager.isDebugState())
public void run(){	DebugPlugin debugPlugin = PluginDebugManager.getDebugPlugin();		// all new (or deleted) filed are not updated	// if field has InspectableProperty.ALWAYS_VISIBLE visibility then is is monitored	// VAL fields is always registered	final String valFieldName = "VAL";		// count loop	int recordCount = 0;	Stack groupStack = new Stack();	groupStack.push(Group.getRoot());	while (!groupStack.isEmpty())	{		Group group = (Group)groupStack.pop();		Enumeration e = group.getSubObjectsV().elements();		while (e.hasMoreElements())		{			Object obj = e.nextElement();			if (obj instanceof Record)				recordCount++;			else if (obj instanceof Group)				groupStack.push(obj);		}	}	// connect loop	groupStack.push(Group.getRoot());	int progress = 0;	ProgressMonitor progressMonitor = new ProgressMonitor(VisualDCT.getInstance(),								"Connecting to PVs",								"Initializing...", 0, recordCount);	progressMonitor.setProgress(0);	while (!groupStack.isEmpty())	{		Group group = (Group)groupStack.pop();		Enumeration e = group.getSubObjectsV().elements();		while (e.hasMoreElements() && !progressMonitor.isCanceled())		{			Object obj = e.nextElement();			if (obj instanceof Record)			{				VDBRecordData rec = ((Record)obj).getRecordData();				Enumeration e2 = rec.getFieldsV().elements();				while (e2.hasMoreElements() && !progressMonitor.isCanceled())				{					VDBFieldData field = (VDBFieldData)e2.nextElement();											if (field.getVisibility() == InspectableProperty.ALWAYS_VISIBLE && !field.equals(valFieldName))					{						progressMonitor.setNote("Connecting to "+field.getFullName()+"...");						debugPlugin.registerMonitor(field);					}				}					if (progressMonitor.isCanceled())					break;					// always register VAL field				Debuggable valField = (Debuggable)rec.getField(valFieldName);				if (valField != null)				{					progressMonitor.setNote("Connecting to "+valField.getFullName()+"...");					debugPlugin.registerMonitor(valField);				}									}			else if (obj instanceof Group)				groupStack.push(obj);							progress++;			progressMonitor.setProgress(progress);						}	}					if (progressMonitor.isCanceled())	{		Console.getInstance().println("Debugging canceled.");		debugPlugin.deregisterAll();		debugPlugin.stopDebugging();		PluginDebugManager.setDebugState(false);		PluginDebugManager.setDebugPlugin(null);		Group.getRoot().unconditionalValidateSubObjects(false);	}	progressMonitor.close();	Group.getRoot().unconditionalValidateSubObjects(false);	DrawingSurface.getInstance().repaint();}