use of com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger in project convertigo by convertigo.
the class HtmlTransaction method applyUserEvents.
protected void applyUserEvents() throws EngineException {
HtmlConnector connector = (HtmlConnector) parent;
if (!runningThread.bContinue)
return;
try {
Document dom = null;
for (int i = 0; i < wcFields.size(); i++) {
AbstractEvent event = (AbstractEvent) wcFields.get(i);
connector.dispatchEvent(event, context, new WaitTimeTrigger(0, false));
}
String comment = (wcEvent instanceof AbstractEvent) ? ((AbstractEvent) wcEvent).getXPath() : "on browser";
Engine.logBeans.trace("(HtmlTransaction) Dispatch Event: " + comment);
boolean dispatch = connector.dispatchEvent(wcEvent, context, wcTrigger);
dom = connector.getHtmlParser().getDom(context);
Engine.logBeans.trace("(HtmlTransaction) Event: " + comment + (dispatch ? "" : " not") + " dispatched");
setCurrentXmlDocument(dom);
if (Engine.logBeans.isTraceEnabled())
Engine.logBeans.trace("(HtmlTransaction) Parse result dom:\n" + XMLUtils.prettyPrintDOM(dom));
} catch (Exception e) {
throw new EngineException("An unexpected exception occured while trying to get the document via HTTP.", e);
} finally {
bDispatching = false;
}
if (!runningThread.bContinue)
return;
}
use of com.twinsoft.convertigo.engine.parsers.triggers.WaitTimeTrigger in project convertigo by convertigo.
the class HttpTriggerWaitTimeEditorComposite method initialize.
private void initialize() {
WaitTimeTrigger trigger = (parent.getTrigger() instanceof WaitTimeTrigger) ? (WaitTimeTrigger) parent.getTrigger() : null;
GridData gridData2 = new GridData();
gridData2.horizontalAlignment = GridData.FILL;
gridData2.grabExcessHorizontalSpace = true;
gridData2.verticalAlignment = GridData.CENTER;
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
this.setLayout(gridLayout);
Label label = new Label(this, SWT.CHECK);
label.setText("Check this to force detection of any DOM changes\nwhile waiting. (Can cause heavy CPU load)");
check = new Button(this, SWT.CHECK);
check.setSelection((trigger != null) ? trigger.isDoDirty() : false);
}
Aggregations