tmf: Add missing Javadoc to tmf.ui
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 3 Jan 2013 23:20:39 +0000 (18:20 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 7 Jan 2013 22:33:01 +0000 (17:33 -0500)
This goes a long way into fixing the remaining warnings!

This commit contains only documentation and formatting fixes,
no actual code changes. Except for some protected fields in
TmfEventsTable, which were changed to private to remove them
from the API.

Change-Id: I6c524c9e9b91f0efafad739cec62aa7d60429972
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/9463
Tested-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>

52 files changed:
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/ITmfImageConstants.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/TmfUiTracer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/commands/ManageCustomParsersCommandHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/dialogs/ManageCustomParsersDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/dialogs/MultiLineInputDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/editors/handlers/AddBookmarkHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventContent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventType.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomEventsTable.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTraceDefinition.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtEventType.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTraceContext.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTraceDefinition.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlEventType.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTraceContext.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTraceDefinition.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserWizard.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserInputWizardPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserWizard.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectTraceTypeContributionItem.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/TmfActionProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/TmfStatisticsTree.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterViewer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/AsyncMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/BasicExecutionOccurrence.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/Lifeline.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SDPrintDialogUI.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/drawings/impl/ColorImpl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/model/TimeEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeDataProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphBaseControl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphTooltipHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java

index 444b2601ffe8b32bbc097e7867811ec42fb89df8..eb369969ccf7127c1f6c726a68da76623c795dec 100755 (executable)
@@ -4,14 +4,16 @@
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * $Id: CommonUIImages.java,v 1.6 2010/05/05 12:32:31 paules Exp $
  *
  * Contributors:
  *     Bernd Hufmann - initial API and implementation
  *******************************************************************************/
 package org.eclipse.linuxtools.internal.tmf.ui;
 
-@SuppressWarnings("nls")
+/**
+ * Names for generic icons and buttons used in TMF
+ */
+@SuppressWarnings({"nls", "javadoc"})
 public interface ITmfImageConstants {
 
     public static final String ICONS_PATH = "icons/"; //$NON-NLS-1$
index 1e9ce0c9b67769641fda8901ca34d47e25e904d2..7f00f9c5ee44acd0d0e0bb1ecfe085b0183eebc0 100644 (file)
@@ -1,8 +1,22 @@
+/*******************************************************************************
+ * Copyright (c)  2012 Ericsson
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui;
 
 import org.eclipse.osgi.util.NLS;
 
+/**
+ * TMF message bundle
+ */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
+
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.tmf.ui.messages"; //$NON-NLS-1$
 
     public static String ManageCustomParsersDialog_DeleteButtonLabel;
index ac123c2225d88a88ada2f9f45128ce86acf354da..353f43af82f914d90dce15bb7fa933d5f732c374 100644 (file)
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * Copyright (c)  2012 Ericsson
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui;
 
 import java.io.BufferedWriter;
@@ -6,159 +15,228 @@ import java.io.IOException;
 
 import org.eclipse.core.runtime.Platform;
 
+/**
+ * Tracer class for the tmf.ui plugin
+ */
 @SuppressWarnings("nls")
 public class TmfUiTracer {
 
-       private static String pluginID = Activator.PLUGIN_ID;
-
-       static Boolean ERROR     = Boolean.FALSE;
-       static Boolean WARNING   = Boolean.FALSE;
-       static Boolean INFO      = Boolean.FALSE;
-
-       static Boolean INDEX         = Boolean.FALSE;
-       static Boolean DISPLAY       = Boolean.FALSE;
-       static Boolean SORTING       = Boolean.FALSE;
-
-       private static String LOGNAME = "traceUI.log";
-       private static BufferedWriter fTraceLog = null;
-
-       private static BufferedWriter openLogFile(String filename) {
-               BufferedWriter outfile = null;
-               try {
-                       outfile = new BufferedWriter(new FileWriter(filename));
-               } catch (IOException e) {
-                   Activator.getDefault().logError("Error creating log file " + LOGNAME, e); //$NON-NLS-1$
-               }
-               return outfile;
-       }
-
-       public static void init() {
-
-               String traceKey;
-               boolean isTracing = false;
-               
-               traceKey = Platform.getDebugOption(pluginID + "/error");
-               if (traceKey != null) {
-                       ERROR = (Boolean.valueOf(traceKey)).booleanValue();
-                       isTracing |= ERROR;
-               }
-
-               traceKey = Platform.getDebugOption(pluginID + "/warning");
-               if (traceKey != null) {
-                       WARNING = (Boolean.valueOf(traceKey)).booleanValue();
-                       isTracing |= WARNING;
-               }
-
-               traceKey = Platform.getDebugOption(pluginID + "/info");
-               if (traceKey != null) {
-                       INFO = (Boolean.valueOf(traceKey)).booleanValue();
-                       isTracing |= INFO;
-               }
-
-               traceKey = Platform.getDebugOption(pluginID + "/updateindex");
-               if (traceKey != null) {
-                   INDEX = (Boolean.valueOf(traceKey)).booleanValue();
-                       isTracing |= INDEX;
-               }
-
-               traceKey = Platform.getDebugOption(pluginID + "/display");
-               if (traceKey != null) {
-                   DISPLAY = (Boolean.valueOf(traceKey)).booleanValue();
-                       isTracing |= DISPLAY;
-               }
-
-               traceKey = Platform.getDebugOption(pluginID + "/sorting");
-               if (traceKey != null) {
-                   SORTING = (Boolean.valueOf(traceKey)).booleanValue();
-                       isTracing |= SORTING;
-               }
-
-               // Create trace log file if needed
-               if (isTracing) {
-                       fTraceLog = openLogFile(LOGNAME);
-               }
-       }
-
-       public static void stop() {
-               if (fTraceLog == null)
-                       return;
-
-               try {
-                       fTraceLog.close();
-                       fTraceLog = null;
-               } catch (IOException e) {
-                 Activator.getDefault().logError("Error closing log file " + LOGNAME, e); //$NON-NLS-1$
-               }
-       }
-
-       // Predicates
-       public static boolean isErrorTraced() {
-               return ERROR;
-       }
-
-       public static boolean isIndexTraced() {
-               return INDEX;
-       }
-       
-       public static boolean isDisplayTraced() {
-               return DISPLAY;
-       }
-       
-       public static boolean isSortingTraced() {
-               return SORTING;
-       }
-
-       // Tracers
-       public static void trace(String msg) {
-               long currentTime = System.currentTimeMillis();
-               StringBuilder message = new StringBuilder("[");
-               message.append(currentTime / 1000);
-               message.append(".");
-               message.append(String.format("%1$03d", currentTime % 1000));
-               message.append("] ");
-               message.append(msg);
-
-               if (fTraceLog != null) {
-                       try {
-                               fTraceLog.write(message.toString());
-                               fTraceLog.newLine();
-                               fTraceLog.flush();
-                       } catch (IOException e) {
-                        Activator.getDefault().logError("Error writing to log file " + LOGNAME, e); //$NON-NLS-1$
-                       }
-               }
-       }
-
-       public static void traceIndex(String msg) {
-           String message = ("[INDEX] " + msg);
-           trace(message);
-       }
-       
-       public static void traceDisplay(String msg) {
-               String message = ("[DISPLAY]" + msg);
-               trace(message);
-       }
-
-       public static void traceSorting(String msg) {
-               String message = ("[SORT] " + msg);
-               trace(message);
-       }
-
-       public static void traceError(String msg) {
-               String message = ("[ERR] Thread=" + Thread.currentThread().getId() + " " + msg);
-               trace(message);
-       }
-
-       public static void traceWarning(String msg) {
-           String message = ("[WARN] Thread=" + Thread.currentThread().getId() + " " + msg);
-           trace(message);
-       }
-       
-       public static void traceInfo(String msg) {
-               String message = ("[INF] Thread=" + Thread.currentThread().getId() + " " + msg);
-               trace(message);
-       }
-       
-       
+    private static String pluginID = Activator.PLUGIN_ID;
+
+    static Boolean ERROR   = Boolean.FALSE;
+    static Boolean WARNING = Boolean.FALSE;
+    static Boolean INFO    = Boolean.FALSE;
+
+    static Boolean INDEX   = Boolean.FALSE;
+    static Boolean DISPLAY = Boolean.FALSE;
+    static Boolean SORTING = Boolean.FALSE;
+
+    private static String LOGNAME = "traceUI.log";
+    private static BufferedWriter fTraceLog = null;
+
+    private static BufferedWriter openLogFile(String filename) {
+        BufferedWriter outfile = null;
+        try {
+            outfile = new BufferedWriter(new FileWriter(filename));
+        } catch (IOException e) {
+            Activator.getDefault().logError("Error creating log file " + LOGNAME, e); //$NON-NLS-1$
+        }
+        return outfile;
+    }
+
+    /**
+     * Initialize tracing
+     */
+    public static void init() {
+
+        String traceKey;
+        boolean isTracing = false;
+
+        traceKey = Platform.getDebugOption(pluginID + "/error");
+        if (traceKey != null) {
+            ERROR = (Boolean.valueOf(traceKey)).booleanValue();
+            isTracing |= ERROR;
+        }
+
+        traceKey = Platform.getDebugOption(pluginID + "/warning");
+        if (traceKey != null) {
+            WARNING = (Boolean.valueOf(traceKey)).booleanValue();
+            isTracing |= WARNING;
+        }
+
+        traceKey = Platform.getDebugOption(pluginID + "/info");
+        if (traceKey != null) {
+            INFO = (Boolean.valueOf(traceKey)).booleanValue();
+            isTracing |= INFO;
+        }
+
+        traceKey = Platform.getDebugOption(pluginID + "/updateindex");
+        if (traceKey != null) {
+            INDEX = (Boolean.valueOf(traceKey)).booleanValue();
+            isTracing |= INDEX;
+        }
+
+        traceKey = Platform.getDebugOption(pluginID + "/display");
+        if (traceKey != null) {
+            DISPLAY = (Boolean.valueOf(traceKey)).booleanValue();
+            isTracing |= DISPLAY;
+        }
+
+        traceKey = Platform.getDebugOption(pluginID + "/sorting");
+        if (traceKey != null) {
+            SORTING = (Boolean.valueOf(traceKey)).booleanValue();
+            isTracing |= SORTING;
+        }
+
+        // Create trace log file if needed
+        if (isTracing) {
+            fTraceLog = openLogFile(LOGNAME);
+        }
+    }
+
+    /**
+     * Stop tracing
+     */
+    public static void stop() {
+        if (fTraceLog == null) {
+            return;
+        }
+
+        try {
+            fTraceLog.close();
+            fTraceLog = null;
+        } catch (IOException e) {
+            Activator.getDefault().logError("Error closing log file " + LOGNAME, e); //$NON-NLS-1$
+        }
+    }
+
+    // ------------------------------------------------------------------------
+    // Predicates
+    // ------------------------------------------------------------------------
+
+    /**
+     * @return If ERROR messages are traced
+     */
+    public static boolean isErrorTraced() {
+        return ERROR;
+    }
+
+    /**
+     * @return If INDEX messages are traced
+     */
+    public static boolean isIndexTraced() {
+        return INDEX;
+    }
+
+    /**
+     * @return If DISPLAY messages are traced
+     */
+    public static boolean isDisplayTraced() {
+        return DISPLAY;
+    }
+
+    /**
+     * @return If SORTING messages are traced
+     */
+    public static boolean isSortingTraced() {
+        return SORTING;
+    }
+
+
+    // ------------------------------------------------------------------------
+    // Tracing methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Trace a generic event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void trace(String msg) {
+        long currentTime = System.currentTimeMillis();
+        StringBuilder message = new StringBuilder("[");
+        message.append(currentTime / 1000);
+        message.append(".");
+        message.append(String.format("%1$03d", currentTime % 1000));
+        message.append("] ");
+        message.append(msg);
+
+        if (fTraceLog != null) {
+            try {
+                fTraceLog.write(message.toString());
+                fTraceLog.newLine();
+                fTraceLog.flush();
+            } catch (IOException e) {
+                Activator.getDefault().logError("Error writing to log file " + LOGNAME, e); //$NON-NLS-1$
+            }
+        }
+    }
+
+    /**
+     * Trace an INDEX event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void traceIndex(String msg) {
+        String message = ("[INDEX] " + msg);
+        trace(message);
+    }
+
+    /**
+     * Trace a DISPLAY event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void traceDisplay(String msg) {
+        String message = ("[DISPLAY]" + msg);
+        trace(message);
+    }
+
+    /**
+     * Trace a SORTING event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void traceSorting(String msg) {
+        String message = ("[SORT] " + msg);
+        trace(message);
+    }
+
+    /**
+     * Trace an ERROR event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void traceError(String msg) {
+        String message = ("[ERR] Thread=" + Thread.currentThread().getId() + " " + msg);
+        trace(message);
+    }
+
+    /**
+     * Trace a WARNING event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void traceWarning(String msg) {
+        String message = ("[WARN] Thread=" + Thread.currentThread().getId() + " " + msg);
+        trace(message);
+    }
+
+    /**
+     * Trace an INFO event
+     *
+     * @param msg
+     *            The event's message
+     */
+    public static void traceInfo(String msg) {
+        String message = ("[INF] Thread=" + Thread.currentThread().getId() + " " + msg);
+        trace(message);
+    }
 
 }
index c03022ab682a107e1d19e3cf0167f6d139e7ed0d..91debfe8d394f1c441b400e8784972a3f8cdef26 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2010 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *******************************************************************************/
@@ -18,6 +18,11 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.linuxtools.internal.tmf.ui.dialogs.ManageCustomParsersDialog;
 import org.eclipse.swt.widgets.Display;
 
+/**
+ * Command handler for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class ManageCustomParsersCommandHandler extends AbstractHandler {
 
     @Override
index 0eb3318a4cf4d50932923c37eaca0d0669cb6f6e..e8019e40f039ae2f0f2fb78ca58a834225a524a2 100644 (file)
@@ -39,6 +39,11 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.List;
 import org.eclipse.swt.widgets.Shell;
 
+/**
+ * Dialog for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class ManageCustomParsersDialog extends Dialog {
 
     private static final Image image = Activator.getDefault().getImageFromPath("/icons/etool16/customparser_wizard.gif"); //$NON-NLS-1$
@@ -52,6 +57,12 @@ public class ManageCustomParsersDialog extends Dialog {
     Button importButton;
     Button exportButton;
 
+    /**
+     * Constructor
+     *
+     * @param parent
+     *            Parent shell of this dialog
+     */
     public ManageCustomParsersDialog(Shell parent) {
         super(parent);
         setShellStyle(SWT.RESIZE | SWT.MAX | getShellStyle());
@@ -84,31 +95,37 @@ public class ManageCustomParsersDialog extends Dialog {
         txtButton = new Button(radioContainer, SWT.RADIO);
         txtButton.setText(Messages.ManageCustomParsersDialog_TextButtonLabel);
         txtButton.setSelection(true);
-        txtButton.addSelectionListener(new SelectionListener(){
+        txtButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 fillParserList();
-            }});
+            }
+        });
 
         xmlButton = new Button(radioContainer, SWT.RADIO);
         xmlButton.setText("XML"); //$NON-NLS-1$
-        xmlButton.addSelectionListener(new SelectionListener(){
+        xmlButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {
+            }
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 fillParserList();
-            }});
+            }
+        });
 
         parserList = new List(listContainer, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
         parserList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-        parserList.addSelectionListener(new SelectionListener(){
+        parserList.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 if (parserList.getSelectionCount() == 0) {
                     editButton.setEnabled(false);
                     deleteButton.setEnabled(false);
@@ -118,7 +135,8 @@ public class ManageCustomParsersDialog extends Dialog {
                     deleteButton.setEnabled(true);
                     exportButton.setEnabled(true);
                 }
-            }});
+            }
+        });
 
         Composite buttonContainer = new Composite(composite, SWT.NULL);
         buttonContainer.setLayout(new GridLayout());
@@ -127,11 +145,12 @@ public class ManageCustomParsersDialog extends Dialog {
         newButton = new Button(buttonContainer, SWT.PUSH);
         newButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
         newButton.setText(Messages.ManageCustomParsersDialog_NewButtonLabel);
-        newButton.addSelectionListener(new SelectionListener(){
+        newButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 WizardDialog dialog = null;
                 if (txtButton.getSelection()) {
                     dialog = new WizardDialog(getShell(), new CustomTxtParserWizard());
@@ -144,17 +163,19 @@ public class ManageCustomParsersDialog extends Dialog {
                         fillParserList();
                     }
                 }
-            }});
+            }
+        });
 
         editButton = new Button(buttonContainer, SWT.PUSH);
         editButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
         editButton.setText(Messages.ManageCustomParsersDialog_EditButtonLabel);
         editButton.setEnabled(false);
-        editButton.addSelectionListener(new SelectionListener(){
+        editButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 WizardDialog dialog = null;
                 if (txtButton.getSelection()) {
                     dialog = new WizardDialog(getShell(),
@@ -169,17 +190,19 @@ public class ManageCustomParsersDialog extends Dialog {
                         fillParserList();
                     }
                 }
-            }});
+            }
+        });
 
         deleteButton = new Button(buttonContainer, SWT.PUSH);
         deleteButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
         deleteButton.setText(Messages.ManageCustomParsersDialog_DeleteButtonLabel);
         deleteButton.setEnabled(false);
