use of com.twinsoft.convertigo.eclipse.wizards.new_object.NewObjectWizard in project convertigo by convertigo.
the class HtmlConnectorDesignComposite method createExtractionRuleFromSelection.
public void createExtractionRuleFromSelection(Document dom) throws EngineException {
String className = "com.twinsoft.convertigo.beans.core.ExtractionRule";
// Retrieve selected extraction rule xpath
String extractionrulesXpath = xpathEvaluator.getSelectionXpath();
// Retrieve parent ScreenClass
HtmlScreenClass parentObject = getParentHtmlScreenClass();
// Add extraction rule to screen class
NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className, extractionrulesXpath, dom);
WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
wzdlg.setPageSize(850, 650);
wzdlg.open();
if (wzdlg.getReturnCode() != Window.CANCEL) {
HtmlExtractionRule extractionrule = (HtmlExtractionRule) newObjectWizard.newBean;
// Reload parent ScreenClass in Tree
fireObjectChanged(new CompositeEvent(parentObject));
// Set selection on new extraction rule (will expand tree to new extraction rule)
if (extractionrule != null)
fireObjectSelected(new CompositeEvent(extractionrule));
// Set back selection on parent ScreenClass
fireObjectSelected(new CompositeEvent(parentObject));
}
}
Aggregations