Search in sources :

Example 6 with NewObjectWizard

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));
    }
}
Also used : HtmlScreenClass(com.twinsoft.convertigo.beans.screenclasses.HtmlScreenClass) HtmlExtractionRule(com.twinsoft.convertigo.beans.extractionrules.HtmlExtractionRule) NewObjectWizard(com.twinsoft.convertigo.eclipse.wizards.new_object.NewObjectWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) CompositeEvent(com.twinsoft.convertigo.eclipse.editors.CompositeEvent)

Aggregations

NewObjectWizard (com.twinsoft.convertigo.eclipse.wizards.new_object.NewObjectWizard)6 WizardDialog (org.eclipse.jface.wizard.WizardDialog)6 CompositeEvent (com.twinsoft.convertigo.eclipse.editors.CompositeEvent)5 HtmlScreenClass (com.twinsoft.convertigo.beans.screenclasses.HtmlScreenClass)4 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)2 ObjectsFolderTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject)2 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)2 Shell (org.eclipse.swt.widgets.Shell)2 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)1 HtmlConnector (com.twinsoft.convertigo.beans.connectors.HtmlConnector)1 Criteria (com.twinsoft.convertigo.beans.core.Criteria)1 IXPathable (com.twinsoft.convertigo.beans.core.IXPathable)1 RequestableObject (com.twinsoft.convertigo.beans.core.RequestableObject)1 Statement (com.twinsoft.convertigo.beans.core.Statement)1 HtmlExtractionRule (com.twinsoft.convertigo.beans.extractionrules.HtmlExtractionRule)1 HTTPStatement (com.twinsoft.convertigo.beans.statements.HTTPStatement)1 HandlerStatement (com.twinsoft.convertigo.beans.statements.HandlerStatement)1 ScEntryHandlerStatement (com.twinsoft.convertigo.beans.statements.ScEntryHandlerStatement)1 ScExitHandlerStatement (com.twinsoft.convertigo.beans.statements.ScExitHandlerStatement)1 ScHandlerStatement (com.twinsoft.convertigo.beans.statements.ScHandlerStatement)1