Search in sources :

Example 16 with AbstractHttpTransaction

use of com.twinsoft.convertigo.beans.transactions.AbstractHttpTransaction in project convertigo by convertigo.

the class HttpTransactionAddVariables method run.

@Override
public void run() {
    Display display = Display.getDefault();
    Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
    Shell shell = getParentShell();
    shell.setCursor(waitCursor);
    try {
        TreeObject parentTreeObject = null;
        AbstractHttpTransaction databaseObject = null;
        ProjectExplorerView explorerView = getProjectExplorerView();
        if (explorerView != null) {
            parentTreeObject = explorerView.getFirstSelectedTreeObject();
            if (parentTreeObject.getObject() instanceof AbstractHttpTransaction) {
                databaseObject = (AbstractHttpTransaction) parentTreeObject.getObject();
                HttpTransactionVariablesDialog couchVariablesDialog = new HttpTransactionVariablesDialog(shell, databaseObject);
                couchVariablesDialog.open();
                explorerView.reloadTreeObject(parentTreeObject);
            }
        }
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to create a new database object '" + databaseObjectClassName + "'!");
    } finally {
        shell.setCursor(null);
        waitCursor.dispose();
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) HttpTransactionVariablesDialog(com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesDialog) Cursor(org.eclipse.swt.graphics.Cursor) Display(org.eclipse.swt.widgets.Display) AbstractHttpTransaction(com.twinsoft.convertigo.beans.transactions.AbstractHttpTransaction)

Aggregations

AbstractHttpTransaction (com.twinsoft.convertigo.beans.transactions.AbstractHttpTransaction)16 RequestableHttpVariable (com.twinsoft.convertigo.beans.variables.RequestableHttpVariable)9 EngineException (com.twinsoft.convertigo.engine.EngineException)7 IOException (java.io.IOException)7 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)5 RequestableVariable (com.twinsoft.convertigo.beans.variables.RequestableVariable)4 SocketTimeoutException (java.net.SocketTimeoutException)4 OAuthException (oauth.signpost.exception.OAuthException)4 JSONException (org.codehaus.jettison.json.JSONException)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)3 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)3 HttpConnector (com.twinsoft.convertigo.beans.connectors.HttpConnector)3 SqlTransaction (com.twinsoft.convertigo.beans.transactions.SqlTransaction)3 HttpMethodType (com.twinsoft.convertigo.engine.enums.HttpMethodType)3 File (java.io.File)3 FileInputStream (java.io.FileInputStream)3 ArrayList (java.util.ArrayList)3 PartInitException (org.eclipse.ui.PartInitException)3 Element (org.w3c.dom.Element)3 ScreenClass (com.twinsoft.convertigo.beans.core.ScreenClass)2