use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class HtmlConnectorDesignComposite method createStatementFromSelection.
public void createStatementFromSelection() {
String className = "com.twinsoft.convertigo.beans.core.Statement";
// Retrieve selected statement xpath
String statementXpath = xpathEvaluator.getSelectionXpath();
// Retrieve parent Statement
Statement parentObject = getParentStatement();
if (parentObject == null) {
ConvertigoPlugin.errorMessageBox("Unable to create a new statement.\nThe selected handler belongs to a different HTML connector.");
return;
}
// Add statement to parent statement
NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className, statementXpath, null);
WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
wzdlg.setPageSize(850, 650);
wzdlg.open();
if (wzdlg.getReturnCode() != Window.CANCEL) {
Statement statement = (Statement) newObjectWizard.newBean;
// Reload parent statement in Tree
fireObjectChanged(new CompositeEvent(parentObject));
// Set selection on new statement (will expand tree to new statement)
if (statement != null)
fireObjectSelected(new CompositeEvent(statement));
// Set back selection on parent statement
fireObjectSelected(new CompositeEvent(parentObject));
}
}
use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class HtmlConnectorDesignComposite method createScreenClassFromSelection.
public void createScreenClassFromSelection() throws EngineException {
String className = "com.twinsoft.convertigo.beans.core.ScreenClass";
// Retrieve selected criteria xpath
String criteriaXpath = xpathEvaluator.getSelectionXpath();
// Retrieve parent ScreenClass
HtmlScreenClass parentObject = getParentHtmlScreenClass();
NewObjectWizard newObjectWizard = new NewObjectWizard(parentObject, className);
WizardDialog wzdlg = new WizardDialog(Display.getCurrent().getActiveShell(), newObjectWizard);
wzdlg.setPageSize(850, 650);
wzdlg.open();
if (wzdlg.getReturnCode() != Window.CANCEL) {
HtmlScreenClass htmlScreenClass = (HtmlScreenClass) newObjectWizard.newBean;
if (htmlScreenClass != null) {
String screenClassName = htmlScreenClass.getName();
// Add criteria to screen class
createCriteria(htmlScreenClass, criteriaXpath);
// Set detected ScreenClass to newly created one
if (htmlConnector.isLearning()) {
detectedScreenClass = htmlScreenClass;
ConvertigoPlugin.logDebug2("(HtmlConnectorDesignComposite) Detected screen class is set to newly created one named '" + screenClassName + "'");
} else {
ConvertigoPlugin.logDebug2("(HtmlConnectorDesignComposite) New screen class named '" + screenClassName + "' has been added");
}
// Reload parent ScreenClass in Tree
fireObjectChanged(new CompositeEvent(parentObject));
// Set selection on newly created screenclass
fireObjectSelected(new CompositeEvent(htmlScreenClass));
// Highlight new detected ScreenClass in Tree
if (htmlConnector.isLearning())
Engine.theApp.fireObjectDetected(new EngineEvent(htmlScreenClass));
// TODO:toolScreenclass.setEnabled(false);
}
}
}
use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class SapJcoConnectorDesignComposite method createBapiTransactions.
private void createBapiTransactions(final TableItem[] items) {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = display.getActiveShell();
if (shell != null) {
try {
shell.setCursor(waitCursor);
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
String bapiName = item.getText(0);
String bapiDesc = item.getText(1);
ConvertigoPlugin.logDebug("Creating transaction for BAPI '" + bapiName + "' ...");
sapConnector.removeSerializedData(bapiName);
SapJcoTransaction sapJcoTransaction = SapJcoConnector.createSapJcoTransaction(sapConnector, bapiName);
if (sapJcoTransaction != null) {
Transaction transaction = sapConnector.getTransactionByName(bapiName);
if (transaction != null) {
try {
File xsdFile = new File(transaction.getSchemaFilePath());
if (xsdFile.exists()) {
xsdFile.delete();
}
} catch (Exception e) {
}
sapConnector.remove(transaction);
}
sapJcoTransaction.setComment(bapiDesc);
sapConnector.add(sapJcoTransaction);
fireObjectChanged(new CompositeEvent(sapConnector));
ConvertigoPlugin.logDebug("Transaction added.");
}
}
} catch (Exception ee) {
ConvertigoPlugin.logException(ee, "Error while creating transaction(s)");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
}
use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class CreateDesignDocumentViewAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DesignDocumentTreeObject ddto = (DesignDocumentTreeObject) explorerView.getFirstSelectedTreeObject();
DesignDocumentViewTreeObject ddvto = ddto.addNewView();
if (ddto.hasChanged()) {
TreeParent treeParent = ddto.getParent();
if (treeParent instanceof FolderTreeObject)
treeParent = treeParent.getParent();
explorerView.objectChanged(new CompositeEvent(treeParent.getObject(), ddvto.getPath()));
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a new view!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
use of com.twinsoft.convertigo.eclipse.editors.CompositeEvent in project convertigo by convertigo.
the class CreateDesignDocumentViewReduceAction method run.
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
DesignDocumentViewTreeObject ddvto = (DesignDocumentViewTreeObject) explorerView.getFirstSelectedTreeObject();
DesignDocumentFunctionTreeObject ddfto = ddvto.addReduce();
DesignDocumentTreeObject ddto = (DesignDocumentTreeObject) ddvto.getParent().getParent();
if (ddto.hasChanged()) {
TreeParent treeParent = ddto.getParent();
if (treeParent instanceof FolderTreeObject)
treeParent = treeParent.getParent();
explorerView.objectChanged(new CompositeEvent(treeParent.getObject(), ddfto.getPath()));
}
}
} catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to create a reduce function!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
Aggregations