-        deleteButton.addSelectionListener(new SelectionListener(){
+        deleteButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 boolean confirm = MessageDialog.openQuestion(
                         getShell(),
                         Messages.ManageCustomParsersDialog_DeleteParserDialogHeader,
@@ -192,21 +215,23 @@ public class ManageCustomParsersDialog extends Dialog {
                     }
                     fillParserList();
                 }
-            }});
+            }
+        });
 
         new Label(buttonContainer, SWT.NONE); // filler
 
         importButton = new Button(buttonContainer, SWT.PUSH);
         importButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
         importButton.setText(Messages.ManageCustomParsersDialog_ImportButtonLabel);
-        importButton.addSelectionListener(new SelectionListener(){
+        importButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.OPEN);
                 dialog.setText(Messages.ManageCustomParsersDialog_ImportParserSelection);
-                dialog.setFilterExtensions(new String[] {"*.xml", "*"}); //$NON-NLS-1$ //$NON-NLS-2$
+                dialog.setFilterExtensions(new String[] { "*.xml", "*" }); //$NON-NLS-1$ //$NON-NLS-2$
                 String path = dialog.open();
                 if (path != null) {
                     CustomTraceDefinition[] defs = null;
@@ -222,20 +247,22 @@ public class ManageCustomParsersDialog extends Dialog {
                         fillParserList();
                     }
                 }
-            }});
+            }
+        });
 
         exportButton = new Button(buttonContainer, SWT.PUSH);
         exportButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
         exportButton.setText(Messages.ManageCustomParsersDialog_ExportButtonLabel);
         exportButton.setEnabled(false);
-        exportButton.addSelectionListener(new SelectionListener(){
+        exportButton.addSelectionListener(new SelectionListener() {
             @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {}
+            public void widgetDefaultSelected(SelectionEvent e) {}
+
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);
                 dialog.setText(Messages.ManageCustomParsersDialog_ExportParserSelection + parserList.getSelection()[0]);
-                dialog.setFilterExtensions(new String[] {"*.xml", "*"}); //$NON-NLS-1$ //$NON-NLS-2$
+                dialog.setFilterExtensions(new String[] { "*.xml", "*" }); //$NON-NLS-1$ //$NON-NLS-2$
                 String path = dialog.open();
                 if (path != null) {
                     CustomTraceDefinition def = null;
@@ -248,7 +275,8 @@ public class ManageCustomParsersDialog extends Dialog {
                         def.save(path);
                     }
                 }
-            }});
+            }
+        });
 
         fillParserList();
 
index 3cee15a5041f94e269bd6639a887073b5e98261a..9cd2a1e892366564b4e1eeb47ea0c4d28d3f6177 100644 (file)
@@ -34,8 +34,7 @@ import org.eclipse.swt.widgets.Text;
  *
  * Overrides InputDialog to support multiple line text input.
  *
- * @author Patrick Tasse
- *
+ * @author Patrick Tassé
  */
 public class MultiLineInputDialog extends InputDialog {
 
index 1793371b3ae32805b5b7dcb68d39bcc91e237613..fa5625adb364a3c016da4a2cf45bfd791b777af9 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2010 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *******************************************************************************/
@@ -21,23 +21,28 @@ import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PlatformUI;
 
+/**
+ * Handler to add bookmarks.
+ *
+ * @author Patrick Tasse
+ */
 public class AddBookmarkHandler extends AbstractHandler {
 
-       @Override
+    @Override
     public boolean isEnabled() {
-               return true;
+        return true;
     }
 
-       @Override
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
         IWorkbench wb = PlatformUI.getWorkbench();
         IWorkbenchPage activePage = wb.getActiveWorkbenchWindow().getActivePage();
         IEditorPart activeEditor = activePage.getActiveEditor();
         if (activeEditor instanceof TmfEventsEditor) {
-               TmfEventsEditor editor = (TmfEventsEditor) activeEditor;
-               editor.addBookmark();
+            TmfEventsEditor editor = (TmfEventsEditor) activeEditor;
+            editor.addBookmark();
         }
-               return null;
-       }
+        return null;
+    }
 
 }
index 01bd80d0dd592d4ccb95efb002e638560b4ee6de..edbbc0d5b3ede781ea0085f3730b3d97b39ef155 100644 (file)
@@ -27,28 +27,74 @@ import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 
+/**
+ * Base event for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomEvent extends TmfEvent {
 
+    /** Default timestamp scale for text-parser events */
+    public static final byte TIMESTAMP_SCALE = -3;
+
+    /** Input format key */
     protected static final String TIMESTAMP_INPUT_FORMAT_KEY = "CE_TS_I_F"; //$NON-NLS-1$
+
+    /** Empty message */
     protected static final String NO_MESSAGE = ""; //$NON-NLS-1$
-    public static final byte TIMESTAMP_SCALE = -3;
 
+    /** The trace to which this event belongs */
     protected CustomTraceDefinition fDefinition;
+
+    /** The payload data of this event, <field name, value> */
     protected Map<String, String> fData;
+
     private TmfEventField[] fColumnData;
 
+    /**
+     * Basic constructor.
+     *
+     * @param definition
+     *            The trace definition to which this event belongs
+     */
     public CustomEvent(CustomTraceDefinition definition) {
         fDefinition = definition;
         fData = new HashMap<String, String>();
     }
 
+    /**
+     * Build a new CustomEvent from an existing TmfEvent.
+     *
+     * @param definition
+     *            The trace definition to which this event belongs
+     * @param other
+     *            The TmfEvent to copy
+     */
     public CustomEvent(CustomTraceDefinition definition, TmfEvent other) {
         super(other);
         fDefinition = definition;
         fData = new HashMap<String, String>();
     }
 
