use of flash.tools.debugger.SwfInfo in project intellij-plugins by JetBrains.
the class DebugCLI method enableBreak.
/**
* Enable a breakpoint using the SourceFile as a template
* for the source file in which the breakpoint should be
* set.
*/
LocationCollection enableBreak(SourceFile f, int line) throws NotConnectedException {
LocationCollection col = new LocationCollection();
boolean singleSwfBreakpoint = m_fileInfo.isSwfFilterOn();
SwfInfo swf = m_fileInfo.getSwfFilter();
// set a breakpoint in a specific swf not all of them
try {
if (singleSwfBreakpoint) {
Location l = findAndEnableBreak(swf, f, line);
col.add(l);
} else {
// walk all swfs looking to add this breakpoint
SwfInfo[] swfs = m_fileInfo.getSwfs();
for (int i = 0; i < swfs.length; i++) {
swf = swfs[i];
if (swf != null) {
Location l = findAndEnableBreak(swf, f, line);
if (l != null)
col.add(l);
}
}
}
} catch (InProgressException ipe) {
if (Trace.error)
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Trace.trace(((swf == null) ? "SWF " : swf.getUrl()) + " still loading, breakpoint at " + f.getName() + ":" + line + " not set");
}
return col;
}
use of flash.tools.debugger.SwfInfo in project intellij-plugins by JetBrains.
the class DebugCLI method isMetaDataAvailable.
/**
* Ask each swf if metadata processing is complete
*/
public boolean isMetaDataAvailable() {
boolean allLoaded = true;
try {
// we need to ask the session since our fileinfocache will hide the exception
SwfInfo[] swfs = m_session.getSwfs();
for (int i = 0; i < swfs.length; i++) {
// check if our processing is finished.
SwfInfo swf = swfs[i];
if (swf != null && !swf.isProcessingComplete()) {
allLoaded = false;
break;
}
}
} catch (NoResponseException nre) {
// ok we still need to wait for player to read the swd in
allLoaded = false;
}
// count the number of times we checked and it wasn't there
if (!allLoaded) {
int count = propertyGet(METADATA_NOT_AVAILABLE);
count++;
propertyPut(METADATA_NOT_AVAILABLE, count);
} else {
// success so we reset our attempt counter
propertyPut(METADATA_ATTEMPTS, METADATA_RETRIES);
}
return allLoaded;
}
Aggregations