Search in sources :

Example 26 with RpcResult

use of org.erlide.runtime.rpc.RpcResult in project erlide_eclipse by erlang.

the class WranglerRefactoringBackend method callSimpleInspection.

/**
 * Call inspection function which returns with boolean values
 *
 * @param functionName
 *            function to call
 * @param signature
 *            signature
 * @param parameters
 *            parameters
 * @return true if the call was successful, else false
 */
public boolean callSimpleInspection(final String functionName, final String signature, final Object... parameters) {
    ErlLogger.info("Wrangler inspection call: " + makeLogStr(functionName, parameters));
    RpcResult res;
    res = backend.call_noexception(WranglerRefactoringBackend.UNLIMITED_TIMEOUT, WranglerRefactoringBackend.INSPECTION_MODULE, functionName, signature, parameters);
    try {
        if (res.isOk()) {
            final OtpErlangAtom b = (OtpErlangAtom) res.getValue();
            return "true".equals(b.atomValue()) || "ok".equals(b.atomValue());
        }
    } catch (final Exception e) {
        ErlLogger.error(e);
    }
    return false;
}
Also used : RpcResult(org.erlide.runtime.rpc.RpcResult) OtpErlangAtom(com.ericsson.otp.erlang.OtpErlangAtom)

Aggregations

RpcResult (org.erlide.runtime.rpc.RpcResult)26 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)10 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)8 OtpErlangRangeException (com.ericsson.otp.erlang.OtpErlangRangeException)7 ExecutionException (org.eclipse.core.commands.ExecutionException)7 ErlModelException (org.erlide.engine.model.ErlModelException)7 WranglerException (org.erlide.wrangler.refactoring.exception.WranglerException)7 IErlElement (org.erlide.engine.model.IErlElement)6 IErlMemberSelection (org.erlide.wrangler.refactoring.selection.IErlMemberSelection)6 OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)5 OtpErlangTuple (com.ericsson.otp.erlang.OtpErlangTuple)4 WranglerRefactoringBackend (org.erlide.wrangler.refactoring.backend.internal.WranglerRefactoringBackend)4 WranglerRpcParsingException (org.erlide.wrangler.refactoring.exception.WranglerRpcParsingException)4 OtpErlangAtom (com.ericsson.otp.erlang.OtpErlangAtom)3 ArrayList (java.util.ArrayList)2 InputDialogWithCheckbox (org.erlide.wrangler.refactoring.codeinspection.ui.InputDialogWithCheckbox)2 OtpErlangFloat (com.ericsson.otp.erlang.OtpErlangFloat)1 OtpErlangInt (com.ericsson.otp.erlang.OtpErlangInt)1 Enumeration (java.util.Enumeration)1 LinkedList (java.util.LinkedList)1