Package org.erlide.tracing.core.mvc.model

Examples of org.erlide.tracing.core.mvc.model.TracedProcess


public class ProcessLabelProvider extends LabelProvider implements ITableLabelProvider {

    @Override
    public Image getColumnImage(final Object element, final int columnIndex) {
        final TracedProcess process = (TracedProcess) element;

        if (ProcessColumn.SELECTED.ordinal() == columnIndex) {
            // process columns
            if (process.isSelected()) {
                return Activator.getDefault().getImageRegistry()
                        .get(Images.CHECKED.toString());
            }
            return Activator.getDefault().getImageRegistry()
                    .get(Images.UNCHECKED.toString());
        }
        // flag columns
        final ProcessFlag flag = ProcessFlag.getByIndex(columnIndex
                - ProcessColumn.values().length);
        if (flag != null) {
            if (process.hasFlag(flag)) {
                return Activator.getDefault().getImageRegistry()
                        .get(Images.CHECKED.toString());
            }
            return Activator.getDefault().getImageRegistry()
                    .get(Images.UNCHECKED.toString());
View Full Code Here


    }

    @Override
    public String getColumnText(final Object element, final int columnIndex) {

        final TracedProcess process = (TracedProcess) element;
        if (columnIndex < ProcessColumn.values().length) {
            switch (ProcessColumn.getByIndex(columnIndex)) {
            case SELECTED:
                break;
            case NAME:
                return process.getName();
            case NODE:
                return process.getNode();
            case INITIAL_CALL:
                return process.getInitialCall();
            }
        }
        return "";
    }
View Full Code Here

        return true;
    }

    @Override
    public Object getValue(final Object element, final String property) {
        final TracedProcess process = (TracedProcess) element;

        try {
            switch (ProcessColumn.valueOf(property)) {
            case INITIAL_CALL:
                return process.getInitialCall();
            case NAME:
                return process.getName();
            case SELECTED:
                return process.isSelected();
            default:
            }
        } catch (final Exception e) {
        }
        return process.hasFlag(ProcessFlag.valueOf(property));
    }
View Full Code Here

        return process.hasFlag(ProcessFlag.valueOf(property));
    }

    @Override
    public void modify(final Object element, final String property, final Object value) {
        final TracedProcess process = (TracedProcess) ((TableItem) element).getData();

        // processes column
        try {
            if (ProcessColumn.SELECTED.equals(ProcessColumn.valueOf(property))) {
                process.setSelected((Boolean) value);
                tableViewer.update(process, null);
            }
            return;
        } catch (final Exception e) {
        }

        // flag column
        final ProcessFlag flag = ProcessFlag.valueOf(property);
        if ((Boolean) value) {
            process.setFlag(flag);
        } else {
            process.unSetFlag(flag);
        }
        tableViewer.update(process, null);
    }
View Full Code Here

                    FUNCTION_NAME, "x", nodesList);
            final TracedProcess[] processes = new TracedProcess[procList.arity()];

            for (int i = 0; i < procList.arity(); i++) {
                final OtpErlangTuple tuple = (OtpErlangTuple) procList.elementAt(i);
                processes[i] = new TracedProcess(tuple);
            }
            return processes;
        } catch (final RpcException e) {
            ErlLogger.error(e);
        }
View Full Code Here

TOP

Related Classes of org.erlide.tracing.core.mvc.model.TracedProcess

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.