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

Examples of org.erlide.tracing.core.mvc.model.treenodes.TracingResultsNode


                Activator.getImage(Images.DROP_NODE));
        return node;
    }

    private ITreeNode processFileInfo(final OtpErlangTuple tuple) {
        TracingResultsNode node = null;
        if (tuple.elementAt(INDEX_INFO_START_DATE) instanceof OtpErlangAtom) {
            // file contains no trace events
            return null;
        }
        try {
            final Date from = readDateTuple((OtpErlangTuple) tuple
                    .elementAt(INDEX_INFO_START_DATE));
            final Date to = readDateTuple((OtpErlangTuple) tuple
                    .elementAt(INDEX_INFO_END_DATE));
            final String path = ((OtpErlangString) tuple.elementAt(INDEX_INFO_PATH))
                    .stringValue();
            final long size = ((OtpErlangLong) tuple.elementAt(INDEX_INFO_COUNT))
                    .longValue();

            node = new TracingResultsNode();
            node.setStartDate(from);
            node.setEndDate(to);
            node.setFileName(path);
            node.setSize(size);

            // node label
            final StringBuilder builder = new StringBuilder();
            builder.append(infoDateFormatter.format(from)).append(" - ")
                    .append(infoDateFormatter.format(to)).append(" (").append(size)
                    .append(" traces): ").append(path);
            node.setLabel(builder.toString());

        } catch (final OtpErlangRangeException e) {
            ErlLogger.error(e);
        }
        return node;
View Full Code Here


        loadAction.setToolTipText("Load results from disk...");

        removeAction = new Action() {
            @Override
            public void run() {
                final TracingResultsNode node = (TracingResultsNode) ((IStructuredSelection) treeViewer
                        .getSelection()).getFirstElement();
                if (node != null) {
                    TraceBackend.getInstance().removeTracingResult(node);
                }
            }
View Full Code Here

            task = null;
        }
    }

    private void updateButtonsPanel() {
        final TracingResultsNode resultSet = TraceBackend.getInstance()
                .getActiveResultSet();
        if (resultSet != null) {
            index = TraceBackend.getInstance().getStartIndex();
            final int size = TraceCollections.getTracesList().size();
            final boolean previousEnabled = index > 1;
            final boolean nextEnabled = index + size - 1 < resultSet.getSize();

            previousButton.setEnabled(previousEnabled);
            nextButton.setEnabled(nextEnabled);
            showButton.setEnabled(previousEnabled || nextEnabled);
            traceIndexField.setEnabled(previousEnabled || nextEnabled);
            traceIndexField.setText(String.valueOf(index));
            buttonsPanel.setEnabled(true);

            final StringBuilder stringBuilder = new StringBuilder(" (");
            if (resultSet.getSize() == 0) {
                stringBuilder.append("no traces)");
            } else {
                stringBuilder.append(index).append(" - ").append(index + size - 1)
                        .append(" of ").append(resultSet.getSize()).append(" traces)");
            }
            label.setText(stringBuilder.toString());
        } else {
            traceIndexField.setText("");
            label.setText("");
View Full Code Here

TOP

Related Classes of org.erlide.tracing.core.mvc.model.treenodes.TracingResultsNode

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.