-    public CustomEvent(CustomTraceDefinition definition, ITmfTrace parentTrace, ITmfTimestamp timestamp, String source, TmfEventType type, String reference) {
+    /**
+     * Full constructor
+     *
+     * @param definition
+     *            Trace definition of this event
+     * @param parentTrace
+     *            Parent trace object
+     * @param timestamp
+     *            Timestamp of this event
+     * @param source
+     *            Source of the event
+     * @param type
+     *            Event type
+     * @param reference
+     *            Event reference
+     */
+    public CustomEvent(CustomTraceDefinition definition, ITmfTrace parentTrace,
+            ITmfTimestamp timestamp, String source, TmfEventType type,
+            String reference) {
         super(parentTrace, timestamp, source, type, null, reference);
         fDefinition = definition;
         fData = new HashMap<String, String>();
@@ -62,6 +108,9 @@ public class CustomEvent extends TmfEvent {
         return super.getTimestamp();
     }
 
+    /**
+     * @return The event fields
+     */
     public TmfEventField[] extractItemFields() {
         if (fData != null) {
             processData();
index 1b0c3ca72c77280da7481cfdd81872c4ed2538a5..7da672d5559721aceec4b9ee232a7fc4b275441f 100644 (file)
@@ -1,25 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
 
+/**
+ * Event content for custom text parsers
+ *
+ * @author Patrick Tassé
+ */
 public class CustomEventContent extends TmfEventField {
 
+    /**
+     * Constructor.
+     *
+     * @param parent
+     *            Parent event
+     * @param content
+     *            Event content
+     */
     public CustomEventContent(CustomEvent parent, StringBuffer content) {
         super(ITmfEventField.ROOT_FIELD_ID, content);
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
     @Override
     public int hashCode() {
         return super.hashCode();
     }
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
     @Override
     public boolean equals(Object obj) {
         if (this == obj) {
@@ -34,6 +53,12 @@ public class CustomEventContent extends TmfEventField {
         return true;
     }
 
+    /**
+     * Modify the fields to the given value.
+     *
+     * @param fields
+     *            The array of fields to use as event content
+     */
     public void setFields(ITmfEventField[] fields) {
         super.setValue(getValue(), fields);
     }
index 326a76d56802a8eb54c6965cfe23ca7a8576e98b..5ed13144d753ffe21e0cc37765ed546b505faa13 100644 (file)
@@ -1,13 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventField;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
 
+/**
+ * Event type for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public abstract class CustomEventType extends TmfEventType {
-    
+
     private static String CONTEXT_ID = "CustomEventType"; //$NON-NLS-1$
-    
+
+    /**
+     * Constructor
+     *
+     * @param definition
+     *            Trace definition
+     */
     public CustomEventType(CustomTraceDefinition definition) {
         super(CONTEXT_ID, definition.definitionName, getRootField(definition));
     }
index 5b166fa209309da8833762f2763eb2bc3996b420..506badaa853de6916ce82a26a700a7bc983f60a3 100644 (file)
@@ -23,26 +23,44 @@ import org.eclipse.linuxtools.tmf.ui.widgets.virtualtable.ColumnData;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
+/**
+ * Events table for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomEventsTable extends TmfEventsTable {
 
     private final CustomTraceDefinition fDefinition;
 
+    /**
+     * Constructor.
+     *
+     * @param definition
+     *            Trace definition object
+     * @param parent
+     *            Parent composite of the view
+     * @param cacheSize
+     *            How many events to keep in cache
+     */
     public CustomEventsTable(CustomTraceDefinition definition, Composite parent, int cacheSize) {
         super(parent, cacheSize, new ColumnData[0]);
         fDefinition = definition;
         createColumnHeaders();
     }
 
+    /**
+     * Create the table's headers.
+     */
     protected void createColumnHeaders() {
-               if (fDefinition == null) {
+        if (fDefinition == null) {
             return;
         }
-       List<ColumnData> columnData = new LinkedList<ColumnData>();
-               for (OutputColumn outputColumn : fDefinition.outputs) {
-                       ColumnData column = new ColumnData(outputColumn.name, 0, SWT.LEFT);
-                       columnData.add(column);
-               }
-       setColumnHeaders(columnData.toArray(new ColumnData[0]));
+        List<ColumnData> columnData = new LinkedList<ColumnData>();
+        for (OutputColumn outputColumn : fDefinition.outputs) {
+            ColumnData column = new ColumnData(outputColumn.name, 0, SWT.LEFT);
+            columnData.add(column);
+        }
+        setColumnHeaders(columnData.toArray(new ColumnData[0]));
     }
 
     @Override
index ef947757581b31cfb8bbdd88f8936b952de2e47e..af367f2df8490c8d9cf0de7eae22623abcee1031 100644 (file)
@@ -18,26 +18,58 @@ import java.util.List;
 import org.eclipse.linuxtools.internal.tmf.ui.Messages;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 
-
+/**
+ * Base class for custom trace definitions.
+ *
+ * @author Patrick Tassé
+ */
 public abstract class CustomTraceDefinition {
 
+    /** "set" action */
     public static final int ACTION_SET = 0;
+
+    /** "append" action */
     public static final int ACTION_APPEND = 1;
+
+    /** "append with separator" action */
     public static final int ACTION_APPEND_WITH_SEPARATOR = 2;
 
+    /** Timestamp tag */
     public static final String TAG_TIMESTAMP = Messages.CustomTraceDefinition_timestampTag;
+
+    /** Message tag */
     public static final String TAG_MESSAGE = Messages.CustomTraceDefinition_messageTag;
+
+    /** "Other" tag */
     public static final String TAG_OTHER = Messages.CustomTraceDefinition_otherTag;
 
+    /** Name of this trace definition */
     public String definitionName;
+
+    /** List of output columns */
     public List<OutputColumn> outputs;
+
+    /** Timestamp format */
     public String timeStampOutputFormat;
 
+    /**
+     * Definition of an output column
+     */
     public static class OutputColumn {
+
+        /** Name of this column */
         public String name;
 
+        /**
+         * Default constructor (empty)
+         */
         public OutputColumn() {}
 
+        /**
+         * Constructor
+         *
+         * @param name Name of this output column
+         */
         public OutputColumn(String name) {
             this.name = name;
         }
@@ -48,11 +80,28 @@ public abstract class CustomTraceDefinition {
         }
     }
 
+    /**
+     * Format a timestamp in this trace's current time stamp format.
+     *
+     * @param timestamp
+     *            The timestamp to format
+     * @return The same timestamp as a formatted string
+     */
     public String formatTimeStamp(TmfTimestamp timestamp) {
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeStampOutputFormat);
         return simpleDateFormat.format(timestamp.getValue());
     }
 
+    /**
+     * Save this custom trace in the default path.
+     */
     public abstract void save();
+
+    /**
+     * Save this custom trace in the supplied path.
+     *
+     * @param path
+     *            The path to save to
+     */
     public abstract void save(String path);
 }
index d6290f930fc24f3065c3d676798b3c6c82c7e292..aad30175d6308fed82d85deb1dc1f95b371f4ac7 100644 (file)
@@ -22,18 +22,55 @@ import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 
+/**
+ * Trace event for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtEvent extends CustomEvent {
 
+    /**
+     * Constructor
+     *
+     * @param definition
+     *            Trace definition
+     */
     public CustomTxtEvent(CustomTxtTraceDefinition definition) {
         super(definition);
         setType(new CustomTxtEventType(definition));
     }
 
+    /**
+     * Construct a custom text event from an existing TmfEvent.
+     *
+     * @param definition
+     *            Trace definition
+     * @param other
+     *            The TmfEvent object to copy
+     */
     public CustomTxtEvent(CustomTxtTraceDefinition definition, TmfEvent other) {
         super(definition, other);
     }
 
-    public CustomTxtEvent(CustomTxtTraceDefinition definition, ITmfTrace parentTrace, ITmfTimestamp timestamp, String source, TmfEventType type, String reference) {
+    /**
+     * Full constructor.
+     *
+     * @param definition
+     *            Trace definition
+     * @param parentTrace
+     *            Parent trace object
+     * @param timestamp
+     *            Timestamp of this event
+     * @param source
+     *            Source of this event
+     * @param type
+     *            Event type
+     * @param reference
+     *            Reference if this event
+     */
+    public CustomTxtEvent(CustomTxtTraceDefinition definition,
+            ITmfTrace parentTrace, ITmfTimestamp timestamp, String source,
+            TmfEventType type, String reference) {
         super(definition, parentTrace, timestamp, source, type, reference);
     }
 
@@ -42,6 +79,14 @@ public class CustomTxtEvent extends CustomEvent {
         super.setContent(content);
     }
 
+    /**
+     * Process an entry in the trace file
+     *
+     * @param input
+     *            The input line to read
+     * @param matcher
+     *            The regex matcher to use
+     */
     public void processGroups(InputLine input, Matcher matcher) {
        if (input.columns == null) {
                return;
index b2b1eedc1006af7e34e4a533ff1753c594ca5b6f..261ab86f487ca9d7cac23b9335c2b253881bab27 100644 (file)
@@ -1,21 +1,32 @@
 /*******************************************************************************
  * Copyright (c) 2010 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 
+/**
+ * Event type for custom text traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtEventType extends CustomEventType {
 
-       public CustomTxtEventType(CustomTxtTraceDefinition definition) {
-               super(definition);
-       }
+    /**
+     * Constructor
+     *
+     * @param definition
+     *            Custom text trace definition
+     */
+    public CustomTxtEventType(CustomTxtTraceDefinition definition) {
+        super(definition);
+    }
 
 }
index c35f3915bef2e9781bc8e1f4f685c69b93f45535..fd5021692de0926ab58e1d2020303093f9179402 100644 (file)
@@ -36,6 +36,11 @@ import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
 import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
 
+/**
+ * Base class for custom plain text traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
 
     private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation((Long) null);
@@ -45,13 +50,35 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
     private final CustomTxtEventType fEventType;
     private BufferedRandomAccessFile fFile;
 
+    /**
+     * Basic constructor.
+     *
+     * @param definition
+     *            Text trace definition
+     */
     public CustomTxtTrace(final CustomTxtTraceDefinition definition) {
         fDefinition = definition;
         fEventType = new CustomTxtEventType(fDefinition);
         setCacheSize(DEFAULT_CACHE_SIZE);
     }
 
-    public CustomTxtTrace(final IResource resource, final CustomTxtTraceDefinition definition, final String path, final int cacheSize) throws TmfTraceException {
+    /**
+     * Full constructor.
+     *
+     * @param resource
+     *            Trace's resource.
+     * @param definition
+     *            Text trace definition
+     * @param path
+     *            Path to the trace file
+     * @param cacheSize
+     *            Cache size to use
+     * @throws TmfTraceException
+     *             If we couldn't open the trace at 'path'
+     */
+    public CustomTxtTrace(final IResource resource,
+            final CustomTxtTraceDefinition definition, final String path,
+            final int cacheSize) throws TmfTraceException {
         this(definition);
         setCacheSize((cacheSize > 0) ? cacheSize : DEFAULT_CACHE_SIZE);
         initTrace(resource, path, CustomTxtEvent.class);
@@ -329,10 +356,20 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
         return event;
     }
 
+    /**
+     * @return The first few lines of the text file
+     */
     public List<InputLine> getFirstLines() {
         return fDefinition.inputs;
     }
 
+    /**
+     * Parse the first line of the trace (to recognize the type).
+     *
+     * @param context
+     *            Trace context
+     * @return The first event
+     */
     public CustomTxtEvent parseFirstLine(final CustomTxtTraceContext context) {
         final CustomTxtEvent event = new CustomTxtEvent(fDefinition, this, TmfTimestamp.ZERO, "", fEventType, ""); //$NON-NLS-1$ //$NON-NLS-2$
         event.processGroups(context.inputLine, context.firstLineMatcher);
@@ -340,6 +377,11 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
         return event;
     }
 
+    /**
+     * Get the trace definition.
+     *
+     * @return The trace definition
+     */
     public CustomTraceDefinition getDefinition() {
         return fDefinition;
     }
index 0a237a60e07fda966a1a7b0f20f57a7d2bf13ec8..a5e115cfffa51bc4147a3015e71d43520fc9015e 100644 (file)
@@ -18,12 +18,33 @@ import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefin
 import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
 
+/**
+ * Trace context for custom text traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtTraceContext extends TmfContext {
+
+    /** Regex matcher for the first line of the trace */
     public Matcher firstLineMatcher;
+
+    /** First line of the text file */
     public String firstLine;
+
+    /** Position in the file where the 'current' next line is */
     public long nextLineLocation;
+
+    /** InputLine object for the currently read line */
     public InputLine inputLine;
 
+    /**
+     * Constructor.
+     *
+     * @param location
+     *            Location in the trace
+     * @param rank
+     *            Rank of the event at this location
+     */
     public CustomTxtTraceContext(ITmfLocation location, long rank) {
         super(location, rank);
     }
index f353121d24978b28def91da37c092cd65d7b0402..e6801ff624744723efa8414df5019ea7e9fef12d 100644 (file)
@@ -47,9 +47,20 @@ import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+/**
+ * Trace definition for custom text traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtTraceDefinition extends CustomTraceDefinition {
 
+    /** Input lines */
+    public List<InputLine> inputs;
+
+    /** File name of the definition file */
     protected static final String CUSTOM_TXT_TRACE_DEFINITIONS_FILE_NAME = "custom_txt_parsers.xml"; //$NON-NLS-1$
+
+    /** Path of the definition file */
     protected static final String CUSTOM_TXT_TRACE_DEFINITIONS_PATH_NAME =
         Activator.getDefault().getStateLocation().addTrailingSeparator().append(CUSTOM_TXT_TRACE_DEFINITIONS_FILE_NAME).toString();
 
@@ -67,46 +78,104 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
     private static final String FORMAT_ATTRIBUTE = Messages.CustomTxtTraceDefinition_format;
     private static final String OUTPUT_COLUMN_ELEMENT = Messages.CustomTxtTraceDefinition_outputColumn;
 
-    public List<InputLine> inputs;
-
+    /**
+     * Default constructor.
+     */
     public CustomTxtTraceDefinition() {
         this("", new ArrayList<InputLine>(0), new ArrayList<OutputColumn>(0), ""); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
-    public CustomTxtTraceDefinition(String logtype, List<InputLine> inputs, List<OutputColumn> outputs, String timeStampOutputFormat) {
+    /**
+     * Full constructor.
+     *
+     * @param logtype
+     *            Name of the trace type
+     * @param inputs
+     *            List of inputs
+     * @param outputs
+     *            List of output columns
+     * @param timeStampOutputFormat
+     *            The timestamp format to use
+     */
+    public CustomTxtTraceDefinition(String logtype, List<InputLine> inputs,
+            List<OutputColumn> outputs, String timeStampOutputFormat) {
         this.definitionName = logtype;
         this.inputs = inputs;
         this.outputs = outputs;
         this.timeStampOutputFormat = timeStampOutputFormat;
     }
 
+    /**
+     * Wrapper to store a line of the log file
+     */
     public static class InputLine {
+
+        /** Data columns of this line */
         public List<InputData> columns;
+
+        /** Cardinality of this line (see {@link Cardinality}) */
         public Cardinality cardinality;
-        private String regex;
-        private Pattern pattern;
+
+        /** Parent line */
         public InputLine parentInput;
+
+        /** Level of this line */
         public int level;
+
+        /** Next input line in the file */
         public InputLine nextInput;
+
+        /** Children of this line (if one "event" spans many lines) */
         public List<InputLine> childrenInputs;
 
+        private String regex;
+        private Pattern pattern;
+
+        /**
+         * Default (empty) constructor.
+         */
         public InputLine() {}
 
+        /**
+         * Constructor.
+         *
+         * @param cardinality Cardinality of this line.
+         * @param regex Regex
+         * @param columns Columns to use
+         */
         public InputLine(Cardinality cardinality, String regex, List<InputData> columns) {
             this.cardinality = cardinality;
             this.regex = regex;
             this.columns = columns;
         }
 
+        /**
+         * Set the regex of this input line
+         *
+         * @param regex
+         *            Regex to set
+         */
         public void setRegex(String regex) {
             this.regex = regex;
             this.pattern = null;
         }
 
+        /**
+         * Get the current regex
+         *
+         * @return The current regex
+         */
         public String getRegex() {
             return regex;
         }
 
+        /**
+         * Get the Pattern object of this line's regex
+         *
+         * @return The Pattern
+         * @throws PatternSyntaxException
+         *             If the regex does not parse correctly
+         */
         public Pattern getPattern() throws PatternSyntaxException {
             if (pattern == null) {
                 pattern = Pattern.compile(regex);
@@ -114,6 +183,12 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             return pattern;
         }
 
+        /**
+         * Add a child line to this line.
+         *
+         * @param input
+         *            The child input line
+         */
         public void addChild(InputLine input) {
             if (childrenInputs == null) {
                 childrenInputs = new ArrayList<InputLine>(1);
@@ -126,6 +201,12 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             input.level = this.level + 1;
         }
 
+        /**
+         * Set the next input line.
+         *
+         * @param input
+         *            The next input line
+         */
         public void addNext(InputLine input) {
             if (parentInput != null) {
                 int index = parentInput.childrenInputs.indexOf(this);
@@ -138,6 +219,9 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             input.level = this.level;
         }
 
+        /**
+         * Move this line up in its parent's children.
+         */
         public void moveUp() {
             if (parentInput != null) {
                 int index = parentInput.childrenInputs.indexOf(this);
@@ -149,6 +233,9 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             }
         }
 
+        /**
+         * Move this line down in its parent's children.
+         */
         public void moveDown() {
             if (parentInput != null) {
                 int index = parentInput.childrenInputs.indexOf(this);
@@ -160,6 +247,12 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             }
         }
 
+        /**
+         * Add a data column to this line
+         *
+         * @param column
+         *            The column to add
+         */
         public void addColumn(InputData column) {
             if (columns == null) {
                 columns = new ArrayList<InputData>(1);
@@ -167,6 +260,13 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             columns.add(column);
         }
 
+        /**
+         * Get the next input lines.
+         *
+         * @param countMap
+         *            The map of line "sets".
+         * @return The next list of lines.
+         */
         public List<InputLine> getNextInputs(Map<InputLine, Integer> countMap) {
             List<InputLine> nextInputs = new ArrayList<InputLine>();
             InputLine next = nextInput;
@@ -190,10 +290,20 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             return nextInputs;
         }
 
+        /**
+         * Get the minimum possible amount of entries.
+         *
+         * @return The minimum
+         */
         public int getMinCount() {
             return cardinality.min;
         }
 
+        /**
+         * Get the maximum possible amount of entries.
+         *
+         * @return The maximum
+         */
         public int getMaxCount() {
             return cardinality.max;
         }
@@ -202,38 +312,83 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
         public String toString() {
             return regex + " " + cardinality; //$NON-NLS-1$
         }
-
     }
 
+    /**
+     * Data column for input lines.
+     */
     public static class InputData {
+
+        /** Name of this column */
         public String name;
+
+        /** Action id */
         public int action;
+
+        /** Format */
         public String format;
 
+        /**
+         * Default (empty) constructor
+         */
         public InputData() {}
 
+        /**
+         * Full constructor
+         *
+         * @param name Name
+         * @param action Action
+         * @param format Format
+         */
         public InputData(String name, int action, String format) {
             this.name = name;
             this.action = action;
             this.format = format;
         }
 
+        /**
+         * Constructor with default format
+         *
+         * @param name Name
+         * @param action Action
+         */
         public InputData(String name, int action) {
             this.name = name;
             this.action = action;
         }
     }
 
+    /**
+     * Input line cardinality
+     */
     public static class Cardinality {
+
+        /** Representation of infinity */
         public final static int INF = Integer.MAX_VALUE;
+
+        /** Preset for [1, 1] */
         public final static Cardinality ONE = new Cardinality(1, 1);
+
+        /** Preset for [1, inf] */
         public final static Cardinality ONE_OR_MORE = new Cardinality(1, INF);
+
+        /** Preset for [0, 1] */
         public final static Cardinality ZERO_OR_ONE = new Cardinality(0, 1);
+
+        /** Preset for [0, inf] */
         public final static Cardinality ZERO_OR_MORE = new Cardinality(0, INF);
 
         private final int min;
         private final int max;
 
+        /**
+         * Constructor.
+         *
+         * @param min
+         *            Minimum
+         * @param max
+         *            Maximum
+         */
         public Cardinality(int min, int max) {
             this.min = min;
             this.max = max;
@@ -244,9 +399,6 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             return "(" + (min >= 0 ? min : "?") + "," + (max == INF ? "\u221E" : (max >= 0 ? max : "?")) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
         }
 
-        /* (non-Javadoc)
-         * @see java.lang.Object#hashCode()
-         */
         @Override
         public int hashCode() {
             final int prime = 31;
@@ -256,9 +408,6 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             return result;
         }
 
-        /* (non-Javadoc)
-         * @see java.lang.Object#equals(java.lang.Object)
-         */
         @Override
         public boolean equals(Object obj) {
             if (this == obj) {
@@ -281,15 +430,15 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
     }
 
     @Override
-       public void save(String path) {
+    public void save(String path) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
-               @Override
-                public InputSource resolveEntity (String publicId, String systemId) {
+            EntityResolver resolver = new EntityResolver() {
+                @Override
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -298,15 +447,18 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
-               @Override
+            db.setErrorHandler(new ErrorHandler() {
+                @Override
                 public void error(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void warning(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             Document doc = null;
             File file = new File(path);
@@ -414,19 +566,31 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
         return inputLineElement;
     }
 
+    /**
+     * Load the default text trace definitions file.
+     *
+     * @return The loaded trace definitions
+     */
     public static CustomTxtTraceDefinition[] loadAll() {
         return loadAll(CUSTOM_TXT_TRACE_DEFINITIONS_PATH_NAME);
     }
 
+    /**
+     * Load a specific text trace definition file.
+     *
+     * @param path
+     *            The path to the file to load
+     * @return The loaded trace definitions
+     */
     public static CustomTxtTraceDefinition[] loadAll(String path) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
-               @Override
-                public InputSource resolveEntity (String publicId, String systemId) {
+            EntityResolver resolver = new EntityResolver() {
+                @Override
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -435,15 +599,18 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
-               @Override
+            db.setErrorHandler(new ErrorHandler() {
+                @Override
                 public void error(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void warning(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             File file = new File(path);
             if (!file.canRead()) {
@@ -478,15 +645,22 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
         return new CustomTxtTraceDefinition[0];
     }
 
+    /**
+     * Load a single definition.
+     *
+     * @param definitionName
+     *            Name of the definition to load
+     * @return The loaded trace definition
+     */
     public static CustomTxtTraceDefinition load(String definitionName) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
-               @Override
-                public InputSource resolveEntity (String publicId, String systemId) {
+            EntityResolver resolver = new EntityResolver() {
+                @Override
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -495,15 +669,18 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
-               @Override
+            db.setErrorHandler(new ErrorHandler() {
+                @Override
                 public void error(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void warning(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             File file = new File(CUSTOM_TXT_TRACE_DEFINITIONS_PATH_NAME);
             Document doc = db.parse(file);
@@ -532,6 +709,13 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
         return null;
     }
 
+    /**
+     * Get the definition from a definition element.
+     *
+     * @param definitionElement
+     *            The Element to extract from
+     * @return The loaded trace definition
+     */
     public static CustomTxtTraceDefinition extractDefinition(Element definitionElement) {
         CustomTxtTraceDefinition def = new CustomTxtTraceDefinition();
 
@@ -598,15 +782,21 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
         return inputLine;
     }
 
+    /**
+     * Delete a definition from the currently loaded ones.
+     *
+     * @param definitionName
+     *            The name of the definition to delete
+     */
     public static void delete(String definitionName) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
-               @Override
-                public InputSource resolveEntity (String publicId, String systemId) {
+            EntityResolver resolver = new EntityResolver() {
+                @Override
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -615,15 +805,18 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
-               @Override
+            db.setErrorHandler(new ErrorHandler() {
+                @Override
                 public void error(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void warning(SAXParseException saxparseexception) throws SAXException {}
-               @Override
+
+                @Override
                 public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             File file = new File(CUSTOM_TXT_TRACE_DEFINITIONS_PATH_NAME);
             Document doc = db.parse(file);
index 6efe4b42cf5a75f841064661aab9040981a991cf..92db1b52870ada230cc11ee3e9d55dfa897749b6 100644 (file)
@@ -18,17 +18,52 @@ import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
 import org.eclipse.linuxtools.tmf.core.event.TmfEventType;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 
+/**
+ * Trace event for custom XML traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlEvent extends CustomEvent {
 
+    /**
+     * Constructor defining only the trace definition
+     *
+     * @param definition
+     *            Trace definition
+     */
     public CustomXmlEvent(CustomXmlTraceDefinition definition) {
         super(definition);
         setType(new CustomXmlEventType(definition));
     }
 
+    /**
+     * Build a custom trace event from an existing TmfEvent.
+     *
+     * @param definition
+     *            Trace definition
+     * @param other
+     *            Other TmfEvent to copy
+     */
     public CustomXmlEvent(CustomXmlTraceDefinition definition, TmfEvent other) {
         super(definition, other);
     }
 
+    /**
+     * Full constructor
+     *
+     * @param definition
+     *            Trace definition
+     * @param parentTrace
+     *            Parent trace object
+     * @param timestamp
+     *            Timestamp of the event
+     * @param source
+     *            Source of the event
+     * @param type
+     *            Event type
+     * @param reference
+     *            Reference of the event
+     */
     public CustomXmlEvent(CustomXmlTraceDefinition definition, ITmfTrace parentTrace, ITmfTimestamp timestamp, String source, TmfEventType type, String reference) {
         super(definition, parentTrace, timestamp, source, type, reference);
     }
@@ -38,6 +73,14 @@ public class CustomXmlEvent extends CustomEvent {
         super.setContent(content);
     }
 
+    /**
+     * Parse an entry.
+     *
+     * @param value Value
+     * @param name Name
+     * @param inputAction Input action
+     * @param inputFormat Input format
+     */
     public void parseInput(String value, String name, int inputAction, String inputFormat) {
         if (value.length() == 0) {
             return;
index 5c86752decd5dd46c0c88334af7457dec4a86129..7b7a01585748c78218f8a3011681ad3d2b33cb34 100644 (file)
@@ -1,19 +1,30 @@
 /*******************************************************************************
  * Copyright (c) 2010 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 
+/**
+ * Event type class for custom XML traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlEventType extends CustomEventType {
 
+    /**
+     * Constructor
+     *
+     * @param definition
+     *            Trace definition
+     */
        public CustomXmlEventType(CustomXmlTraceDefinition definition) {
                super(definition);
        }
index 10cea505f36f9850afe08e0d4d87318240534c45..6ad7f43a240d4b22f4f6dbbdde9be38ad41a5238 100644 (file)
@@ -46,6 +46,11 @@ import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+/**
+ * Trace object for custom XML trace parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
 
     private static final TmfLongLocation NULL_LOCATION = new TmfLongLocation((Long) null);
@@ -56,6 +61,11 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
     private final InputElement fRecordInputElement;
     private BufferedRandomAccessFile fFile;
 
+    /**
+     * Basic constructor
+     *
+     * @param definition Trace definition
+     */
     public CustomXmlTrace(final CustomXmlTraceDefinition definition) {
         fDefinition = definition;
         fEventType = new CustomXmlEventType(fDefinition);
@@ -63,7 +73,23 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
         setCacheSize(DEFAULT_CACHE_SIZE);
     }
 
-    public CustomXmlTrace(final IResource resource, final CustomXmlTraceDefinition definition, final String path, final int pageSize) throws TmfTraceException {
+    /**
+     * Full constructor
+     *
+     * @param resource
+     *            Trace resource
+     * @param definition
+     *            Trace definition
+     * @param path
+     *            Path to the trace/log file
+     * @param pageSize
+     *            Page size to use
+     * @throws TmfTraceException
+     *             If the trace/log couldn't be opened
+     */
+    public CustomXmlTrace(final IResource resource,
+            final CustomXmlTraceDefinition definition, final String path,
+            final int pageSize) throws TmfTraceException {
         this(definition);
         setCacheSize((pageSize > 0) ? pageSize : DEFAULT_CACHE_SIZE);
         initTrace(resource, path, CustomXmlEvent.class);
@@ -350,6 +376,15 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
         }
     }
 
+    /**
+     * Parse an XML element.
+     *
+     * @param parentElement
+     *            The parent element
+     * @param buffer
+     *            The contents to parse
+     * @return The parsed content
+     */
     public static StringBuffer parseElement(final Element parentElement, final StringBuffer buffer) {
         final NodeList nodeList = parentElement.getChildNodes();
         String separator = null;
@@ -381,6 +416,14 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
         return buffer;
     }
 
+    /**
+     * Get an input element if it is a valid record input. If not, we will look
+     * into its children for valid inputs.
+     *
+     * @param inputElement
+     *            The main element to check for.
+     * @return The record element
+     */
     public InputElement getRecordInputElement(final InputElement inputElement) {
         if (inputElement.logEntry) {
             return inputElement;
@@ -395,6 +438,15 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
         return null;
     }
 
+    /**
+     * Extract a trace event from an XML element.
+     *
+     * @param element
+     *            The element
+     * @param inputElement
+     *            The input element
+     * @return The extracted event
+     */
     public CustomXmlEvent extractEvent(final Element element, final InputElement inputElement) {
         final CustomXmlEvent event = new CustomXmlEvent(fDefinition, this, TmfTimestamp.ZERO, "", fEventType,""); //$NON-NLS-1$ //$NON-NLS-2$
         event.setContent(new CustomEventContent(event, new StringBuffer()));
@@ -428,6 +480,11 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
         return;
     }
 
+    /**
+     * Retrieve the trace definition.
+     *
+     * @return The trace definition
+     */
     public CustomTraceDefinition getDefinition() {
         return fDefinition;
     }
index 2501653376a2af442a616e3890b98c4aa88ec110..bc7e1f1ce07c8c70630f03c291cc765a86fa4cf0 100644 (file)
@@ -15,8 +15,21 @@ package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfContext;
 
+/**
+ * Trace context for custom XML traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlTraceContext extends TmfContext {
 
+    /**
+     * Constructor
+     *
+     * @param location
+     *            The location (in the file) of this context
+     * @param rank
+     *            The rank of the event pointed by this context
+     */
     public CustomXmlTraceContext(ITmfLocation location, long rank) {
         super(location, rank);
     }
index 6b49db56d8dd0379584a869a395bb63bddc9d235..3526aaf2572b06d6061d4c259192a3e54333a127 100644 (file)
@@ -44,14 +44,23 @@ import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+/**
+ * Trace definition for custom XML traces.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlTraceDefinition extends CustomTraceDefinition {
 
+    /** "ignore" tag */
+    public static final String TAG_IGNORE = Messages.CustomXmlTraceDefinition_ignoreTag;
+
+    /** Name of the XML definitions file */
     protected static final String CUSTOM_XML_TRACE_DEFINITIONS_FILE_NAME = "custom_xml_parsers.xml"; //$NON-NLS-1$
+
+    /** Path to the XML definitions file */
     protected static final String CUSTOM_XML_TRACE_DEFINITIONS_PATH_NAME =
         Activator.getDefault().getStateLocation().addTrailingSeparator().append(CUSTOM_XML_TRACE_DEFINITIONS_FILE_NAME).toString();
 
-    public static final String TAG_IGNORE = Messages.CustomXmlTraceDefinition_ignoreTag;
-
     private static final String CUSTOM_XML_TRACE_DEFINITION_ROOT_ELEMENT = Messages.CustomXmlTraceDefinition_definitionRootElement;
     private static final String DEFINITION_ELEMENT = Messages.CustomXmlTraceDefinition_definition;
     private static final String NAME_ATTRIBUTE = Messages.CustomXmlTraceDefinition_name;
@@ -64,33 +73,92 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
     private static final String FORMAT_ATTRIBUTE = Messages.CustomXmlTraceDefinition_format;
     private static final String OUTPUT_COLUMN_ELEMENT = Messages.CustomXmlTraceDefinition_outputColumn;
 
+    /** Top-level input element */
     public InputElement rootInputElement;
 
+    /**
+     * Default constructor
+     */
     public CustomXmlTraceDefinition() {
         this("", null, new ArrayList<OutputColumn>(), ""); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
-    public CustomXmlTraceDefinition(String logtype, InputElement rootElement, List<OutputColumn> outputs, String timeStampOutputFormat) {
+    /**
+     * Full constructor
+     *
+     * @param logtype
+     *            Type of trace type
+     * @param rootElement
+     *            The top-level XML element
+     * @param outputs
+     *            The list of output columns
+     * @param timeStampOutputFormat
+     *            The timestamp format to use
+     */
+    public CustomXmlTraceDefinition(String logtype, InputElement rootElement,
+            List<OutputColumn> outputs, String timeStampOutputFormat) {
         this.definitionName = logtype;
         this.rootInputElement = rootElement;
         this.outputs = outputs;
         this.timeStampOutputFormat = timeStampOutputFormat;
     }
 
+    /**
+     * Wrapper for input XML elements
+     */
     public static class InputElement {
+
+        /** Name of the element */
         public String elementName;
+
+        /** Indicates if this is a log entry */
         public boolean logEntry;
+
+        /** Name of the input element */
         public String inputName;
+
+        /** Input action */
         public int inputAction;
+
+        /** Input format */
         public String inputFormat;
+
+        /** XML attributes of this element */
         public List<InputAttribute> attributes;
+
+        /** Parent element */
         public InputElement parentElement;
+
+        /** Following element in the file */
         public InputElement nextElement;
+
+        /** Child elements */
         public List<InputElement> childElements;
 
+        /**
+         * Default (empty) constructor
+         */
         public InputElement() {}
 
-        public InputElement(String elementName, boolean logEntry, String inputName, int inputAction, String inputFormat, List<InputAttribute> attributes) {
+        /**
+         * Constructor
+         *
+         * @param elementName
+         *            Element name
+         * @param logEntry
+         *            If this element is a log entry
+         * @param inputName
+         *            Name of the the input
+         * @param inputAction
+         *            Input action
+         * @param inputFormat
+         *            Input format
+         * @param attributes
+         *            XML attributes of this element
+         */
+        public InputElement(String elementName, boolean logEntry,
+                String inputName, int inputAction, String inputFormat,
+                List<InputAttribute> attributes) {
             this.elementName = elementName;
             this.logEntry = logEntry;
             this.inputName = inputName;
@@ -99,6 +167,12 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             this.attributes = attributes;
         }
 
+        /**
+         * Add a XML attribute to the element
+         *
+         * @param attribute
+         *            The attribute to add
+         */
         public void addAttribute(InputAttribute attribute) {
             if (attributes == null) {
                 attributes = new ArrayList<InputAttribute>(1);
@@ -106,6 +180,12 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             attributes.add(attribute);
         }
 
+        /**
+         * Add a child element to this one.
+         *
+         * @param input
+         *            The input element to add as child
+         */
         public void addChild(InputElement input) {
             if (childElements == null) {
                 childElements = new ArrayList<InputElement>(1);
@@ -117,6 +197,12 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             input.parentElement = this;
         }
 
+        /**
+         * Set the following input element.
+         *
+         * @param input
+         *            The input element to add as next element
+         */
         public void addNext(InputElement input) {
             if (parentElement != null) {
                 int index = parentElement.childElements.indexOf(this);
@@ -128,6 +214,9 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             input.parentElement = this.parentElement;
         }
 
+        /**
+         * Move this element up in its parent's list of children.
+         */
         public void moveUp() {
             if (parentElement != null) {
                 int index = parentElement.childElements.indexOf(this);
@@ -139,6 +228,9 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             }
         }
 
+        /**
+         * Move this element down in its parent's list of children.
+         */
         public void moveDown() {
             if (parentElement != null) {
                 int index = parentElement.childElements.indexOf(this);
@@ -152,15 +244,42 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
 
     }
 
+    /**
+     * Wrapper for XML element attributes
+     */
     public static class InputAttribute {
+
+        /** Name of the XML attribute */
         public String attributeName;
+
+        /** Input name */
         public String inputName;
+
+        /** Input action */
         public int inputAction;
+
+        /** Input format */
         public String inputFormat;
 
+        /**
+         * Default (empty) constructor
+         */
         public InputAttribute() {}
 
-        public InputAttribute(String attributeName, String inputName, int inputAction, String inputFormat) {
+        /**
+         * Constructor
+         *
+         * @param attributeName
+         *            Name of the XML attribute
+         * @param inputName
+         *            Input name
+         * @param inputAction
+         *            Input action
+         * @param inputFormat
+         *            Input format
+         */
+        public InputAttribute(String attributeName, String inputName,
+                int inputAction, String inputFormat) {
             this.attributeName = attributeName;
             this.inputName = inputName;
             this.inputAction = inputAction;
@@ -168,7 +287,7 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
         }
     }
 
-       @Override
+    @Override
     public void save() {
         save(CUSTOM_XML_TRACE_DEFINITIONS_PATH_NAME);
     }
@@ -180,9 +299,9 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
+            EntityResolver resolver = new EntityResolver() {
                 @Override
-                               public InputSource resolveEntity (String publicId, String systemId) {
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -191,15 +310,18 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
+            db.setErrorHandler(new ErrorHandler() {
                 @Override
-                               public void error(SAXParseException saxparseexception) throws SAXException {}
+                public void error(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void warning(SAXParseException saxparseexception) throws SAXException {}
+                public void warning(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void fatalError(SAXParseException saxparseexception) throws SAXException {
+                public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             Document doc = null;
             File file = new File(path);
@@ -314,19 +436,31 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
         return inputElementElement;
     }
 
+    /**
+     * Load all the XML trace definitions in the default definitions file.
+     *
+     * @return The loaded trace definitions
+     */
     public static CustomXmlTraceDefinition[] loadAll() {
         return loadAll(CUSTOM_XML_TRACE_DEFINITIONS_PATH_NAME);
     }
 
+    /**
+     * Load all the XML trace definitions in the given definitions file.
+     *
+     * @param path
+     *            Path to the definitions file to load
+     * @return The loaded trace definitions
+     */
     public static CustomXmlTraceDefinition[] loadAll(String path) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
+            EntityResolver resolver = new EntityResolver() {
                 @Override
-                               public InputSource resolveEntity (String publicId, String systemId) {
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -335,15 +469,18 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
+            db.setErrorHandler(new ErrorHandler() {
                 @Override
-                               public void error(SAXParseException saxparseexception) throws SAXException {}
+                public void error(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void warning(SAXParseException saxparseexception) throws SAXException {}
+                public void warning(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void fatalError(SAXParseException saxparseexception) throws SAXException {
+                public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             File file = new File(path);
             if (!file.canRead()) {
@@ -378,15 +515,22 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
         return new CustomXmlTraceDefinition[0];
     }
 
+    /**
+     * Load the given trace definition.
+     *
+     * @param definitionName
+     *            Name of the XML trace definition to load
+     * @return The loaded trace definition
+     */
     public static CustomXmlTraceDefinition load(String definitionName) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
+            EntityResolver resolver = new EntityResolver() {
                 @Override
-                               public InputSource resolveEntity (String publicId, String systemId) {
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -395,15 +539,18 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
+            db.setErrorHandler(new ErrorHandler() {
                 @Override
-                               public void error(SAXParseException saxparseexception) throws SAXException {}
+                public void error(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void warning(SAXParseException saxparseexception) throws SAXException {}
+                public void warning(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void fatalError(SAXParseException saxparseexception) throws SAXException {
+                public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             File file = new File(CUSTOM_XML_TRACE_DEFINITIONS_PATH_NAME);
             Document doc = db.parse(file);
@@ -432,6 +579,13 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
         return null;
     }
 
+    /**
+     * Extract a trace definition from an XML element.
+     *
+     * @param definitionElement
+     *            Definition element
+     * @return The extracted trace definition
+     */
     public static CustomXmlTraceDefinition extractDefinition(Element definitionElement) {
         CustomXmlTraceDefinition def = new CustomXmlTraceDefinition();
 
@@ -506,15 +660,21 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
         return inputElement;
     }
 
+    /**
+     * Delete the given trace definition from the list of currently loaded ones.
+     *
+     * @param definitionName
+     *            Name of the trace definition to delete
+     */
     public static void delete(String definitionName) {
         try {
             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
             DocumentBuilder db = dbf.newDocumentBuilder();
 
             // The following allows xml parsing without access to the dtd
-            EntityResolver resolver = new EntityResolver () {
+            EntityResolver resolver = new EntityResolver() {
                 @Override
-                               public InputSource resolveEntity (String publicId, String systemId) {
+                public InputSource resolveEntity(String publicId, String systemId) {
                     String empty = ""; //$NON-NLS-1$
                     ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes());
                     return new InputSource(bais);
@@ -523,15 +683,18 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             db.setEntityResolver(resolver);
 
             // The following catches xml parsing exceptions
-            db.setErrorHandler(new ErrorHandler(){
+            db.setErrorHandler(new ErrorHandler() {
                 @Override
-                               public void error(SAXParseException saxparseexception) throws SAXException {}
+                public void error(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void warning(SAXParseException saxparseexception) throws SAXException {}
+                public void warning(SAXParseException saxparseexception) throws SAXException {}
+
                 @Override
-                               public void fatalError(SAXParseException saxparseexception) throws SAXException {
+                public void fatalError(SAXParseException saxparseexception) throws SAXException {
                     throw saxparseexception;
-                }});
+                }
+            });
 
             File file = new File(CUSTOM_XML_TRACE_DEFINITIONS_PATH_NAME);
             Document doc = db.parse(file);
index 541746556b1431d99a071dfe8e848e4b7c0412d4..c275eee8318021459e654a0c30d90d91d45d19d4 100644 (file)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
 
 import java.io.BufferedReader;
@@ -67,6 +79,11 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
+/**
+ * Input wizard page for custom text parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtParserInputWizardPage extends WizardPage {
 
     private static final String DEFAULT_REGEX = "\\s*(.*\\S)"; //$NON-NLS-1$
@@ -115,7 +132,16 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
     private String timeStampFormat;
     private boolean timestampFound;
 
-    protected CustomTxtParserInputWizardPage(ISelection selection, CustomTxtTraceDefinition definition) {
+    /**
+     * Constructor
+     *
+     * @param selection
+     *            The Selection object
+     * @param definition
+     *            The trace definition
+     */
+    protected CustomTxtParserInputWizardPage(ISelection selection,
+            CustomTxtTraceDefinition definition) {
         super("CustomParserWizardPage"); //$NON-NLS-1$
         if (definition == null) {
             setTitle(Messages.CustomTxtParserInputWizardPage_windowTitleNew);
@@ -164,7 +190,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         dateFormatHelpButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_dateFormatHelp);
         dateFormatHelpButton.addSelectionListener(new SelectionAdapter() {
             @Override
-                       public void widgetSelected(SelectionEvent e) {
+            public void widgetSelected(SelectionEvent e) {
                 openHelpShell(SIMPLE_DATE_FORMAT_URL);
             }
         });
@@ -187,7 +213,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         removeButton.setImage(deleteImage);
         removeButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_removeLine);
         removeButton.addSelectionListener(new SelectionAdapter() {
-               @Override
+            @Override
             public void widgetSelected(SelectionEvent e) {
                 if (treeViewer.getSelection().isEmpty() || selectedLine == null) {
                     return;
@@ -235,8 +261,8 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         addChildButton.setImage(addChildImage);
         addChildButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_addChildLine);
         addChildButton.addSelectionListener(new SelectionAdapter() {
-               @Override
-               public void widgetSelected(SelectionEvent e) {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
                 InputLine inputLine = new InputLine(Cardinality.ZERO_OR_MORE, "", null); //$NON-NLS-1$
                 if (((List<?>) treeViewer.getInput()).size() == 0) {
                     definition.inputs.add(inputLine);
@@ -254,7 +280,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         moveUpButton.setImage(moveUpImage);
         moveUpButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_moveUp);
         moveUpButton.addSelectionListener(new SelectionAdapter() {
-               @Override
+            @Override
             public void widgetSelected(SelectionEvent e) {
                 if (treeViewer.getSelection().isEmpty()) {
                     return;
@@ -279,7 +305,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         moveDownButton.setImage(moveDownImage);
         moveDownButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_moveDown);
         moveDownButton.addSelectionListener(new SelectionAdapter() {
-               @Override
+            @Override
             public void widgetSelected(SelectionEvent e) {
                 if (treeViewer.getSelection().isEmpty()) {
                     return;
@@ -368,7 +394,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         highlightAllButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
         highlightAllButton.setText(Messages.CustomTxtParserInputWizardPage_highlightAll);
         highlightAllButton.addSelectionListener(new SelectionAdapter() {
-               @Override
+            @Override
             public void widgetSelected(SelectionEvent e) {
                 updatePreviews(true);
             }
@@ -379,7 +405,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         legendButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_previewLegend);
         legendButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
         legendButton.addSelectionListener(new SelectionAdapter() {
-               @Override
+            @Override
             public void widgetSelected(SelectionEvent e) {
                 openLegend();
             }
@@ -411,12 +437,12 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
 
     private static class InputLineTreeNodeContentProvider implements ITreeContentProvider {
 
-       @Override
+        @Override
         public Object[] getElements(Object inputElement) {
             return ((List<?>) inputElement).toArray();
         }
 
-       @Override
+        @Override
         public Object[] getChildren(Object parentElement) {
             InputLine inputLine = (InputLine) parentElement;
             if (inputLine.childrenInputs == null) {
@@ -425,21 +451,21 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
             return inputLine.childrenInputs.toArray();
         }
 
-       @Override
+        @Override
         public boolean hasChildren(Object element) {
             InputLine inputLine = (InputLine) element;
             return (inputLine.childrenInputs != null && inputLine.childrenInputs.size() > 0);
         }
 
-       @Override
+        @Override
         public void dispose() {
         }
 
-       @Override
+        @Override
         public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
         }
 
-       @Override
+        @Override
         public Object getParent(Object element) {
             InputLine inputLine = (InputLine) element;
             return inputLine.parentInput;
@@ -464,7 +490,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
     }
 
     private class InputLineTreeSelectionChangedListener implements ISelectionChangedListener {
-       @Override
+        @Override
         public void selectionChanged(SelectionChangedEvent event) {
             if (selectedLine != null) {
                 selectedLine.dispose();
@@ -474,7 +500,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
                 InputLine inputLine = (InputLine) selection.getFirstElement();
                 selectedLine = new Line(lineContainer, getName(inputLine), inputLine);
                 lineContainer.layout();
-                lineScrolledComposite.setMinSize(lineContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, lineContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).y-1);
+                lineScrolledComposite.setMinSize(lineContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, lineContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).y - 1);
                 container.layout();
                 validate();
                 updatePreviews();
@@ -511,6 +537,11 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         return getName(inputLine.parentInput) + "." + Integer.toString(inputLine.parentInput.childrenInputs.indexOf(inputLine)+1); //$NON-NLS-1$
     }
 
+    /**
+     * Get the global list of input names.
+     *
+     * @return The list of input names
+     */
     public List<String> getInputNames() {
         List<String> inputs = new ArrayList<String>();
         for (InputLine inputLine : definition.inputs) {
@@ -523,6 +554,13 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         return inputs;
     }
 
+    /**
+     * Get the list of input names for the given input line.
+     *
+     * @param inputLine
+     *            The input line
+     * @return The list of input names
+     */
     public List<String> getInputNames(InputLine inputLine) {
         List<String> inputs = new ArrayList<String>();
         if (inputLine.columns != null) {
@@ -877,12 +915,12 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         helpShell.setLayout(new FillLayout());
         helpBrowser = new Browser(helpShell, SWT.NONE);
         helpBrowser.addTitleListener(new TitleListener() {
-               @Override
-           public void changed(TitleEvent event) {
-               helpShell.setText(event.title);
-           }
+            @Override
+            public void changed(TitleEvent event) {
+                helpShell.setText(event.title);
+            }
         });
-        helpBrowser.setBounds(0,0,600,400);
+        helpBrowser.setBounds(0, 0, 600, 400);
         helpShell.pack();
         helpShell.open();
         helpBrowser.setUrl(url);
@@ -929,19 +967,19 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
 
     private class UpdateListener implements ModifyListener, SelectionListener {
 
-       @Override
+        @Override
         public void modifyText(ModifyEvent e) {
             validate();
             updatePreviews();
         }
 
-       @Override
+        @Override
         public void widgetDefaultSelected(SelectionEvent e) {
             validate();
             updatePreviews();
         }
 
-       @Override
+        @Override
         public void widgetSelected(SelectionEvent e) {
             validate();
             updatePreviews();
@@ -1002,8 +1040,8 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
             regexHelpButton.setImage(helpImage);
             regexHelpButton.setToolTipText(Messages.CustomTxtParserInputWizardPage_regularExpressionHelp);
             regexHelpButton.addSelectionListener(new SelectionAdapter() {
-               @Override
-               public void widgetSelected(SelectionEvent e) {
+                @Override
+                public void widgetSelected(SelectionEvent e) {
                     openHelpShell(PATTERN_URL);
                 }
             });
@@ -1026,13 +1064,14 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
                     Cardinality.ZERO_OR_ONE.toString(),
                     Cardinality.ONE.toString(),
                     "(?,?)"}); //$NON-NLS-1$
-            cardinalityCombo.addSelectionListener(new SelectionListener(){
-               @Override
+            cardinalityCombo.addSelectionListener(new SelectionListener() {
+                @Override
                 public void widgetDefaultSelected(SelectionEvent e) {}
-               @Override
+
+                @Override
                 public void widgetSelected(SelectionEvent e) {
                     switch (cardinalityCombo.getSelectionIndex()) {
-                    case 4: //(?,?)
+                    case 4: // (?,?)
                         cardinalityMinLabel.setVisible(true);
                         cardinalityMinText.setVisible(true);
                         cardinalityMaxLabel.setVisible(true);
@@ -1050,7 +1089,8 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
                     cardinalityContainer.layout();
                     validate();
                     updatePreviews();
-                }});
+                }
+            });
 
             cardinalityMinLabel = new Label(cardinalityContainer, SWT.NONE);
             cardinalityMinLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
@@ -1464,6 +1504,15 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         }
     }
 
+    /**
+     * Validate an input line.
+     *
+     * @param inputLine
+     *            The line to clean up
+     * @param name
+     *            The name of the line
+     * @return The cleaned up line
+     */
     public StringBuffer validateLine(InputLine inputLine, String name) {
         StringBuffer errors = new StringBuffer();
         Line line = null;
@@ -1552,10 +1601,20 @@ public class CustomTxtParserInputWizardPage extends WizardPage {
         return errors;
     }
 
+    /**
+     * Get the trace definition.
+     *
+     * @return The trace definition
+     */
     public CustomTxtTraceDefinition getDefinition() {
         return definition;
     }
 
+    /**
+     * Get the raw text of the input.
+     *
+     * @return The raw input text
+     */
     public char[] getInputText() {
         return inputText.getText().toCharArray();
     }
index 377f54475fe1f64ae3e9fd8f6f79d1e8757114aa..f9b443c99f97188a87302d22e91b46b5abd0d9ed 100644 (file)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
 
 import java.io.File;
@@ -16,8 +28,6 @@ import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;
 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.custom.ScrolledComposite;
@@ -30,6 +40,11 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 
+/**
+ * Output wizard page for custom text trace parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtParserOutputWizardPage extends WizardPage {
 
     private static final Image upImage = Activator.getDefault().getImageFromPath("/icons/elcl16/up_button.gif"); //$NON-NLS-1$
@@ -49,6 +64,12 @@ public class CustomTxtParserOutputWizardPage extends WizardPage {
     CustomEventsTable previewTable;
     File tmpFile;
 
+    /**
+     * Constructor
+     *
+     * @param wizard
+     *            The wizard to which this page belongs
+     */
     protected CustomTxtParserOutputWizardPage(final CustomTxtParserWizard wizard) {
         super("CustomParserOutputWizardPage"); //$NON-NLS-1$
         setTitle(wizard.inputPage.getTitle());
@@ -222,6 +243,11 @@ public class CustomTxtParserOutputWizardPage extends WizardPage {
         container.layout();
     }
 
+    /**
+     * Extract the list of output columns from the page's contents.
+     *
+     * @return The output columns
+     */
     public List<OutputColumn> extractOutputs() {
         int numColumns = 0;
         for (int i = 0; i < outputs.size(); i++) {
@@ -301,6 +327,11 @@ public class CustomTxtParserOutputWizardPage extends WizardPage {
         }
     }
 
+    /**
+     * Get the trace definition.
+     *
+     * @return The trace definition
+     */
     public CustomTxtTraceDefinition getDefinition() {
         return definition;
     }
index 78d1fea2bb2341a87f054941acbdef937d038f19..5ecaa03afd145911f436af28727a23c220ebdb46 100644 (file)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
 
 import org.eclipse.jface.viewers.ISelection;
@@ -7,6 +19,11 @@ import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefin
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 
+/**
+ * Wizard for custom text trace parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomTxtParserWizard extends Wizard implements INewWizard {
 
     CustomTxtParserInputWizardPage inputPage;
@@ -14,10 +31,19 @@ public class CustomTxtParserWizard extends Wizard implements INewWizard {
     private ISelection selection;
     CustomTxtTraceDefinition definition;
 
+    /**
+     * Default constructor
+     */
     public CustomTxtParserWizard() {
         super();
     }
 
+    /**
+     * Constructor
+     *
+     * @param definition
+     *            The trace definition
+     */
     public CustomTxtParserWizard(CustomTxtTraceDefinition definition) {
         super();
         this.definition = definition;
@@ -33,19 +59,15 @@ public class CustomTxtParserWizard extends Wizard implements INewWizard {
         return true;
     }
 
-    /**
-     * Adding the page to the wizard.
-     */
-
     @Override
-       public void addPages() {
+    public void addPages() {
         inputPage = new CustomTxtParserInputWizardPage(selection, definition);
         addPage(inputPage);
         outputPage = new CustomTxtParserOutputWizardPage(this);
         addPage(outputPage);
     }
 
-       @Override
+    @Override
     public void init(IWorkbench workbench, IStructuredSelection selection) {
         this.selection = selection;
     }
index 58aa11eebcb433b72238160efcdd04790ff2711f..b01d55403aa09b108833627026ab0b188bbfc5ce 100644 (file)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
 
 import java.io.BufferedReader;
@@ -74,6 +86,11 @@ import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
+/**
+ * Input wizard page for custom XML trace parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlParserInputWizardPage extends WizardPage {
 
     private static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; //$NON-NLS-1$
@@ -125,6 +142,14 @@ public class CustomXmlParserInputWizardPage extends WizardPage {
     private int logEntriesCount;
     private boolean logEntryFound;
 
+    /**
+     * Constructor
+     *
+     * @param selection
+     *            Selection object
+     * @param definition
+     *            Trace definition
+     */
     protected CustomXmlParserInputWizardPage(ISelection selection, CustomXmlTraceDefinition definition) {
         super("CustomXmlParserWizardPage"); //$NON-NLS-1$
         if (definition == null) {
@@ -611,10 +636,22 @@ public class CustomXmlParserInputWizardPage extends WizardPage {
         super.setVisible(visible);
     }
 
+    /**
+     * Get the global list of input names.
+     *
+     * @return The list of input names
+     */
     public List<String> getInputNames() {
         return getInputNames(definition.rootInputElement);
     }
 
+    /**
+     * Get the list of input names for a given element.
+     *
+     * @param inputElement
+     *            The element
+     * @return The input names for this element
+     */
     public List<String> getInputNames(InputElement inputElement) {
         List<String> inputs = new ArrayList<String>();
         if (inputElement.inputName != null && !inputElement.inputName.equals(CustomXmlTraceDefinition.TAG_IGNORE)) {
@@ -1508,6 +1545,13 @@ public class CustomXmlParserInputWizardPage extends WizardPage {
         }
     }
 
+    /**
+     * Clean up the specified XML element.
+     *
+     * @param inputElement
+     *            The element to clean up
+     * @return The validated element
+     */
     public StringBuffer validateElement(InputElement inputElement) {
         StringBuffer errors = new StringBuffer();
         ElementNode elementNode = null;
@@ -1681,10 +1725,20 @@ public class CustomXmlParserInputWizardPage extends WizardPage {
         return errors;
     }
 
+    /**
+     * Get the trace definition.
+     *
+     * @return The trace definition
+     */
     public CustomXmlTraceDefinition getDefinition() {
         return definition;
     }
 
+    /**
+     * Get the raw text input.
+     *
+     * @return The raw text input.
+     */
     public char[] getInputText() {
         return inputText.getText().toCharArray();
     }
index 3b4eb929f569d1fd031abaef64708bc781de1b67..1c83ba9572c4fb55e9a07a0dead935f3a0103441 100644 (file)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
 
 import java.io.File;
@@ -17,7 +29,6 @@ import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;
 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition;
 import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
-import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.custom.ScrolledComposite;
@@ -30,6 +41,11 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 
+/**
+ * Output wizard page for custom XML trace parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlParserOutputWizardPage extends WizardPage {
 
     private static final Image upImage = Activator.getDefault().getImageFromPath("/icons/elcl16/up_button.gif"); //$NON-NLS-1$
@@ -49,6 +65,12 @@ public class CustomXmlParserOutputWizardPage extends WizardPage {
     CustomEventsTable previewTable;
     File tmpFile;
 
+    /**
+     * Constructor
+     *
+     * @param wizard
+     *            The wizard to which this page belongs
+     */
     protected CustomXmlParserOutputWizardPage(final CustomXmlParserWizard wizard) {
         super("CustomParserOutputWizardPage"); //$NON-NLS-1$
         setTitle(wizard.inputPage.getTitle());
@@ -222,6 +244,11 @@ public class CustomXmlParserOutputWizardPage extends WizardPage {
         container.layout();
     }
 
+    /**
+     * Extract the output columns from the page's current contents.
+     *
+     * @return The list of output columns
+     */
     public List<OutputColumn> extractOutputs() {
         int numColumns = 0;
         for (int i = 0; i < outputs.size(); i++) {
@@ -301,6 +328,11 @@ public class CustomXmlParserOutputWizardPage extends WizardPage {
         }
     }
 
+    /**
+     * Get the trace definition.
+     *
+     * @return The trace definition
+     */
     public CustomXmlTraceDefinition getDefinition() {
         return definition;
     }
index d51b9e1c28db5eb26e80f6e6b5a1e781713b7b3c..fc17585b8c27cf8bbc2885b8184a087db139a22c 100644 (file)
@@ -1,3 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Patrick Tassé - Initial API and implementation
+ *******************************************************************************/
+
 package org.eclipse.linuxtools.internal.tmf.ui.parsers.wizards;
 
 import org.eclipse.jface.viewers.ISelection;
@@ -7,6 +19,11 @@ import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefin
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 
+/**
+ * Wizard for custom XML trace parsers.
+ *
+ * @author Patrick Tassé
+ */
 public class CustomXmlParserWizard extends Wizard implements INewWizard {
 
     CustomXmlParserInputWizardPage inputPage;
@@ -14,10 +31,19 @@ public class CustomXmlParserWizard extends Wizard implements INewWizard {
     private ISelection selection;
     CustomXmlTraceDefinition definition;
 
+    /**
+     * Default constructor
+     */
     public CustomXmlParserWizard() {
         super();
     }
 
+    /**
+     * Constructor
+     *
+     * @param definition
+     *            The trace definition
+     */
     public CustomXmlParserWizard(CustomXmlTraceDefinition definition) {
         super();
         this.definition = definition;
@@ -38,7 +64,7 @@ public class CustomXmlParserWizard extends Wizard implements INewWizard {
      */
 
     @Override
-       public void addPages() {
+    public void addPages() {
         inputPage = new CustomXmlParserInputWizardPage(selection, definition);
         addPage(inputPage);
         outputPage = new CustomXmlParserOutputWizardPage(this);
@@ -46,7 +72,7 @@ public class CustomXmlParserWizard extends Wizard implements INewWizard {
     }
 
     @Override
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
         this.selection = selection;
     }
 
index 2a120b14ec064684d4d9c0c0c53e3c81cf77feaa..4b93819f694d1dbad0ecdd8fd1c6d9509e4a2bc7 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *******************************************************************************/
@@ -14,13 +14,17 @@ package org.eclipse.linuxtools.internal.tmf.ui.project.dialogs;
 
 import org.eclipse.osgi.util.NLS;
 
+/**
+ * Message bundle for dialog messages.
+ */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
 
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.tmf.ui.project.dialogs.messages"; //$NON-NLS-1$
 
     public static String SelectSpplementaryResources_DialogTitle;
     public static String SelectSpplementaryResources_ResourcesGroupTitle;
-    
+
     static {
         // initialize resource bundle
         NLS.initializeMessages(BUNDLE_NAME, Messages.class);
index 4fc9e796db73fce6449cddb81fcef9fd4cbe189f..bab45ce7d884c4dc3ce229fa54c79182317833f6 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2009, 2011 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Copied and adapted from NewFolderDialog
  *******************************************************************************/
@@ -35,8 +35,7 @@ import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.PlatformUI;
 
 /**
- * <b><u>SelectSupplementaryResourcesDialog</u></b>
- * <p>
+ * SelectSupplementaryResourcesDialog
  */
 public class SelectSupplementaryResourcesDialog extends Dialog {
 
@@ -51,6 +50,14 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
     // Constructor
     // ------------------------------------------------------------------------
 
+    /**
+     * Constructor.
+     *
+     * @param shell
+     *            Parent shell of this dialog
+     * @param resources
+     *            Available resources
+     */
     public SelectSupplementaryResourcesDialog(Shell shell, IResource[] resources) {
         super(shell);
         fAvailableResources = Arrays.copyOf(resources, resources.length);
@@ -60,11 +67,14 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
     // ------------------------------------------------------------------------
     // Getters/Setters
     // ------------------------------------------------------------------------
-    
+
+    /**
+     * @return A copy of the resources
+     */
     public IResource[] getResources() {
         return Arrays.copyOf(fReturndResources, fReturndResources.length);
     }
-    
+
     // ------------------------------------------------------------------------
     // Dialog
     // ------------------------------------------------------------------------
@@ -79,7 +89,7 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
         newShell.setText(Messages.SelectSpplementaryResources_DialogTitle);
         newShell.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ETOOL_DELETE));
     }
-    
+
     @Override
     protected Control createDialogArea(Composite parent) {
         Composite composite = (Composite) super.createDialogArea(parent);
@@ -90,7 +100,7 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
         contextGroup.setText(Messages.SelectSpplementaryResources_ResourcesGroupTitle);
         contextGroup.setLayout(new GridLayout());
         contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-        
+
         fTreeViewer = new CheckboxTreeViewer(contextGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
         GridData data = new GridData(GridData.FILL_BOTH);
         Tree tree = fTreeViewer.getTree();
@@ -128,22 +138,22 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
                 if (parentElement instanceof IResource[]) {
                     return (Object[]) parentElement;
                 }
-                return null;            
+                return null;
             }
         });
 
 //        fTreeViewer.setLabelProvider(new WorkbenchLabelProvider());
-        
+
       fTreeViewer.setLabelProvider(new LabelProvider() {
           @Override
           public String getText(Object element) {
               if (element instanceof IResource) {
                   IResource resource = (IResource) element;
-                  // show also trace name 
+                  // show also trace name
                   return resource.getParent().getName() + File.separator + resource.getName();
               }
               return super.getText(element);
-          } 
+          }
       });
         fTreeViewer.setInput(fAvailableResources);
 
@@ -173,5 +183,4 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
         super.okPressed();
     }
 
-
 }
index 6db3a62f1f722cd0385687dd8fb1e310abbd141e..60ab1ea0987113d7eb3fc0f381cdf6ae9abf1253 100644 (file)
@@ -40,6 +40,11 @@ import org.eclipse.ui.actions.CompoundContributionItem;
 import org.eclipse.ui.menus.CommandContributionItem;
 import org.eclipse.ui.menus.CommandContributionItemParameter;
 
+/**
+ * ContributionItem for the trace type selection.
+ *
+ * @author Patrick Tassé
+ */
 public class SelectTraceTypeContributionItem extends CompoundContributionItem {
 
     //private static final ImageDescriptor SELECTED_ICON = ImageDescriptor.createFromImage(TmfUiPlugin.getDefault().getImageFromPath("icons/elcl16/bullet.gif")); //$NON-NLS-1$
index 886b39973c87a020d610a6730e83a44054c84056..365d3fe3a3af0775165f811d5e79f7cda87e2b1d 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
 * Copyright (c) 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *******************************************************************************/
@@ -20,6 +20,11 @@ import org.eclipse.ui.navigator.ICommonActionExtensionSite;
 import org.eclipse.ui.navigator.ICommonViewerSite;
 import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
 
+/**
+ * Base action provider.
+ *
+ * @author Patrick Tassé
+ */
 public class TmfActionProvider extends CommonActionProvider {
 
     private OpenAction openAction;
index 9d852e75d074901672c83b9ddc7afbfe287813cb..00a85c1fdd2f0bb298131926e63a849583490b5e 100644 (file)
@@ -199,23 +199,25 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     // Table data
     // ------------------------------------------------------------------------
 
-    protected Composite fComposite;
-    protected SashForm fSashForm;
+    /** The virtual event table */
     protected TmfVirtualTable fTable;
-    protected TmfRawEventViewer fRawViewer;
-    protected ITmfTrace fTrace;
-    protected boolean fPackDone = false;
-    protected HeaderState fHeaderState = HeaderState.SEARCH;
-    protected long fSelectedRank = 0;
+
+    private Composite fComposite;
+    private SashForm fSashForm;
+    private TmfRawEventViewer fRawViewer;
+    private ITmfTrace fTrace;
+    private boolean fPackDone = false;
+    private HeaderState fHeaderState = HeaderState.SEARCH;
+    private long fSelectedRank = 0;
 
     // Filter data
-    protected long fFilterMatchCount;
-    protected long fFilterCheckCount;
-    protected FilterThread fFilterThread;
-    protected boolean fFilterThreadResume = false;
-    protected final Object fFilterSyncObj = new Object();
-    protected SearchThread fSearchThread;
-    protected final Object fSearchSyncObj = new Object();
+    private long fFilterMatchCount;
+    private long fFilterCheckCount;
+    private FilterThread fFilterThread;
+    private boolean fFilterThreadResume = false;
+    private final Object fFilterSyncObj = new Object();
+    private SearchThread fSearchThread;
+    private final Object fSearchSyncObj = new Object();
 
     /**
      * List of selection change listeners (element type: <code>ISelectionChangedListener</code>).
@@ -225,22 +227,22 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     private ListenerList selectionChangedListeners = new ListenerList();
 
     // Bookmark map <Rank, MarkerId>
-    protected Map<Long, Long> fBookmarksMap = new HashMap<Long, Long>();
-    protected IFile fBookmarksFile;
-    protected long fPendingGotoRank = -1;
+    private Map<Long, Long> fBookmarksMap = new HashMap<Long, Long>();
+    private IFile fBookmarksFile;
+    private long fPendingGotoRank = -1;
 
     // SWT resources
-    protected LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
-    protected Color fGrayColor;
-    protected Color fGreenColor;
-    protected Font fBoldFont;
+    private LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
+    private Color fGrayColor;
+    private Color fGreenColor;
+    private Font fBoldFont;
 
     // Table column names
-    static private final String[] COLUMN_NAMES = new String[] { Messages.TmfEventsTable_TimestampColumnHeader,
+    private static final String[] COLUMN_NAMES = new String[] { Messages.TmfEventsTable_TimestampColumnHeader,
         Messages.TmfEventsTable_SourceColumnHeader, Messages.TmfEventsTable_TypeColumnHeader,
         Messages.TmfEventsTable_ReferenceColumnHeader, Messages.TmfEventsTable_ContentColumnHeader };
 
-    static private final ColumnData[] COLUMN_DATA = new ColumnData[] { new ColumnData(COLUMN_NAMES[0], 100, SWT.LEFT),
+    private static final ColumnData[] COLUMN_DATA = new ColumnData[] { new ColumnData(COLUMN_NAMES[0], 100, SWT.LEFT),
         new ColumnData(COLUMN_NAMES[1], 100, SWT.LEFT), new ColumnData(COLUMN_NAMES[2], 100, SWT.LEFT),
         new ColumnData(COLUMN_NAMES[3], 100, SWT.LEFT), new ColumnData(COLUMN_NAMES[4], 100, SWT.LEFT) };
 
@@ -254,7 +256,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     private boolean fDisposeOnClose;
 
     // ------------------------------------------------------------------------
-    // Constructor
+    // Constructors
     // ------------------------------------------------------------------------
 
     /**
@@ -524,6 +526,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         createPopupMenu();
     }
 
+    /**
+     * Create a pop-up menu.
+     */
     protected void createPopupMenu() {
         final IAction showTableAction = new Action(Messages.TmfEventsTable_ShowTableActionText) {
             @Override
@@ -688,12 +693,24 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
 
-    @SuppressWarnings("unused")
+    /**
+     * Append an item to the event table's pop-up menu.
+     *
+     * @param tablePopupMenu
+     *            The menu manager
+     * @param selectedItem
+     *            The item to append
+     */
     protected void appendToTablePopupMenu(final MenuManager tablePopupMenu, final TableItem selectedItem) {
         // override to append more actions
     }
 
-    @SuppressWarnings("unused")
+    /**
+     * Append an item to the raw viewer's pop-up menu.
+     *
+     * @param rawViewerPopupMenu
+     *            The menu manager
+     */
     protected void appendToRawPopupMenu(final MenuManager rawViewerPopupMenu) {
         // override to append more actions
     }
@@ -739,6 +756,16 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fTable.setColumnHeaders(columnData);
     }
 
+    /**
+     * Set a table item's data.
+     *
+     * @param item
+     *            The item to set
+     * @param event
+     *            Which trace event to link with this entry
+     * @param rank
+     *            Which rank this event has in the trace/experiment
+     */
     protected void setItemData(final TableItem item, final ITmfEvent event, final long rank) {
         final ITmfEventField[] fields = extractItemFields(event);
         final String[] content = new String[fields.length];
@@ -797,6 +824,12 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Set the item data of the header row.
+     *
+     * @param item
+     *            The item to use as table header
+     */
     protected void setHeaderRowItemData(final TableItem item) {
         String txtKey = null;
         if (fHeaderState == HeaderState.SEARCH) {
@@ -826,6 +859,12 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Set the item data of the "filter status" row.
+     *
+     * @param item
+     *            The item to use as filter status row
+     */
     protected void setFilterStatusRowItemData(final TableItem item) {
         for (int i = 0; i < fTable.getColumns().length; i++) {
             if (i == 0) {
@@ -846,6 +885,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         item.setBackground(null);
     }
 
+    /**
+     * Create an editor for the header.
+     */
     protected void createHeaderEditor() {
         final TableEditor tableEditor = fTable.createTableEditor();
         tableEditor.horizontalAlignment = SWT.LEFT;
@@ -1055,14 +1097,29 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         });
     }
 
+    /**
+     * Send an event indicating a filter has been applied.
+     *
+     * @param filter
+     *            The filter that was just applied
+     */
     protected void fireFilterApplied(final ITmfFilter filter) {
         broadcast(new TmfEventFilterAppliedSignal(this, fTrace, filter));
     }
 
+    /**
+     * Send an event indicating that a search has been applied.
+     *
+     * @param filter
+     *            The search filter that was just applied
+     */
     protected void fireSearchApplied(final ITmfFilter filter) {
         broadcast(new TmfEventSearchAppliedSignal(this, fTrace, filter));
     }
 
+    /**
+     * Start the filtering thread.
+     */
     protected void startFilterThread() {
         synchronized (fFilterSyncObj) {
             final ITmfFilterTreeNode filter = (ITmfFilterTreeNode) fTable.getData(Key.FILTER_OBJ);
@@ -1079,6 +1136,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Stop the filtering thread.
+     */
     protected void stopFilterThread() {
         synchronized (fFilterSyncObj) {
             if (fFilterThread != null) {
@@ -1090,6 +1150,10 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
     /**
+     * Apply a filter.
+     *
+     * @param filter
+     *            The filter to apply
      * @since 1.1
      */
     protected void applyFilter(ITmfFilter filter) {
@@ -1105,6 +1169,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fireFilterApplied(filter);
     }
 
+    /**
+     * Clear all currently active filters.
+     */
     protected void clearFilters() {
         if (fTable.getData(Key.FILTER_OBJ) == null) {
             return;
@@ -1133,6 +1200,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fireFilterApplied(null);
     }
 
+    /**
+     * Wrapper Thread object for the filtering thread.
+     */
     protected class FilterThread extends Thread {
         private final ITmfFilterTreeNode filter;
         private TmfDataRequest request;
@@ -1140,6 +1210,12 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         private boolean refreshPending = false;
         private final Object syncObj = new Object();
 
+        /**
+         * Constructor.
+         *
+         * @param filter
+         *            The filter this thread will be processing
+         */
         public FilterThread(final ITmfFilterTreeNode filter) {
             super("Filter Thread"); //$NON-NLS-1$
             this.filter = filter;
@@ -1190,6 +1266,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             }
         }
 
+        /**
+         * Refresh the filter.
+         */
         public void refreshTable() {
             synchronized (syncObj) {
                 if (refreshBusy) {
@@ -1220,6 +1299,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
             });
         }
 
+        /**
+         * Cancel this filtering thread.
+         */
         public void cancel() {
             if (request != null) {
                 request.cancel();
@@ -1227,6 +1309,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Go to the next item of a search.
+     */
     protected void searchNext() {
         synchronized (fSearchSyncObj) {
             if (fSearchThread != null) {
@@ -1254,6 +1339,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Go to the previous item of a search.
+     */
     protected void searchPrevious() {
         synchronized (fSearchSyncObj) {
             if (fSearchThread != null) {
@@ -1281,6 +1369,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Stop the search thread.
+     */
     protected void stopSearchThread() {
         fPendingGotoRank = -1;
         synchronized (fSearchSyncObj) {
@@ -1291,17 +1382,36 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Wrapper for the search thread.
+     */
     protected class SearchThread extends Job {
-        protected ITmfFilterTreeNode searchFilter;
-        protected ITmfFilterTreeNode eventFilter;
-        protected int startIndex;
-        protected int direction;
-        protected long rank;
-        protected long foundRank = -1;
-        protected TmfDataRequest request;
+
+        private ITmfFilterTreeNode searchFilter;
+        private ITmfFilterTreeNode eventFilter;
+        private int startIndex;
+        private int direction;
+        private long rank;
+        private long foundRank = -1;
+        private TmfDataRequest request;
         private ITmfTimestamp foundTimestamp = null;
 
-        public SearchThread(final ITmfFilterTreeNode searchFilter, final ITmfFilterTreeNode eventFilter, final int startIndex,
+        /**
+         * Constructor.
+         *
+         * @param searchFilter
+         *            The search filter
+         * @param eventFilter
+         *            The event filter
+         * @param startIndex
+         *            The index at which we should start searching
+         * @param currentRank
+         *            The current rank
+         * @param direction
+         *            In which direction should we search, forward or backwards
+         */
+        public SearchThread(final ITmfFilterTreeNode searchFilter,
+                final ITmfFilterTreeNode eventFilter, final int startIndex,
                 final long currentRank, final int direction) {
             super(Messages.TmfEventsTable_SearchingJobName);
             this.searchFilter = searchFilter;
@@ -1454,6 +1564,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Create the resources.
+     */
     protected void createResources() {
         fGrayColor = fResourceManager.createColor(ColorUtil.blend(fTable.getBackground().getRGB(), fTable
                 .getForeground().getRGB()));
@@ -1461,6 +1574,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fBoldFont = fResourceManager.createFont(FontDescriptor.createFrom(fTable.getFont()).setStyle(SWT.BOLD));
     }
 
+    /**
+     * Pack the columns.
+     */
     protected void packColumns() {
         if (fPackDone) {
             return;
@@ -1487,8 +1603,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
     }
 
     /**
+     * Extract the fields of an event (item in the table).
+     *
      * @param event
-     * @return
+     *            The event to extract from
+     * @return The array of fields
      *
      *         FIXME: Add support for column selection
      */
@@ -1604,6 +1723,9 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         }
     }
 
+    /**
+     * Callback for when populating the table is complete.
+     */
     protected void populateCompleted() {
         // Nothing by default;
     }
index 4d894b811488b0ab236f368c4662f23f28a46113..db230368c1ede2aa156bff7e94b5a8bba54d3b94 100755 (executable)
@@ -131,11 +131,11 @@ public class TmfStatisticsTree {
     /**
      * Get the event types paths.
      *
-     * @param event
-     *            Event to get the path for.
-     * @param extraInfo
-     *            Extra information to pass along with the event
-     * @return Array of FixedArray representing the paths.
+     * @param traceName
+     *            The name of the trace (will be used as a sub-tree in the view)
+     * @param type
+     *            The event type
+     * @return Array of arrays representing the paths
      */
     protected String[][] getTypePaths(String traceName, String type) {
         String[][] paths = { new String[] {traceName, HEADER_EVENT_TYPES, type } };
@@ -145,11 +145,9 @@ public class TmfStatisticsTree {
     /**
      * Get the standard paths for an event.
      *
-     * @param event
-     *            Event to get the path for.
-     * @param extraInfo
-     *            Extra information to pass along with the event
-     * @return Array of FixedArray representing the paths.
+     * @param traceName
+     *            The name of the trace (will be used as a sub-tree in the view)
+     * @return Array of arrays representing the paths
      */
     protected String[][] getNormalPaths(String traceName) {
         String[][] paths = { new String[] { traceName } };
index 84908aec3cd399fa3f98782ee0da72379a849789..9977b5c2add8820845645a7ac00fe55906987538 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2010 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Patrick Tasse - Initial API and implementation
  *******************************************************************************/
@@ -81,14 +81,14 @@ class FilterViewer extends Composite {
 
     private TreeViewer fViewer;
     private Composite fComposite;
-    
+
     public FilterViewer(Composite parent, int style) {
         super(parent, style);
 
         setLayout(new FillLayout());
         GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
         setLayoutData(gd);
-        
+
         final SashForm sash = new SashForm(this, SWT.HORIZONTAL);
 
         // Create the tree viewer to display the filter tree
@@ -96,7 +96,7 @@ class FilterViewer extends Composite {
         fViewer.setContentProvider(new FilterTreeContentProvider());
         fViewer.setLabelProvider(new FilterTreeLabelProvider());
         fViewer.setInput(new TmfFilterRootNode());
-        
+
         // Create the empty filter node properties panel
         fComposite = new Composite(sash, SWT.NONE);
         GridLayout gl = new GridLayout();
@@ -105,7 +105,7 @@ class FilterViewer extends Composite {
         fComposite.setLayout(gl);
 
         createContextMenu();
-        
+
         fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
             @Override
             public void selectionChanged(SelectionChangedEvent event) {
@@ -133,7 +133,7 @@ class FilterViewer extends Composite {
             }
         });
     }
-    
+
     /**
      * Create the context menu for the tree viewer
      */
@@ -154,9 +154,12 @@ class FilterViewer extends Composite {
         // Publish it
         fViewer.getTree().setMenu(contextMenu);
     }
-    
+
     /**
-     * Fill the context menu for the tree viewer
+     * Fill the context menu for the tree viewer.
+     *
+     * @param manager
+     *            The menu manager
      */
     protected void fillContextMenu(IMenuManager manager) {
         final ISelection selection = fViewer.getSelection();
@@ -169,11 +172,11 @@ class FilterViewer extends Composite {
         }
 
         final ITmfFilterTreeNode selectedNode = filterTreeNode;
-        
+
         if (selectedNode != null) {
-            
+
             fillContextMenuForNode(selectedNode, manager);
-            
+
             if (selectedNode.getValidChildren().size() > 0) {
                 manager.add(new Separator());
             }
@@ -187,19 +190,24 @@ class FilterViewer extends Composite {
             };
             deleteAction.setText(Messages.FilterViewer_DeleteActionText);
             manager.add(deleteAction);
-            
+
             manager.add(new Separator());
         }
 
         if (fViewer.getInput() instanceof TmfFilterRootNode || selectedNode == null) {
             final ITmfFilterTreeNode root = (ITmfFilterTreeNode) fViewer.getInput();
-            
+
             fillContextMenuForNode(root, manager);
         }
     }
-    
+
     /**
      * Fill the context menu with the valid children of the provided node
+     *
+     * @param node
+     *            The target node
+     * @param manager
+     *            The menu manager
      */
     protected void fillContextMenuForNode(final ITmfFilterTreeNode node, IMenuManager manager) {
         for (final String child : node.getValidChildren()) {
@@ -238,7 +246,7 @@ class FilterViewer extends Composite {
             manager.add(action);
         }
     }
-    
+
     /**
      * Create the appropriate filter node properties composite
      */
@@ -246,7 +254,7 @@ class FilterViewer extends Composite {
         for (Control control : fComposite.getChildren()) {
             control.dispose();
         }
-        
+
         if (node instanceof TmfFilterNode) {
             new FilterNodeComposite(fComposite, (TmfFilterNode) node);
         } else if (node instanceof TmfFilterEventTypeNode) {
@@ -268,7 +276,7 @@ class FilterViewer extends Composite {
         }
         fComposite.layout();
     }
-    
+
     /**
      * Highlight the provided tree items
      */
@@ -279,7 +287,7 @@ class FilterViewer extends Composite {
         }
 
     }
-    
+
     /**
      * Reset the provided tree items (remove highlight)
      */
@@ -289,18 +297,18 @@ class FilterViewer extends Composite {
             resetTreeItems(item.getItems());
         }
     }
-    
+
     public void setInput(ITmfFilterTreeNode root) {
         fViewer.setInput(root);
         fViewer.expandAll();
-        
+
         updateFilterNodeComposite(null);
     }
-    
+
     public ITmfFilterTreeNode getInput() {
         return (ITmfFilterTreeNode) fViewer.getInput();
     }
-    
+
     public void refresh() {
         fViewer.refresh();
     }
@@ -312,7 +320,7 @@ class FilterViewer extends Composite {
     public void setSelection(ITmfFilterTreeNode node) {
         fViewer.setSelection(new StructuredSelection(node));
     }
-    
+
     public ITmfFilterTreeNode getSelection() {
         final ISelection selection = fViewer.getSelection();
         ITmfFilterTreeNode filterTreeNode = null;
@@ -326,24 +334,24 @@ class FilterViewer extends Composite {
         final ITmfFilterTreeNode selectedNode = filterTreeNode;
         return selectedNode;
     }
-    
+
     public void addSelectionChangedListener(ISelectionChangedListener listener) {
         fViewer.addSelectionChangedListener(listener);
     }
-    
+
     public void removeSelectionChangedListener(ISelectionChangedListener listener) {
         fViewer.removeSelectionChangedListener(listener);
     }
-    
+
     private class FilterBaseNodeComposite extends Composite {
-        
+
         FilterBaseNodeComposite(Composite parent) {
             super(parent, SWT.NONE);
             setLayout(new GridLayout(2, false));
             setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
             setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
         }
-        
+
         protected String[] getFieldsList(ITmfFilterTreeNode node) {
             ArrayList<String> fieldsList = new ArrayList<String>();
             while (node != null) {
@@ -445,15 +453,15 @@ class FilterViewer extends Composite {
     private class FilterNodeComposite extends FilterBaseNodeComposite {
         TmfFilterNode fNode;
         Text fNameText;
-        
+
         FilterNodeComposite(Composite parent, TmfFilterNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NameLabel);
-            
+
             fNameText = new Text(this, SWT.BORDER);
             fNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             if (node.getFilterName() != null && node.getFilterName().length() > 0) {
@@ -494,7 +502,7 @@ class FilterViewer extends Composite {
         TmfFilterEventTypeNode fNode;
         Combo fTypeCombo;
         Map<String, Object> fEventsTypeMap;
-        
+
         FilterEventTypeNodeComposite(Composite parent, TmfFilterEventTypeNode node) {
             super(parent);
             fNode = node;
@@ -503,7 +511,7 @@ class FilterViewer extends Composite {
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_TypeLabel);
-            
+
             fTypeCombo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
             fTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             fTypeCombo.setItems(fEventsTypeMap.keySet().toArray(new String[0]));
@@ -575,19 +583,19 @@ class FilterViewer extends Composite {
             return eventsTypeMap;
         }
     }
-    
+
     private class FilterAndNodeComposite extends FilterBaseNodeComposite {
         TmfFilterAndNode fNode;
         Button fNotButton;
-        
+
         FilterAndNodeComposite(Composite parent, TmfFilterAndNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NotLabel);
-            
+
             fNotButton = new Button(this, SWT.CHECK);
             fNotButton.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             fNotButton.setSelection(fNode.isNot());
@@ -604,15 +612,15 @@ class FilterViewer extends Composite {
     private class FilterOrNodeComposite extends FilterBaseNodeComposite {
         TmfFilterOrNode fNode;
         Button fNotButton;
-        
+
         FilterOrNodeComposite(Composite parent, TmfFilterOrNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NotLabel);
-            
+
             fNotButton = new Button(this, SWT.CHECK);
             fNotButton.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             fNotButton.setSelection(fNode.isNot());
@@ -625,22 +633,22 @@ class FilterViewer extends Composite {
             });
         }
     }
-    
+
     private class FilterContainsNodeComposite extends FilterBaseNodeComposite {
         TmfFilterContainsNode fNode;
         Button fNotButton;
         Combo fFieldCombo;
         Text fValueText;
         Button fIgnoreCaseButton;
-        
+
         FilterContainsNodeComposite(Composite parent, TmfFilterContainsNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NotLabel);
-            
+
             fNotButton = new Button(this, SWT.CHECK);
             fNotButton.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             fNotButton.setSelection(fNode.isNot());
@@ -651,11 +659,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_FieldLabel);
-            
+
             fFieldCombo = new Combo(this, SWT.DROP_DOWN);
             fFieldCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             fFieldCombo.setItems(getFieldsList(fNode));
@@ -669,11 +677,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_ValueLabel);
-            
+
             fValueText = new Text(this, SWT.BORDER);
             fValueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             if (node.getValue() != null && node.getValue().length() > 0) {
@@ -707,10 +715,10 @@ class FilterViewer extends Composite {
                     }
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
-            
+
             fIgnoreCaseButton = new Button(this, SWT.CHECK);
             fIgnoreCaseButton.setSelection(fNode.isIgnoreCase());
             fIgnoreCaseButton.setText(Messages.FilterViewer_IgnoreCaseButtonText);
@@ -731,15 +739,15 @@ class FilterViewer extends Composite {
         Combo fFieldCombo;
         Text fValueText;
         Button fIgnoreCaseButton;
-        
+
         FilterEqualsNodeComposite(Composite parent, TmfFilterEqualsNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NotLabel);
-            
+
             fNotButton = new Button(this, SWT.CHECK);
             fNotButton.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             fNotButton.setSelection(fNode.isNot());
@@ -750,11 +758,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_FieldLabel);
-            
+
             fFieldCombo = new Combo(this, SWT.DROP_DOWN);
             fFieldCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             fFieldCombo.setItems(getFieldsList(fNode));
@@ -768,11 +776,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_ValueLabel);
-            
+
             fValueText = new Text(this, SWT.BORDER);
             fValueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             if (node.getValue() != null && node.getValue().length() > 0) {
@@ -806,10 +814,10 @@ class FilterViewer extends Composite {
                     }
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
-            
+
             fIgnoreCaseButton = new Button(this, SWT.CHECK);
             fIgnoreCaseButton.setSelection(fNode.isIgnoreCase());
             fIgnoreCaseButton.setText(Messages.FilterViewer_IgnoreCaseButtonText);
@@ -829,15 +837,15 @@ class FilterViewer extends Composite {
         Button fNotButton;
         Combo fFieldCombo;
         Text fRegexText;
-        
+
         FilterMatchesNodeComposite(Composite parent, TmfFilterMatchesNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NotLabel);
-            
+
             fNotButton = new Button(this, SWT.CHECK);
             fNotButton.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             fNotButton.setSelection(fNode.isNot());
@@ -848,11 +856,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_FieldLabel);
-            
+
             fFieldCombo = new Combo(this, SWT.DROP_DOWN);
             fFieldCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             fFieldCombo.setItems(getFieldsList(fNode));
@@ -866,11 +874,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_RegexLabel);
-            
+
             fRegexText = new Text(this, SWT.BORDER);
             fRegexText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             if (node.getRegex() != null && node.getRegex().length() > 0) {
@@ -918,15 +926,15 @@ class FilterViewer extends Composite {
         Button fNumButton;
         Button fAlphaButton;
         Button fTimestampButton;
-        
+
         FilterCompareNodeComposite(Composite parent, TmfFilterCompareNode node) {
             super(parent);
             fNode = node;
-            
+
             Label label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_NotLabel);
-            
+
             fNotButton = new Button(this, SWT.CHECK);
             fNotButton.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             fNotButton.setSelection(fNode.isNot());
@@ -937,11 +945,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_FieldLabel);
-            
+
             fFieldCombo = new Combo(this, SWT.DROP_DOWN);
             fFieldCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             fFieldCombo.setItems(getFieldsList(fNode));
@@ -955,18 +963,18 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_ResultLabel);
-            
+
             Composite resultGroup = new Composite(this, SWT.NONE);
             GridLayout rggl = new GridLayout(3, true);
             rggl.marginHeight = 0;
             rggl.marginWidth = 0;
             resultGroup.setLayout(rggl);
             resultGroup.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
-            
+
             fLTButton = new Button(resultGroup, SWT.RADIO);
             fLTButton.setSelection(fNode.getResult() < 0);
             fLTButton.setText("<"); //$NON-NLS-1$
@@ -980,7 +988,7 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             fEQButton = new Button(resultGroup, SWT.RADIO);
             fEQButton.setSelection(fNode.getResult() == 0);
             fEQButton.setText("="); //$NON-NLS-1$
@@ -994,7 +1002,7 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             fGTButton = new Button(resultGroup, SWT.RADIO);
             fGTButton.setSelection(fNode.getResult() > 0);
             fGTButton.setText(">"); //$NON-NLS-1$
@@ -1008,18 +1016,18 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_TypeLabel);
-            
+
             Composite typeGroup = new Composite(this, SWT.NONE);
             GridLayout tggl = new GridLayout(3, false);
             tggl.marginHeight = 0;
             tggl.marginWidth = 0;
             typeGroup.setLayout(tggl);
             typeGroup.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
-            
+
             fNumButton = new Button(typeGroup, SWT.RADIO);
             fNumButton.setSelection(fNode.getType() == Type.NUM);
             fNumButton.setText(Messages.FilterViewer_NumButtonText);
@@ -1033,7 +1041,7 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             fAlphaButton = new Button(typeGroup, SWT.RADIO);
             fAlphaButton.setSelection(fNode.getType() == Type.ALPHA);
             fAlphaButton.setText(Messages.FilterViewer_AlphaButtonText);
@@ -1047,7 +1055,7 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             fTimestampButton = new Button(typeGroup, SWT.RADIO);
             fTimestampButton.setSelection(fNode.getType() == Type.TIMESTAMP);
             fTimestampButton.setText(Messages.FilterViewer_TimestampButtonText);
@@ -1061,11 +1069,11 @@ class FilterViewer extends Composite {
                     fViewer.refresh(fNode);
                 }
             });
-            
+
             label = new Label(this, SWT.NONE);
             label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
             label.setText(Messages.FilterViewer_ValueLabel);
-            
+
             fValueText = new Text(this, SWT.BORDER);
             fValueText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
             if (node.getValue() != null && node.getValue().length() > 0) {
index 087842455285bce4a5e30744fd8cebe4d322f8c4..1ec85fadecd4fc4fcd625454ab31c2478a7eb050 100755 (executable)
@@ -813,14 +813,17 @@ public class ScrollView extends Composite {
      * Called when the mouse enter the ScrollView area
      *
      * @param e
+     *            Mouse event
      */
     protected void contentsMouseExit(MouseEvent e) {
     }
 
     /**
-     * Called when the mouse enter the ScrollView area after and system defined time
+     * Called when the mouse enter the ScrollView area after and system defined
+     * time
      *
      * @param e
+     *            Mouse event
      */
     protected void contentsMouseHover(MouseEvent e) {
     }
@@ -829,6 +832,7 @@ public class ScrollView extends Composite {
      * Called when the mouse enter the ScrollView area
      *
      * @param e
+     *            Mouse event
      */
     protected void contentsMouseEnter(MouseEvent e) {
     }
@@ -837,6 +841,7 @@ public class ScrollView extends Composite {
      * Called when user double on contents area.
      *
      * @param e
+     *            Mouse event
      */
     protected void contentsMouseDoubleClickEvent(MouseEvent e) {
     }
@@ -845,6 +850,7 @@ public class ScrollView extends Composite {
      * Called when mouse is on contents area and button is pressed.
      *
      * @param e
+     *            Mouse event
      */
     protected void contentsMouseDownEvent(MouseEvent e) {
         fMouseDownX = e.x;
@@ -855,10 +861,26 @@ public class ScrollView extends Composite {
      * TimerTask for auto scroll feature.
      */
     protected static class AutoScroll extends TimerTask {
+
+        /** X delta */
         public int deltaX;
+
+        /** Y delta */
         public int deltaY;
+
+        /** ScrollView object */
         public ScrollView scrollView;
 
+        /**
+         * Constructor.
+         *
+         * @param sv
+         *            ScrollView object to use
+         * @param dx
+         *            X delta
+         * @param dy
+         *            Y delta
+         */
         public AutoScroll(ScrollView sv, int dx, int dy) {
             scrollView = sv;
             deltaX = dx;
@@ -880,6 +902,7 @@ public class ScrollView extends Composite {
      * Called when mouse is on contents area and mode.
      *
      * @param event
+     *            Mouse event
      */
     protected void contentsMouseMoveEvent(MouseEvent event) {
         if ((event.stateMask & SWT.BUTTON_MASK) != 0) {
@@ -936,6 +959,7 @@ public class ScrollView extends Composite {
      * Called when mouse is on contents area and button is released
      *
      * @param event
+     *            Mouse event
      */
     protected void contentsMouseUpEvent(MouseEvent event) {
         // reset auto scroll if it's engaged
@@ -946,14 +970,20 @@ public class ScrollView extends Composite {
     }
 
     /**
-     * Responsible to draw contents area. At least rectangle clipX must be redrawn. This rectangle is given in contents
-     * coordinates. By default, no paint is produced.
+     * Responsible to draw contents area. At least rectangle clipX must be
+     * redrawn. This rectangle is given in contents coordinates. By default, no
+     * paint is produced.
      *
      * @param gc
+     *            Graphics context
      * @param clipx
+     *            X clip
      * @param clipy
+     *            Y clip
      * @param clipw
+     *            W clip
      * @param cliph
+     *            H clip
      */
     protected void drawContents(GC gc, int clipx, int clipy, int clipw, int cliph) {
     }
@@ -1361,7 +1391,9 @@ public class ScrollView extends Composite {
     }
 
     /**
-     * setup scroll bars visibility, return true if one of visibility changed.
+     * Setup scroll bars visibility.
+     *
+     * @return True if one of visibility changed.
      */
     protected boolean updateScrollBarVisiblity() {
         boolean change = false;
@@ -1540,7 +1572,11 @@ public class ScrollView extends Composite {
     }
 
     /**
-     * Add support for arrow key, scroll the ... scroll view. But you can redefine this method for your convenience.
+     * Add support for arrow key, scroll the ... scroll view. But you can
+     * redefine this method for your convenience.
+     *
+     * @param event
+     *            Keyboard event
      */
     protected void keyPressedEvent(KeyEvent event) {
         switch (event.keyCode) {
@@ -1839,6 +1875,11 @@ public class ScrollView extends Composite {
 
         /**
          * Process overview appear
+         *
+         * @param mx
+         *            X coordinate
+         * @param my
+         *            Y coordinate
          */
         protected void overviewAppear(int mx, int my) {
             if (fOverview == null) {
@@ -2016,10 +2057,13 @@ public class ScrollView extends Composite {
         /**
          * Convert overview coordinates to global coordinates.
          *
-         * @param loc the control reference
-         * @param x The x coordinate to convert
-         * @param y The y coordinate to convert
-         * @return
+         * @param loc
+         *            the control reference
+         * @param x
+         *            The x coordinate to convert
+         * @param y
+         *            The y coordinate to convert
+         * @return The new converted Point
          */
         protected Point toGlobalCoordinates(Control loc, int x, int y) {
             Point p = new Point(x, y);
index 79763f1df0273884233fcdaad78e0861c743ca85..26e14712df20a7bd32ffd5bd6b9c0a3195de764f 100755 (executable)
@@ -484,12 +484,13 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
     /**
      * Checks for focus of children.
      *
-     * @param children Control to check
+     * @param children
+     *            Control to check
      * @return true if child is on focus else false
      */
-    protected boolean checkFocusOnChilds(Control childs) {
-        if (childs instanceof Composite) {
-            Control[] child = ((Composite) childs).getChildren();
+    protected boolean checkFocusOnChilds(Control children) {
+        if (children instanceof Composite) {
+            Control[] child = ((Composite) children).getChildren();
             for (int i = 0; i < child.length; i++) {
                 if (child[i].isFocusControl()) {
                     return true;
index c1fc48d81b9071c1a108c4e6e13eb39d15cb1ef9..bb3b6c803be9df5c0014aeb2346283ef7b555966 100755 (executable)
@@ -183,7 +183,9 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
      * Informs the given lifeline about the maximum occurrence if applicable.
      *
      * @param lifeLine
+     *            Concerned lifeline
      * @param occurrence
+     *            Occurrence number
      */
     protected void informFrame(Lifeline lifeLine, int occurrence) {
         if ((lifeLine != null) && (lifeLine.getFrame() != null) && (lifeLine.getFrame().getMaxEventOccurrence() < occurrence)) {
index 55a4e243fbeff71a0e107d8c189b91b6defe8b16..689116534311a8da3c836b38609889c0c6d494fc 100755 (executable)
@@ -242,7 +242,7 @@ public class BasicExecutionOccurrence extends GraphNode {
     /**
      * Rewrite this method in your extension in order to support customized fill colors
      *
-     * @param context
+     * @param context Graphics context
      * @return IColor
      */
     protected IColor setUnselectedFillColor(IGC context) {
@@ -261,7 +261,7 @@ public class BasicExecutionOccurrence extends GraphNode {
     /**
      * Rewrite this method in your extension in order to support customized stroke colors
      *
-     * @param context
+     * @param context Graphics context
      * @return IColor
      */
     protected IColor setUnselectedStrokeColor(IGC context) {
index 7384e2165c06c220e3bd92290a61f2e619143181..2940fe67bccff712c040f1f577fb3ed576a55d70 100755 (executable)
@@ -164,6 +164,7 @@ public class Lifeline extends GraphNode {
      * Set the frame on which this lifeline must be drawn
      *
      * @param parentFrame
+     *            Parent frame
      */
     protected void setFrame(Frame parentFrame) {
         fFrame = parentFrame;
index c6e58be8da5d1aafaa18d6ed3d0373dca4d55728..0d11478be8c7499a83da2a356eb6f643f638d15d 100755 (executable)
@@ -1,13 +1,13 @@
 /**********************************************************************
  * Copyright (c) 2005, 2008 IBM Corporation and others.
  * Copyright (c) 2011, 2012 Ericsson.
- * 
+ *
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
+ *
+ * Contributors:
  * IBM - Initial API and implementation
  * Bernd Hufmann - Updated for TMF
  **********************************************************************/
@@ -30,9 +30,9 @@ import org.eclipse.ui.IViewPart;
 
 /**
  * Class implementation of the pages dialog.<br>
- * 
+ *
  * It is associated to an SDView and to a ISDAdvancedPagingProvider.<br>
- * 
+ *
  * @version 1.0
  * @author sveyrier
  */
@@ -46,16 +46,20 @@ public class PagesDialog extends Dialog {
      * viewer and provided are kept here as attributes
      */
     protected ISDAdvancedPagingProvider fProvider = null;
+
+    /** Current page */
     protected TextArea fCurrentPage;
+
+    /** Comment label */
     protected Label fTotalPageComment;
 
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
-    
+
     /**
      * Standard constructor
-     * 
+     *
      * @param view The sequence diagram view reference
      * @param provider The paging provider reference
      */
@@ -114,7 +118,7 @@ public class PagesDialog extends Dialog {
     }
 
     /**
-     * Updates the comments texts. 
+     * Updates the comments texts.
      */
     protected void updateComments() {
         int pages = Math.max(0, fProvider.pagesCount());
@@ -132,7 +136,7 @@ public class PagesDialog extends Dialog {
         fTotalPageComment.setText(totalPageCommentText.toString());
     }
 
-    
+
     // ------------------------------------------------------------------------
     // Helper classes
     // ------------------------------------------------------------------------
@@ -155,7 +159,7 @@ public class PagesDialog extends Dialog {
 
         /**
          * Constructor
-         * 
+         *
          * @param parent The paren composite
          */
         public TextArea(Composite parent) {
@@ -165,7 +169,7 @@ public class PagesDialog extends Dialog {
 
         /**
          * Sets the page value.
-         * 
+         *
          * @param page The page value
          */
         public void setValue(int page) {
@@ -175,7 +179,7 @@ public class PagesDialog extends Dialog {
 
         /**
          * Returns the page value.
-         * 
+         *
          * @return the page value
          */
         public int getValue() {
@@ -191,7 +195,7 @@ public class PagesDialog extends Dialog {
 
         /**
          * Sets the minimum and maximum page values.
-         * 
+         *
          * @param min A minimum page value
          * @param max A maximum page value
          */
index f0be212f6411844d0cc82630d4fa31052911de1f..a4516dc93790498d51f3af13464869085adb927e 100755 (executable)
@@ -143,10 +143,27 @@ public class SDPrintDialogUI {
      * List of pages to print.
      */
     protected int fPagesList[];
+
+    /**
+     * Value for dividing the sequence diagram into pages
+     */
+    protected float fStepX;
+
     /**
-     * Values for dividing sequence diagram into pages.
+     * Value for dividing the sequence diagram into pages
      */
-    protected float fStepX, fStepY, sTX, sTY;
+    protected float fStepY;
+
+    /**
+     * Value for dividing the sequence diagram into pages
+     */
+    protected float sTX;
+
+    /**
+     * Value for dividing the sequence diagram into pages
+     */
+    protected float sTY;
+
     /**
      * Page which to print from.
      */
index 9000384cd21409787a29aabb19d1ca73df9d68d5..6f38e0eec928f9b502f7d406765a1e215f8b72b4 100755 (executable)
@@ -1,13 +1,13 @@
 /**********************************************************************
  * Copyright (c) 2005, 2008 IBM Corporation and others.
  * Copyright (c) 2011, 2012 Ericsson.
- * 
+ *
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: 
+ *
+ * Contributors:
  * IBM - Initial API and implementation
  * Bernd Hufmann - Updated for TMF
  **********************************************************************/
@@ -19,10 +19,10 @@ import org.eclipse.swt.widgets.Display;
 
 /**
  * Default implementation of the IColor interface.
- * 
+ *
  * @version 1.0
  * @author sveyrier
- * 
+ *
  */
 public class ColorImpl implements IColor {
 
@@ -43,7 +43,7 @@ public class ColorImpl implements IColor {
     // ------------------------------------------------------------------------
     /**
      * Constructor
-     *  
+     *
      * @param display The display to use
      * @param r A value for red
      * @param g A value for green
@@ -53,10 +53,11 @@ public class ColorImpl implements IColor {
         fColor = new Color(display, r, g, b);
     }
 
-    /** 
+    /**
      * Copy constructor
-     * 
-     * @param A color to copy
+     *
+     * @param color
+     *            A color to copy
      */
     protected ColorImpl(Color color) {
         fColor = color;
@@ -69,14 +70,14 @@ public class ColorImpl implements IColor {
 
     /**
      * Returns a system color.
-     * 
-     * @param color The color ID 
+     *
+     * @param color The color ID
      * @return a system color
      */
     public static ColorImpl getSystemColor(int color) {
         return new ColorImpl(Display.getDefault().getSystemColor(color));
     }
-    
+
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor#getColor()
index ad4a84188f4ba509b0602fda17e62de5177178aa..3bba455171c658b00b18d0beeae66a747c2a95a4 100755 (executable)
@@ -371,6 +371,11 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
         }
     }
 
+    /**
+     * Swap viewer preferences.
+     *
+     * @param toTemp Switch to the temporary preferences
+     */
     protected void swapPref(boolean toTemp) {
         String TAG1 = "";//$NON-NLS-1$
         String TAG2 = TEMP_TAG;
index 3545eede08bccb91fe064a4d90094c5c184239ca..944b9b294babb36cb2754f356c37d8a569cdb9ad 100644 (file)
@@ -204,15 +204,18 @@ public class TimeGraphViewer implements ITimeDataProvider, SelectionListener {
         }
     }
 
+    /**
+     * @return The string representing the view type
+     */
     protected String getViewTypeStr() {
         return "viewoption.threads"; //$NON-NLS-1$
     }
 
-    int getMarginWidth(int idx) {
+    int getMarginWidth() {
         return 0;
     }
 
-    int getMarginHeight(int idx) {
+    int getMarginHeight() {
         return 0;
     }
 
@@ -227,6 +230,15 @@ public class TimeGraphViewer implements ITimeDataProvider, SelectionListener {
         Utils.saveIntOption(getPreferenceString("namewidth"), _nameWidth); //$NON-NLS-1$
     }
 
+    /**
+     * Create a data viewer.
+     *
+     * @param parent
+     *            Parent composite
+     * @param style
+     *            Style to use
+     * @return The new data viewer
+     */
     protected Control createDataViewer(Composite parent, int style) {
         loadOptions();
         _colors = new TimeGraphColorScheme();
@@ -307,9 +319,17 @@ public class TimeGraphViewer implements ITimeDataProvider, SelectionListener {
     }
 
     /**
+     * Create a new time graph control.
+     *
+     * @param parent
+     *            The parent composite
+     * @param colors
+     *            The color scheme
+     * @return The new TimeGraphControl
      * @since 2.0
      */
-    protected TimeGraphControl createTimeGraphControl(Composite parent, TimeGraphColorScheme colors) {
+    protected TimeGraphControl createTimeGraphControl(Composite parent,
+            TimeGraphColorScheme colors) {
         return new TimeGraphControl(parent, colors);
     }
 
index 34988a6df5e7aa6256dab0b0faab95ecb52b4262..87812ef12feb64c39057acf0814e1302f8389c04 100644 (file)
@@ -19,8 +19,14 @@ package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model;
  * @author Patrick Tasse
  */
 public class TimeEvent implements ITimeEvent {
+
+    /** TimeGraphEntry matching this time event */
     protected ITimeGraphEntry fEntry;
+
+    /** Beginning timestamp of this time event */
     protected long fTime;
+
+    /** Duration of this time event */
     protected long fDuration;
 
     /**
index 0d21e8eed551994642bdf1238ac019c3cf571e7a..4b75ae8abbeedc39f658778597cb925d92c37dbd 100644 (file)
@@ -140,6 +140,7 @@ public interface ITimeDataProvider {
      * @return If the time format is calendar (true) or relative (false)
      * @deprecated replaced by {@link #getTimeFormat()}
      */
+    @Deprecated
     boolean isCalendarFormat();
 
     /**
index 3be2c0a5b67942ccf2d084005afb2d65b2b363f7..c636480ad7bc2ffa83e4b19ab41c26f7e085ce24 100644 (file)
@@ -33,18 +33,21 @@ import org.eclipse.swt.widgets.Composite;
 public abstract class TimeGraphBaseControl extends Canvas implements PaintListener {
 
     /** Default left margin size */
-    static public final int MARGIN = 4;
+    public static final int MARGIN = 4;
 
     /** Default expanded size */
-    static public final int EXPAND_SIZE = 9; // the [+] or [-] control size
+    public static final int EXPAND_SIZE = 9; // the [+] or [-] control size
 
     /** Default size of the right margin */
-    static public final int RIGHT_MARGIN = 1; // 1 pixels less to make sure end time is visible
+    public static final int RIGHT_MARGIN = 1; // 1 pixels less to make sure end time is visible
 
     /** Default size for small icons */
-    static public final int SMALL_ICON_SIZE = 16;
+    public static final int SMALL_ICON_SIZE = 16;
 
+    /** Color scheme */
     protected TimeGraphColorScheme _colors;
+
+    /** Font size */
     protected int _fontHeight = 0;
 
     /**
index ede0e83314391fd5fc02914f2c87017cbc11c816..5e0a117a5aeed2a61dbbe49c94e32cc6570f9c70 100644 (file)
@@ -72,14 +72,20 @@ import org.eclipse.swt.widgets.ScrollBar;
  */
 public class TimeGraphControl extends TimeGraphBaseControl implements FocusListener, KeyListener, MouseMoveListener, MouseListener, MouseWheelListener, ControlListener, SelectionListener, MouseTrackListener, TraverseListener, ISelectionProvider, MenuDetectListener {
 
+    /** Max scrollbar size */
+    public static final int H_SCROLLBAR_MAX = Integer.MAX_VALUE - 1;
+
+    /** Resource manager */
+    protected LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
+
+    /** Color map for event types */
+    protected Color[] fEventColorMap = null;
+
     private static final int DRAG_NONE = 0;
     private static final int DRAG_TRACE_ITEM = 1;
     private static final int DRAG_SPLIT_LINE = 2;
     private static final int DRAG_ZOOM = 3;
-    public static final boolean DEFAULT_DRAW_THREAD_JOIN = true;
-    public static final boolean DEFAULT_DRAW_THREAD_WAIT = true;
-    public static final boolean DEFAULT_DRAW_THREAD_RELEASE = true;
-    public static final int H_SCROLLBAR_MAX = Integer.MAX_VALUE - 1;
+
     private static final int CUSTOM_ITEM_HEIGHT = -1; // get item height from provider
 
     private static final double zoomCoeff = 1.5;
@@ -116,9 +122,6 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
 
     private Listener mouseScrollFilterListener;
 
-    protected LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
-    protected Color[] fEventColorMap = null;
-
     private MouseScrollNotifier fMouseScrollNotifier;
     private final Object fMouseScrollNotifierLock = new Object();
     private class MouseScrollNotifier extends Thread {
@@ -1178,9 +1181,10 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
      *
      * @param item the item to draw
      * @param bounds the container rectangle
+     * @param timeProvider Time provider
      * @param i the item index
      * @param nameSpace the name space
-     * @param gc
+     * @param gc Graphics context
      */
     protected void drawItem(Item item, Rectangle bounds, ITimeDataProvider timeProvider, int i, int nameSpace, GC gc) {
         ITimeGraphEntry entry = item._trace;
@@ -1256,6 +1260,16 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
         fTimeGraphProvider.postDrawEntry(entry, rect, gc);
     }
 
+    /**
+     * Draw the name of an item.
+     *
+     * @param item
+     *            Item object
+     * @param bounds
+     *            Where to draw the name
+     * @param gc
+     *            Graphics context
+     */
     protected void drawName(Item item, Rectangle bounds, GC gc) {
         boolean hasTimeEvents = item._trace.hasTimeEvents();
         if (! hasTimeEvents) {
@@ -1346,6 +1360,23 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
         }
     }
 
+    /**
+     * Draw the state (color fill)
+     *
+     * @param colors
+     *            Color scheme
+     * @param event
+     *            Time event for which we're drawing the state
+     * @param rect
+     *            Where to draw
+     * @param gc
+     *            Graphics context
+     * @param selected
+     *            Is this time event currently selected (so it appears
+     *            highlighted)
+     * @param timeSelected
+     *            Is the timestamp currently selected
+     */
     protected void drawState(TimeGraphColorScheme colors, ITimeEvent event,
             Rectangle rect, GC gc, boolean selected, boolean timeSelected) {
 
@@ -1410,6 +1441,16 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe
         fTimeGraphProvider.postDrawEvent(event, rect, gc);
     }
 
+    /**
+     * Fill the space between two contiguous time events
+     *
+     * @param rect
+     *            Rectangle to fill
+     * @param gc
+     *            Graphics context
+     * @param selected
+     *            Is this time event selected or not
+     */
     protected void fillSpace(Rectangle rect, GC gc, boolean selected) {
         gc.setBackground(_colors.getBkColor(selected, _isInFocus, false));
         gc.fillRectangle(rect);
index 49023be1d5bc7bc08c6b5359ab8f3ed1e5a5ef9a..d4b575f0b5b9c6a59d50b260216ec7eeba0ebc13 100644 (file)
@@ -564,9 +564,18 @@ abstract class TimeDraw {
 
     public abstract void draw(GC gc, long time, Rectangle rect);
 
+    /**
+     * Override to draw absolute time header This is for the time information
+     * not shown in the draw of each tick
+     *
+     * @param gc
+     *            Graphics context
+     * @param time
+     *            Timestamp
+     * @param absHeaderRect
+     *            Header rectangle
+     */
     public void drawAbsHeader(GC gc, long time, Rectangle absHeaderRect) {
-        // Override to draw absolute time header
-        // This is for the time information not shown in the draw of each tick
     }
 
     public abstract String hint();
index 0eba3d26816e2decdfb4ed7a78941f7956932958..d8d5afcbe57b975649e0ddc3fff9f905f77f9e76 100644 (file)
@@ -15,7 +15,6 @@
  *****************************************************************************/
 package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
 
-import java.text.NumberFormat;
 import java.util.Iterator;
 import java.util.Map;
 
index f1742ca9f42281297c86ca929d517cccd58fd08b..d929f18db84a36b51d76b9a1e2ce615767ddbf45 100644 (file)
@@ -56,17 +56,21 @@ public class Utils {
         NUMBER,
     }
 
-    static public final int IMG_THREAD_RUNNING = 0;
-    static public final int IMG_THREAD_SUSPENDED = 1;
-    static public final int IMG_THREAD_STOPPED = 2;
-    static public final int IMG_METHOD_RUNNING = 3;
-    static public final int IMG_METHOD = 4;
-    static public final int IMG_NUM = 5;
+    /**
+     * Timestamp resolution
+     */
+    public static enum Resolution {
+        /** seconds */
+        SECONDS,
 
-    static public final Object[] _empty = new Object[0];
+        /** milliseconds */
+        MILLISEC,
 
-    public static enum Resolution {
-        SECONDS, MILLISEC, MICROSEC, NANOSEC
+        /** microseconds */
+        MICROSEC,
+
+        /** nanoseconds */
+        NANOSEC
     }
 
     static private final SimpleDateFormat stimeformat = new SimpleDateFormat("HH:mm:ss"); //$NON-NLS-1$
This page took 0.135475 seconds and 5 git commands to generate.