Search in sources :

Example 1 with HttpTransactionVariablesDialog

use of com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesDialog 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)1 HttpTransactionVariablesDialog (com.twinsoft.convertigo.eclipse.dialogs.HttpTransactionVariablesDialog)1 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)1 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)1 Cursor (org.eclipse.swt.graphics.Cursor)1 Display (org.eclipse.swt.widgets.Display)1 Shell (org.eclipse.swt.widgets.Shell)1