Examples of IErlFunction


Examples of org.erlide.engine.model.erlang.IErlFunction

        if (selection instanceof ITreeSelection) {

            final Object firstElement = ((ITreeSelection) selection).getFirstElement();

            if (firstElement instanceof IErlFunction) {
                final IErlFunction function = (IErlFunction) firstElement;
                final TracePattern tracePattern = new TracePattern(true);
                tracePattern.setFunctionName(function.getFunctionName());
                tracePattern.setModuleName(ErlangEngine.getInstance()
                        .getModelUtilService().getModule(function).getModuleName());
                tracePattern.setArity(function.getArity());
                TraceBackend.getInstance().removeTracePattern(tracePattern);
            }
        }
        return null;
    }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        if (selection instanceof ITreeSelection) {

            final Object firstElement = ((ITreeSelection) selection).getFirstElement();

            if (firstElement instanceof IErlFunction) {
                final IErlFunction function = (IErlFunction) firstElement;
                final TracePattern tracePattern = new TracePattern(true);
                tracePattern.setFunctionName(function.getFunctionName());
                tracePattern.setModuleName(ErlangEngine.getInstance()
                        .getModelUtilService().getModule(function).getModuleName());
                tracePattern.setLocal(true);
                tracePattern.setEnabled(true);
                TraceBackend.getInstance().addTracePattern(tracePattern);
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        if (selection instanceof ITreeSelection) {

            final Object firstElement = ((ITreeSelection) selection).getFirstElement();

            if (firstElement instanceof IErlFunction) {
                final IErlFunction function = (IErlFunction) firstElement;
                final TracePattern tracePattern = new TracePattern(true);
                tracePattern.setFunctionName(function.getFunctionName());
                tracePattern.setModuleName(ErlangEngine.getInstance()
                        .getModelUtilService().getModule(function).getModuleName());
                TraceBackend.getInstance().removeTracePattern(tracePattern);
            }
        }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        if (selection instanceof ITreeSelection) {

            final Object firstElement = ((ITreeSelection) selection).getFirstElement();

            if (firstElement instanceof IErlFunction) {
                final IErlFunction function = (IErlFunction) firstElement;
                final TracePattern tracePattern = new TracePattern(true);
                tracePattern.setFunctionName(function.getFunctionName());
                tracePattern.setModuleName(ErlangEngine.getInstance()
                        .getModelUtilService().getModule(function).getModuleName());
                tracePattern.setArity(function.getArity());
                tracePattern.setLocal(true);
                tracePattern.setEnabled(true);
                TraceBackend.getInstance().addTracePattern(tracePattern);
            }
        }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

    public static IErlFunction getFunction(final IErlModule module, final String name,
            final int arity) {
        try {
            for (final IErlElement e : module.getChildren()) {
                if (e instanceof IErlFunction) {
                    final IErlFunction function = (IErlFunction) e;
                    if (function.getName().equals(name) && function.getArity() == arity) {
                        return function;
                    }
                }
            }
        } catch (final ErlModelException e) {
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        final IErlModule module = erlangEditor.getModule();
        if (module == null) {
            return false;
        }
        module.open(null);
        final IErlFunction function = module.findFunction(erlangFunction);
        if (function == null) {
            return false;
        }
        EditorUtility.revealInEditor(editor, function);
        return true;
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

                tree = treeViewer.getTree();
                tree.addMouseListener(new MouseAdapter() {
                    @Override
                    public void mouseDoubleClick(final MouseEvent e) {
                        final TreeItem[] sel = tree.getSelection();
                        final IErlFunction el = (IErlFunction) sel[0].getData();
                        final boolean activateOnOpen = getSite() != null ? true
                                : OpenStrategy.activateOnOpen();
                        try {
                            EditorUtility.openElementInEditor(el, activateOnOpen);
                        } catch (final PartInitException e1) {
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        }

        @Override
        public String getText(final Object element) {
            if (element instanceof IErlFunction) {
                final IErlFunction ref = (IErlFunction) element;
                final String n = ref.getModuleName();
                return n + " : " + ref.toString();
            }
            return super.getText(element);
        }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        @Override
        public void inputChanged(final Viewer viewer, final Object oldInput,
                final Object newInput) {
            input = newInput;
            if (newInput instanceof IErlFunction) {
                final IErlFunction fun = (IErlFunction) newInput;
                lblRoot.setText(fun.getModuleName() + " : " + fun.getNameWithArity());
            } else if (input instanceof String) {
                lblRoot.setText((String) input);
            }
        }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        @Override
        public Object[] getChildren(final Object parentElement) {
            if (parentElement instanceof String) {
                return new Object[0];
            }
            final IErlFunction parent = (IErlFunction) parentElement;
            final FunctionRef ref = new FunctionRef(parent);
            final FunctionRef[] children = xrefService.functionUse(ref);
            if (children == null) {
                return new Object[0];
            }
            if (parentElement == input && children.length == 0) {
                // TODO ErlangXref should cache _all_ projects added to it
                return new Object[] { "<no callers from project "
                        + ErlangEngine
                                .getInstance()
                                .getModelUtilService()
                                .getProject(
                                        ErlangEngine.getInstance().getModelUtilService()
                                                .getModule(parent)).getName() + ">" };
            }
            final List<IErlFunction> result = new ArrayList<IErlFunction>();
            for (final FunctionRef r : children) {
                try {
                    final IErlFunction fun = ErlangEngine.getInstance().getModel()
                            .findFunction(r);
                    if (fun != null) {
                        result.add(fun);
                    }
                } catch (final ErlModelException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.