Package org.erlide.runtime.rpc

Examples of org.erlide.runtime.rpc.RpcResult


        CodeInspectionViewsManager.hideView(
                CodeInspectionViewsManager.CODE_INSPECTION_VIEW, DEPENECIES_2_VIEW_ID);

        // run the rpc
        try {
            final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                    .callInspection("dependencies_of_a_module_eclipse", "sx",
                            wranglerSelection.getFilePath(),
                            wranglerSelection.getSearchPath());

            ArrayList<IErlElement> modules1 = new ArrayList<IErlElement>();
            ArrayList<IErlElement> modules2 = new ArrayList<IErlElement>();

            final OtpErlangObject obj = res.getValue();
            final OtpErlangTuple restuple = (OtpErlangTuple) obj;
            final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
            if (resindicator.atomValue().equals("ok")) {
                final OtpErlangTuple listtuple = (OtpErlangTuple) restuple.elementAt(1);
                final OtpErlangList modList1 = (OtpErlangList) listtuple.elementAt(0);
View Full Code Here


        final int ret = dialog.open();
        if (ret == Window.CANCEL) {
            return;
        }
        final int lines = Integer.parseInt(dialog.getValue());
        final RpcResult res = WranglerBackendManager
                .getRefactoringBackend()
                .callInspection("large_modules_eclipse", "ixi", lines,
                        wranglerSelection.getSearchPath(), GlobalParameters.getTabWidth());

        ArrayList<IErlElement> modules = new ArrayList<IErlElement>();
        try {
            final OtpErlangObject obj = res.getValue();
            final OtpErlangTuple restuple = (OtpErlangTuple) obj;
            final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
            if (resindicator.atomValue().equals("ok")) {

                final OtpErlangList modList = (OtpErlangList) restuple.elementAt(1);
View Full Code Here

     * @return parsed RPC message
     * @noreference This method is not intended to be referenced by clients.
     */
    public AbstractRefactoringRpcMessage call(final String functionName,
            final String signature, final Object... parameters) {
        final RpcResult res = callWithoutParser(functionName, signature, parameters);
        final AbstractRefactoringRpcMessage message = new RefactoringRpcMessage();
        message.parse(res);
        return message;
    }
View Full Code Here

     * @return RpcResultImpl object
     */
    public RpcResult callWithoutParser(final int timeout, final String functionName,
            final String signature, final Object... parameters) {
        ErlLogger.info("Wrangler call: " + makeLogStr(functionName, parameters));
        RpcResult res;
        if (timeout < 0) {
            res = backend.call_noexception(MODULE, functionName, signature, parameters);
        } else {
            res = backend.call_noexception(timeout, MODULE, functionName, signature,
                    parameters);
View Full Code Here

     */
    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(UNLIMITED_TIMEOUT, INSPECTION_MODULE,
                functionName, signature, parameters);
        try {
            if (res.isOk()) {
                final OtpErlangAtom b = (OtpErlangAtom) res.getValue();
                return b.atomValue().equals("true") || b.atomValue().equals("ok");
            }
        } catch (final Exception e) {
            ErlLogger.error(e);
        }
View Full Code Here

     */
    public RpcResult callInspection(final String functionName, final String signature,
            final Object... parameters) {
        ErlLogger.info("Wrangler inspection call: "
                + makeLogStr(functionName, parameters));
        RpcResult res;
        res = backend.call_noexception(UNLIMITED_TIMEOUT, INSPECTION_MODULE,
                functionName, signature, parameters);
        return res;

    }
View Full Code Here

     * Gets logged info (warnings, errors) from Wrangler
     *
     * @return log list
     */
    public RpcResult getLoggedInfo() {
        final RpcResult res = backend.call_noexception("wrangler_error_logger",
                "get_logged_info", "");
        @SuppressWarnings("unused")
        final RpcResult res2 = backend.call_noexception("wrangler_error_logger",
                "remove_all_from_logger", "");
        return res;
    }
View Full Code Here

                    .append(project.getProperties().getOutputDir()).toString();
        } catch (final ErlModelException e) {
            return false;
        }

        final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                .callWithoutParser("load_callback_mod_eclipse", "ss",
                        refac.getCallbackModule(), callbackPath);
        if (!res.isOk()) {
            return false;
        }
        return true;
    }
View Full Code Here

                .getWranglerSelection();
        if (sel == null) {
            return "";
        }

        final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                .callWithoutParser("get_var_name_eclipse", "siixi", sel.getFilePath(),
                        sel.getSelectionRange().getStartLine(),
                        sel.getSelectionRange().getStartCol(), sel.getSearchPath(),
                        GlobalParameters.getTabWidth());

        if (res.getValue().getClass().equals(OtpErlangString.class)) {
            return ((OtpErlangString) res.getValue()).stringValue();
        }
        return "";
    }
View Full Code Here

            final String module = next.substring(next.lastIndexOf('/') + 1,
                    next.lastIndexOf('.'));
            erlModules.add(new OtpErlangString(module));
        }

        RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
                "get_user_refactorings", "x",
                new OtpErlangList(erlModules.toArray(new OtpErlangObject[0])));

        if (res.isOk() && res.getValue() instanceof OtpErlangList) {
            final OtpErlangList genRefac = (OtpErlangList) ((OtpErlangTuple) ((OtpErlangList) res
                    .getValue()).elementAt(0)).elementAt(1);
            final OtpErlangList genCompositeRefac = (OtpErlangList) ((OtpErlangTuple) ((OtpErlangList) res
                    .getValue()).elementAt(1)).elementAt(1);

            for (final OtpErlangObject obj : genRefac) {
                elementaryRefacs.add(new UserRefactoringInfo(obj.toString()));
            }
            for (final OtpErlangObject obj : genCompositeRefac) {
                compositeRefacs.add(new UserRefactoringInfo(obj.toString()));
            }
        }

        ErlLogger.info("Refac modules found " + res.toString());

        // user's own refactoring
        final Enumeration userModules = coreBundle.findEntries(
                "wrangler/ebin/my_gen_refac", "*.beam", false);
        while (userModules != null && userModules.hasMoreElements()) {
            final String next = userModules.nextElement().toString();
            myElementaryRefacs.add(new UserRefactoringInfo(next.substring(
                    next.lastIndexOf('/') + 1, next.lastIndexOf('.'))));

        }
        // user's own composite refactorings
        final Enumeration userCompositeModules = coreBundle.findEntries(
                "wrangler/ebin/my_gen_composite_refac", "*.beam", false);
        while (userCompositeModules != null && userCompositeModules.hasMoreElements()) {
            final String next = userCompositeModules.nextElement().toString();
            myCompositeRefacs.add(new UserRefactoringInfo(next.substring(
                    next.lastIndexOf('/') + 1, next.lastIndexOf('.'))));
        }

        // load refactorings
        res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
                "load_user_refactorings", "s", getEbinPath());
        ErlLogger.debug(res.toString());

    }
View Full Code Here

TOP

Related Classes of org.erlide.runtime.rpc.RpcResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.