From: Bernd Hufmann Date: Tue, 12 Jun 2012 02:22:51 +0000 (-0400) Subject: Fixed JavaDoc in TMF UI plugin X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b544077e522b694af4b5eac99a20788f94fe63af;p=deliverable%2Ftracecompass.git Fixed JavaDoc in TMF UI plugin --- diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/ITmfProjectModelElement.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/ITmfProjectModelElement.java index 957f49089c..d8338e5b0a 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/ITmfProjectModelElement.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/ITmfProjectModelElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Ericsson + * Copyright (c) 2010, 2011, 202 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -19,31 +19,69 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; /** - * ITmfProjectModelElement - *

- * TODO: Make ITmfProjectModelElement extend IAdaptable + * The TMF project model interface. + * + * The TMF tracing project is integrated in the Common Navigator framework. + * Each tracing tree element has to implement this interface to be visible in the + * Project Explorer. + * + * @version 1.0 + * @author Francois Chouinard */ public interface ITmfProjectModelElement { - + + /** + * Returns the name of the project model element. + * @return the name of the project element. + */ public String getName(); - + /** + * Returns the resource associated with the project model element. + * @return the model resource. + */ public IResource getResource(); - + /** + * Returns the path of the project model resource. + * @return the resource path. + */ public IPath getPath(); - + /** + * Returns the URI (location) of the resource. + * @return the resource URI. + */ public URI getLocation(); - + /** + * Returns the project model element. + * @return the project model element. + */ public TmfProjectElement getProject(); - + /** + * Returns the parent of this model element. + * @return the parent of this model element. + */ public ITmfProjectModelElement getParent(); - + /** + * Returns whether this model element has children or not. + * @return true if this model has children else false + */ public boolean hasChildren(); - + /** + * Returns a list of children model elements. + * @return a list of children model elements. + */ public List getChildren(); - + /** + * Method to add a child to the model element. + * @param child A child element to add. + */ public void addChild(ITmfProjectModelElement child); - + /** + * Method to remove a child from the model element. + * @param child A child element to remove + */ public void removeChild(ITmfProjectModelElement child); - + /** + * Method to request to refresh the project. + */ public void refresh(); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java index cd26bdca22..f57192a666 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Ericsson + * Copyright (c) 2010, 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 @@ -22,8 +22,11 @@ import org.eclipse.ui.views.properties.IPropertySource2; import org.eclipse.ui.views.properties.TextPropertyDescriptor; /** - * TmfExperimentElement + * Implementation of TMF Experiment Model Element. *

+ * @version 1.0 + * @author Francois Chouinard + * */ public class TmfExperimentElement extends TmfProjectModelElement implements IPropertySource2 { @@ -54,7 +57,12 @@ public class TmfExperimentElement extends TmfProjectModelElement implements IPro // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ - + /** + * Constructor + * @param name The name of the experiment + * @param folder The folder reference + * @param parent The experiment folder reference. + */ public TmfExperimentElement(String name, IFolder folder, TmfExperimentFolder parent) { super(name, folder, parent); parent.addChild(this); @@ -64,11 +72,19 @@ public class TmfExperimentElement extends TmfProjectModelElement implements IPro // TmfProjectModelElement // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#getResource() + */ @Override public IFolder getResource() { return (IFolder) fResource; } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getProject() + */ @Override public TmfProjectElement getProject() { return (TmfProjectElement) getParent().getParent(); @@ -77,7 +93,10 @@ public class TmfExperimentElement extends TmfProjectModelElement implements IPro // ------------------------------------------------------------------------ // Operations // ------------------------------------------------------------------------ - + /** + * Returns a list of TmfTraceElements contained in this experiment. + * @return a list of TmfTraceElements + */ public List getTraces() { List children = getChildren(); List traces = new ArrayList(); @@ -93,16 +112,28 @@ public class TmfExperimentElement extends TmfProjectModelElement implements IPro // IPropertySource2 // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() + */ @Override public Object getEditableValue() { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() + */ @Override public IPropertyDescriptor[] getPropertyDescriptors() { return (sfDescriptors != null) ? Arrays.copyOf(sfDescriptors, sfDescriptors.length) : null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) + */ @Override public Object getPropertyValue(Object id) { @@ -117,20 +148,36 @@ public class TmfExperimentElement extends TmfProjectModelElement implements IPro return null; } - + + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) + */ @Override public void resetPropertyValue(Object id) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object) + */ @Override public void setPropertyValue(Object id, Object value) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertyResettable(java.lang.Object) + */ @Override public boolean isPropertyResettable(Object id) { return false; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertySet(java.lang.Object) + */ @Override public boolean isPropertySet(Object id) { return false; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java index 115f4d16b2..52a83b54ff 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfExperimentFolder.java @@ -20,15 +20,20 @@ import org.eclipse.ui.views.properties.IPropertySource2; import org.eclipse.ui.views.properties.TextPropertyDescriptor; /** - * TmfExperimentFolder + * Implementation of the model element for the experiment folder. *

+ * @version 1.0 + * @author Francois Chouinard + * */ public class TmfExperimentFolder extends TmfProjectModelElement implements IPropertySource2 { // ------------------------------------------------------------------------ // Constants // ------------------------------------------------------------------------ - + /** + * The name of the experiment folder. + */ public static final String EXPER_FOLDER_NAME = "Experiments"; //$NON-NLS-1$ // Property View stuff @@ -53,6 +58,13 @@ public class TmfExperimentFolder extends TmfProjectModelElement implements IProp // Constructors // ------------------------------------------------------------------------ + /** + * Constructor. + * Creates a TmfExperimentFolder model element. + * @param name The name of the folder + * @param folder The folder reference + * @param parent The parent (project element) + */ public TmfExperimentFolder(String name, IFolder folder, TmfProjectElement parent) { super(name, folder, parent); parent.addChild(this); @@ -61,24 +73,62 @@ public class TmfExperimentFolder extends TmfProjectModelElement implements IProp // ------------------------------------------------------------------------ // TmfProjectModelElement // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#getResource() + */ @Override public IFolder getResource() { return (IFolder) fResource; } - + + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getProject() + */ @Override public TmfProjectElement getProject() { return (TmfProjectElement) getParent(); } - + + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#refresh() + */ @Override public void refresh() { TmfProjectElement project = (TmfProjectElement) getParent(); project.refresh(); } - // ------------------------------------------------------------------------} - // IPropertySource2 // ------------------------------------------------------------------------ @Override public Object getEditableValue() { return null; } @Override public IPropertyDescriptor[] getPropertyDescriptors() { return (sfDescriptors != null) ? Arrays.copyOf(sfDescriptors, sfDescriptors.length) : null; } @Override public Object getPropertyValue(Object id) { if (sfName.equals(id)) return getName(); if (sfPath.equals(id)) return getPath().toString(); if (sfLocation.equals(id)) return getLocation().toString(); return null; } @Override public void resetPropertyValue(Object id) { } @Override public void setPropertyValue(Object id, Object value) { } @Override public boolean isPropertyResettable(Object id) { return false; } @Override public boolean isPropertySet(Object id) { return false; } + // ------------------------------------------------------------------------ + // IPropertySource2 // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() + */ @Override public Object getEditableValue() { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() + */ @Override public IPropertyDescriptor[] getPropertyDescriptors() { return (sfDescriptors != null) ? Arrays.copyOf(sfDescriptors, sfDescriptors.length) : null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) + */ @Override public Object getPropertyValue(Object id) { if (sfName.equals(id)) return getName(); if (sfPath.equals(id)) return getPath().toString(); if (sfLocation.equals(id)) return getLocation().toString(); return null; } /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) + */ @Override public void resetPropertyValue(Object id) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object) + */ @Override public void setPropertyValue(Object id, Object value) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertyResettable(java.lang.Object) + */ @Override public boolean isPropertyResettable(Object id) { return false; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertySet(java.lang.Object) + */ @Override public boolean isPropertySet(Object id) { return false; } } \ No newline at end of file diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorContentProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorContentProvider.java index 8d02c9a698..ebf65691c2 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorContentProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Ericsson + * Copyright (c) 2010, 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 @@ -31,25 +31,38 @@ import org.eclipse.ui.navigator.PipelinedShapeModification; import org.eclipse.ui.navigator.PipelinedViewerUpdate; /** - * TmfNavigatorContentProvider + * The TMF project content provider for the tree viewer in the project explorer view. *

+ * @version 1.0 + * @author Francois Chouinard */ public class TmfNavigatorContentProvider implements ICommonContentProvider, IPipelinedTreeContentProvider { // ------------------------------------------------------------------------ // ICommonContentProvider // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object) + */ @Override public Object[] getElements(Object inputElement) { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) + */ @Override public Object getParent(Object element) { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) + */ @Override public boolean hasChildren(Object element) { if (element instanceof IProject) { @@ -71,22 +84,42 @@ public class TmfNavigatorContentProvider implements ICommonContentProvider, IPip return false; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IContentProvider#dispose() + */ @Override public void dispose() { } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) + */ @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } - + + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento) + */ @Override public void restoreState(IMemento aMemento) { } - + + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento) + */ @Override public void saveState(IMemento aMemento) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite) + */ @Override public void init(ICommonContentExtensionSite aConfig) { } @@ -94,7 +127,10 @@ public class TmfNavigatorContentProvider implements ICommonContentProvider, IPip // ------------------------------------------------------------------------ // ICommonContentProvider - getChildren() // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) + */ @Override public synchronized Object[] getChildren(Object parentElement) { @@ -121,6 +157,9 @@ public class TmfNavigatorContentProvider implements ICommonContentProvider, IPip return new Object[0]; } + // ------------------------------------------------------------------------ + // Helper method + // ------------------------------------------------------------------------ private Object[] getProjectChildren(IProject project) { // The children structure List children = new ArrayList(); @@ -302,12 +341,20 @@ public class TmfNavigatorContentProvider implements ICommonContentProvider, IPip // IPipelinedTreeContentProvider // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedChildren(java.lang.Object, java.util.Set) + */ @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void getPipelinedChildren(Object parent, Set currentChildren) { customizeTmfElements(getChildren(parent), currentChildren); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedElements(java.lang.Object, java.util.Set) + */ @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void getPipelinedElements(Object input, Set currentElements) { @@ -340,29 +387,48 @@ public class TmfNavigatorContentProvider implements ICommonContentProvider, IPip } } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedParent(java.lang.Object, java.lang.Object) + */ @Override public Object getPipelinedParent(Object anObject, Object aSuggestedParent) { return aSuggestedParent; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptAdd(org.eclipse.ui.navigator.PipelinedShapeModification) + */ @Override public PipelinedShapeModification interceptAdd(PipelinedShapeModification anAddModification) { return anAddModification; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptRemove(org.eclipse.ui.navigator.PipelinedShapeModification) + */ @Override public PipelinedShapeModification interceptRemove(PipelinedShapeModification aRemoveModification) { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptRefresh(org.eclipse.ui.navigator.PipelinedViewerUpdate) + */ @Override public boolean interceptRefresh(PipelinedViewerUpdate aRefreshSynchronization) { return false; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptUpdate(org.eclipse.ui.navigator.PipelinedViewerUpdate) + */ @Override public boolean interceptUpdate(PipelinedViewerUpdate anUpdateSynchronization) { return false; } - } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorLabelProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorLabelProvider.java index 60222c0818..2782e3dd51 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorLabelProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfNavigatorLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -29,8 +29,10 @@ import org.eclipse.ui.navigator.ICommonLabelProvider; import org.osgi.framework.Bundle; /** - * TmfNavigatorLabelProvider + * The TMF project label provider for the tree viewer in the project explorer view. *

+ * @version 1.0 + * @author Francois Chouinard */ public class TmfNavigatorLabelProvider implements ICommonLabelProvider { @@ -56,6 +58,11 @@ public class TmfNavigatorLabelProvider implements ICommonLabelProvider { // Constructors // ------------------------------------------------------------------------ + /** + * Constructor. + * + * Creates the TMF navigator content provider. + */ public TmfNavigatorLabelProvider() { Bundle bundle = Activator.getDefault().getBundle(); fDefaultTraceIcon = loadIcon(bundle, fTraceIconFile); @@ -78,7 +85,10 @@ public class TmfNavigatorLabelProvider implements ICommonLabelProvider { // ------------------------------------------------------------------------ // ICommonLabelProvider // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) + */ @Override public Image getImage(Object element) { @@ -109,6 +119,10 @@ public class TmfNavigatorLabelProvider implements ICommonLabelProvider { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) + */ @Override public String getText(Object element) { @@ -135,36 +149,68 @@ public class TmfNavigatorLabelProvider implements ICommonLabelProvider { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) + */ @Override public void addListener(ILabelProviderListener listener) { } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() + */ @Override public void dispose() { } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) + */ @Override public boolean isLabelProperty(Object element, String property) { return false; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) + */ @Override public void removeListener(ILabelProviderListener listener) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento) + */ @Override public void restoreState(IMemento aMemento) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento) + */ @Override public void saveState(IMemento aMemento) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.IDescriptionProvider#getDescription(java.lang.Object) + */ @Override public String getDescription(Object anElement) { return getText(anElement); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.navigator.ICommonLabelProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite) + */ @Override public void init(ICommonContentExtensionSite aConfig) { } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectElement.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectElement.java index 9d7dfb480a..652fab786e 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectElement.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -25,8 +25,10 @@ import org.eclipse.ui.navigator.CommonNavigator; import org.eclipse.ui.navigator.CommonViewer; /** - * TmfProjectElement - *

+ * The implementation of TMF project model element. + * + * @version 1.0 + * @author Francois Chouinard */ public class TmfProjectElement extends TmfProjectModelElement { @@ -34,13 +36,20 @@ public class TmfProjectElement extends TmfProjectModelElement { // Attributes // ------------------------------------------------------------------------ - TmfTraceFolder fTraceFolder = null; - TmfExperimentFolder fExperimentFolder = null; + private TmfTraceFolder fTraceFolder = null; + private TmfExperimentFolder fExperimentFolder = null; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor. + * + * Creates the TMF project model element. + * @param name The name of the project. + * @param project The project reference. + * @param parent The parent element + */ public TmfProjectElement(String name, IProject project, ITmfProjectModelElement parent) { super(name, project, parent); } @@ -49,11 +58,19 @@ public class TmfProjectElement extends TmfProjectModelElement { // TmfProjectModelElement // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#getResource() + */ @Override public IProject getResource() { return (IProject) fResource; } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#addChild(org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement) + */ @Override public void addChild(ITmfProjectModelElement child) { super.addChild(child); @@ -70,11 +87,18 @@ public class TmfProjectElement extends TmfProjectModelElement { // ------------------------------------------------------------------------ // Accessors // ------------------------------------------------------------------------ - + /** + * Returns the containing trace folder element. + * @return the TMF trace folder element. + */ public TmfTraceFolder getTracesFolder() { return fTraceFolder; } + /** + * Returns the containing experiment folder element. + * @return the TMF experiment folder element. + */ public TmfExperimentFolder getExperimentsFolder() { return fExperimentFolder; } @@ -83,6 +107,10 @@ public class TmfProjectElement extends TmfProjectModelElement { // TmfProjectElement // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#refresh() + */ @Override public void refresh() { Display.getDefault().asyncExec(new Runnable(){ @@ -104,6 +132,10 @@ public class TmfProjectElement extends TmfProjectModelElement { }}); } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) + */ @Override public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.POST_CHANGE) { @@ -111,9 +143,12 @@ public class TmfProjectElement extends TmfProjectModelElement { } } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getProject() + */ @Override public TmfProjectElement getProject() { return this; } - } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java index ab626f95b4..8d04041f13 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectModelElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Ericsson + * Copyright (c) 2010, 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 @@ -8,6 +8,7 @@ * * Contributors: * Francois Chouinard - Initial API and implementation + * Bernd Hufmann - Added supplementary files/folder handling *******************************************************************************/ package org.eclipse.linuxtools.tmf.ui.project.model; @@ -29,8 +30,11 @@ import org.eclipse.linuxtools.internal.tmf.ui.Activator; import org.eclipse.linuxtools.tmf.core.TmfCommonConstants; /** - * TmfProjectModelElement + * The implementation of the base TMF project model element. It provides default implementation + * of the ITmfProjectModelElement interface. *

+ * @version 1.0 + * @author Francois Chouinard */ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, IResourceChangeListener { @@ -39,16 +43,35 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, // ------------------------------------------------------------------------ private final String fName; + /** + * The project model element resource. + */ protected final IResource fResource; + /** + * The project model resource location (URI) + */ protected final URI fLocation; + /** + * The project model path of a resource. + */ protected final IPath fPath; private final ITmfProjectModelElement fParent; + /** + * The list of children elements. + */ protected final List fChildren; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor. + * + * Creates a base project model element. + * @param name The name of the element. + * @param resource The element resource. + * @param parent The parent model element. + */ protected TmfProjectModelElement(String name, IResource resource, ITmfProjectModelElement parent) { fName = name; fResource = resource; @@ -62,53 +85,83 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, // ------------------------------------------------------------------------ // ITmfProjectModelElement // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getName() + */ @Override public String getName() { return fName; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getResource() + */ @Override public IResource getResource() { return fResource; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getPath() + */ @Override public IPath getPath() { return fPath; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getLocation() + */ @Override public URI getLocation() { return fLocation; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getParent() + */ @Override public ITmfProjectModelElement getParent() { return fParent; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#hasChildren() + */ @Override public boolean hasChildren() { return fChildren.size() > 0; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getChildren() + */ @Override public List getChildren() { return fChildren; } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#addChild(org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement) + */ @Override public void addChild(ITmfProjectModelElement child) { fChildren.add(child); } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#removeChild(org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement) + */ @Override public void removeChild(ITmfProjectModelElement child) { fChildren.remove(child); refresh(); } - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#refresh() + */ @Override public void refresh() { // Do nothing by default: sub-classes override this on an "as-needed" @@ -118,7 +171,10 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, // ------------------------------------------------------------------------ // IResourceChangeListener // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) + */ @Override public void resourceChanged(IResourceChangeEvent event) { // Do nothing by default: sub-classes override this on an "as-needed" @@ -128,7 +184,10 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, // ------------------------------------------------------------------------ // Object // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see java.lang.Object#hashCode() + */ @Override public int hashCode() { final int prime = 31; @@ -138,7 +197,10 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, result = prime * result + ((fPath == null) ? 0 : fPath.hashCode()); return result; } - + /* + * (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ @Override public boolean equals(Object other) { if (this == other) @@ -150,7 +212,6 @@ public abstract class TmfProjectModelElement implements ITmfProjectModelElement, TmfProjectModelElement element = (TmfProjectModelElement) other; return element.fName.equals(fName) && element.fLocation.equals(fLocation); } - /** * Returns the trace specific supplementary directory under the project's supplementary folder. diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectRegistry.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectRegistry.java index e041bd3844..a1aebbf02b 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectRegistry.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfProjectRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -18,8 +18,10 @@ import java.util.Map; import org.eclipse.core.resources.IProject; /** - * TmfProjectRegistry + * Factory class storing TMF tracing projects and creating TMF project model elements. *

+ * @version 1.0 + * @author Francois Chouinard */ public class TmfProjectRegistry { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java index 70fcbc4be8..e868b74580 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Ericsson + * Copyright (c) 2010, 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 @@ -8,6 +8,7 @@ * * Contributors: * Francois Chouinard - Initial API and implementation + * Bernd Hufmann - Added supplementary files handling *******************************************************************************/ package org.eclipse.linuxtools.tmf.ui.project.model; @@ -39,8 +40,12 @@ import org.eclipse.ui.views.properties.IPropertySource2; import org.eclipse.ui.views.properties.TextPropertyDescriptor; /** - * TmfTraceElement - *

+ * Implementation of trace model element representing a trace. It provides methods to instantiate + * ITmfTrace and ITmfEvent as well as editor ID from the trace type + * extension definition. + * + * @version 1.0 + * @author Francois Chouinard */ public class TmfTraceElement extends TmfProjectModelElement implements IActionFilter, IPropertySource2 { @@ -49,7 +54,13 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi // ------------------------------------------------------------------------ // Other attributes + /** + * Bundle attribute name + */ public static final String BUNDLE = "bundle"; //$NON-NLS-1$ + /** + * IsLinked attribute name. + */ public static final String IS_LINKED = "isLinked"; //$NON-NLS-1$ // Property View stuff @@ -92,7 +103,9 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi private static final Map sfTraceTypeAttributes = new HashMap(); private static final Map sfTraceCategories = new HashMap(); - // Initialize statically at startup + /** + * Initialize statically at startup by getting extensions from the platform extension registry. + */ public static void init() { IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(TmfTraceType.TMF_TRACE_TYPE_ID); for (IConfigurationElement ce : config) { @@ -110,11 +123,23 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ - + /** + * Constructor. + * Creates trace model element under the trace folder. + * @param name The name of trace + * @param trace The trace resource. + * @param parent The parent element (trace folder) + */ public TmfTraceElement(String name, IResource trace, TmfTraceFolder parent) { this(name, trace, (TmfProjectModelElement) parent); } - + /** + * Constructor. + * Creates trace model element under the experiment folder. + * @param name The name of trace + * @param trace The trace resource. + * @param parent The parent element (experiment folder) + */ public TmfTraceElement(String name, IResource trace, TmfExperimentElement parent) { this(name, trace, (TmfProjectModelElement) parent); } @@ -128,11 +153,18 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi // ------------------------------------------------------------------------ // Operations // ------------------------------------------------------------------------ - + /** + * Returns the trace type ID. + * @return trace type ID. + */ public String getTraceType() { return fTraceTypeId; } + /** + * Refreshes the trace type filed by reading the trace type persistent property of the resource + * referenece. + */ public void refreshTraceType() { try { fTraceTypeId = getResource().getPersistentProperty(TmfCommonConstants.TRACETYPE); @@ -141,6 +173,11 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi } } + /** + * Instantiate a ITmfTrace object based on the trace type and the corresponding extension. + * + * @return the ITmfTrace or null for an error + */ public ITmfTrace instantiateTrace() { try { @@ -172,6 +209,11 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi return null; } + /** + * Instantiate a ITmfEvent object based on the trace type and the corresponding extension. + * + * @return the ITmfEvent or null for an error + */ public ITmfEvent instantiateEvent() { try { if (fTraceTypeId != null) { @@ -199,6 +241,10 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi return null; } + /** + * Returns the optional editor ID from the trace type extension. + * @return the editor ID or null if not defined. + */ public String getEditorId() { if (fTraceTypeId != null) { if (fTraceTypeId.startsWith(CustomTxtTrace.class.getCanonicalName())) { @@ -392,7 +438,10 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi // ------------------------------------------------------------------------ // TmfTraceElement // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getProject() + */ @Override public TmfProjectElement getProject() { if (getParent() instanceof TmfTraceFolder) { @@ -413,16 +462,28 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi // IPropertySource2 // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() + */ @Override public Object getEditableValue() { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() + */ @Override public IPropertyDescriptor[] getPropertyDescriptors() { return (sfDescriptors != null) ? Arrays.copyOf(sfDescriptors, sfDescriptors.length) : null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) + */ @Override public Object getPropertyValue(Object id) { @@ -463,19 +524,35 @@ public class TmfTraceElement extends TmfProjectModelElement implements IActionFi return "[no category]"; //$NON-NLS-1$ } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) + */ @Override public void resetPropertyValue(Object id) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object) + */ @Override public void setPropertyValue(Object id, Object value) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertyResettable(java.lang.Object) + */ @Override public boolean isPropertyResettable(Object id) { return false; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertySet(java.lang.Object) + */ @Override public boolean isPropertySet(Object id) { return false; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java index e9154c4213..feb1839611 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceFolder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -22,15 +22,19 @@ import org.eclipse.ui.views.properties.IPropertySource2; import org.eclipse.ui.views.properties.TextPropertyDescriptor; /** - * TmfTraceFolder + * Implementation of trace folder model element representing the trace folder in the project. *

+ * @version 1.0 + * @author Francois Chouinard */ public class TmfTraceFolder extends TmfProjectModelElement implements IPropertySource2 { // ------------------------------------------------------------------------ // Constants // ------------------------------------------------------------------------ - + /** + * The name of the trace folder + */ public static final String TRACE_FOLDER_NAME = "Traces"; //$NON-NLS-1$ // Property View stuff @@ -56,7 +60,13 @@ public class TmfTraceFolder extends TmfProjectModelElement implements IPropertyS // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor. + * Creates trace folder model element under the project. + * @param name The name of trace folder. + * @param trace The folder resource. + * @param parent The parent element (project). + */ public TmfTraceFolder(String name, IFolder resource, TmfProjectElement parent) { super(name, resource, parent); parent.addChild(this); @@ -65,17 +75,29 @@ public class TmfTraceFolder extends TmfProjectModelElement implements IPropertyS // ------------------------------------------------------------------------ // TmfProjectModelElement // ------------------------------------------------------------------------ - + + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#getResource() + */ @Override public IFolder getResource() { return (IFolder) fResource; } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement#getProject() + */ @Override public TmfProjectElement getProject() { return (TmfProjectElement) getParent(); } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement#refresh() + */ @Override public void refresh() { TmfProjectElement project = (TmfProjectElement) getParent(); @@ -85,7 +107,10 @@ public class TmfTraceFolder extends TmfProjectModelElement implements IPropertyS // ------------------------------------------------------------------------ // Operations // ------------------------------------------------------------------------ - + /** + * Returns a list of trace model elements under the traces folder. + * @return list of trace model elements + */ public List getTraces() { List children = getChildren(); List traces = new ArrayList(); @@ -101,16 +126,28 @@ public class TmfTraceFolder extends TmfProjectModelElement implements IPropertyS // IPropertySource2 // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() + */ @Override public Object getEditableValue() { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() + */ @Override public IPropertyDescriptor[] getPropertyDescriptors() { return (sfDescriptors != null) ? Arrays.copyOf(sfDescriptors, sfDescriptors.length) : null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) + */ @Override public Object getPropertyValue(Object id) { @@ -126,19 +163,35 @@ public class TmfTraceFolder extends TmfProjectModelElement implements IPropertyS return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) + */ @Override public void resetPropertyValue(Object id) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object) + */ @Override public void setPropertyValue(Object id, Object value) { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertyResettable(java.lang.Object) + */ @Override public boolean isPropertyResettable(Object id) { return false; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.views.properties.IPropertySource2#isPropertySet(java.lang.Object) + */ @Override public boolean isPropertySet(Object id) { return false; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceType.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceType.java index 38f0d78f8a..667496c23e 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceType.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TmfTraceType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -18,26 +18,71 @@ import java.util.List; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; +/** + * Utility class for accessing TMF trace type extensions from the platform's extensions registry. + * + * @version 1.0 + * @author Patrick Tasse + * + */ public class TmfTraceType { - // Extension point ID + /** + * Extension point ID + */ public static final String TMF_TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.ui.tracetype"; //$NON-NLS-1$ - // Extension point elements + /** + * Extension point element 'Category' + */ public static final String CATEGORY_ELEM = "category"; //$NON-NLS-1$ + /** + * Extension point element 'Type' + */ public static final String TYPE_ELEM = "type"; //$NON-NLS-1$ + /** + * Extension point element 'Default editor' + */ public static final String DEFAULT_EDITOR_ELEM = "defaultEditor"; //$NON-NLS-1$ + /** + * Extension point element 'Events table type' + */ public static final String EVENTS_TABLE_TYPE_ELEM = "eventsTableType"; //$NON-NLS-1$ - // Extension point attributes + /** + * Extension point attribute 'ID' + */ public static final String ID_ATTR = "id"; //$NON-NLS-1$ + /** + * Extension point attribute 'name' + */ public static final String NAME_ATTR = "name"; //$NON-NLS-1$ + /** + * Extension point attribute 'category' + */ public static final String CATEGORY_ATTR = "category"; //$NON-NLS-1$ + /** + * Extension point attribute 'trace_type' + */ public static final String TRACE_TYPE_ATTR = "trace_type"; //$NON-NLS-1$ + /** + * Extension point attribute 'event_type' + */ public static final String EVENT_TYPE_ATTR = "event_type"; //$NON-NLS-1$ + /** + * Extension point attribute 'icon' + */ public static final String ICON_ATTR = "icon"; //$NON-NLS-1$ + /** + * Extension point attribute 'class' + */ public static final String CLASS_ATTR = "class"; //$NON-NLS-1$ + /** + * Retrieves the category name from the platform extension registry based on the category ID + * @param categoryId The category ID + * @return the category name or empty string if not found + */ public static String getCategoryName(String categoryId) { IConfigurationElement[] elements = Platform.getExtensionRegistry() .getConfigurationElementsFor(TMF_TRACE_TYPE_ID); @@ -49,6 +94,12 @@ public class TmfTraceType { return ""; //$NON-NLS-1$ } + /** + * Retrieves all configuration elements from the platform extension registry + * for the trace type extension. + * + * @return an array of trace type configuration elements + */ public static IConfigurationElement[] getTypeElements() { IConfigurationElement[] elements = Platform.getExtensionRegistry() .getConfigurationElementsFor(TMF_TRACE_TYPE_ID); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderContentProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderContentProvider.java index 962f629ba8..4dfe63b2c1 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderContentProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Ericsson + * Copyright (c) 2010, 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 @@ -19,12 +19,19 @@ import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.Viewer; /** - * TraceFolderContentProvider + * Content provider implementation for trace folders for tree viewers that display + * the content of a trace folder. *

- * TODO: Implement me. Please. + * + * @version 1.0 + * @author Francois Chouinard */ public class TraceFolderContentProvider implements IStructuredContentProvider { + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) + */ @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof TmfTraceFolder) { @@ -43,10 +50,18 @@ public class TraceFolderContentProvider implements IStructuredContentProvider { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IContentProvider#dispose() + */ @Override public void dispose() { } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) + */ @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderLabelProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderLabelProvider.java index 7361fd729e..04ca2aeffd 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderLabelProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/model/TraceFolderLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Ericsson + * Copyright (c) 2010, 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 @@ -17,16 +17,28 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.swt.graphics.Image; /** - * TraceFolderLabelProvider + * Label provider implementation for trace folders for tree viewers that display + * the content of a trace folder. *

+ * + * @version 1.0 + * @author Francois Chouinard */ public class TraceFolderLabelProvider extends LabelProvider implements ITableLabelProvider { + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) + */ @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) + */ @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof TmfTraceElement) { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyExperimentDialog.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyExperimentDialog.java index 4db3bf2cb5..1dd6aee84a 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyExperimentDialog.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyExperimentDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -49,8 +49,10 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SelectionStatusDialog; /** - * CopyExperimentDialog + * Implementation of the copy experiement dialog box. *

+ * @version 1.0 + * @author Francois Chouinard */ public class CopyExperimentDialog extends SelectionStatusDialog { @@ -67,6 +69,11 @@ public class CopyExperimentDialog extends SelectionStatusDialog { // Constructor // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell The parent shell + * @param experiment The TMF experiment model element + */ public CopyExperimentDialog(Shell shell, TmfExperimentElement experiment) { super(shell); fExperiment = experiment; @@ -80,7 +87,11 @@ public class CopyExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Dialog // ------------------------------------------------------------------------ - + + /* + * (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); @@ -160,17 +171,28 @@ public class CopyExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // SelectionStatusDialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() + */ @Override protected void computeResult() { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#create() + */ @Override public void create() { super.create(); getButton(IDialogConstants.OK_ID).setEnabled(false); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed() + */ @Override protected void okPressed() { IFolder folder = copyExperiment(fNewExperimentName.getText()); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyTraceDialog.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyTraceDialog.java index 133c788b4f..2c92cd7440 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyTraceDialog.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/CopyTraceDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -49,8 +49,10 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SelectionStatusDialog; /** - * CopyExperimentDialog + * Implementation of the copy trace dialog box. *

+ * @version 1.0 + * @author Francois Chouinard */ public class CopyTraceDialog extends SelectionStatusDialog { @@ -66,7 +68,11 @@ public class CopyTraceDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor. + * @param shell The parent shell + * @param trace The trace model element. + */ public CopyTraceDialog(Shell shell, TmfTraceElement trace) { super(shell); fTrace = trace; @@ -80,7 +86,10 @@ public class CopyTraceDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Dialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); @@ -163,16 +172,28 @@ public class CopyTraceDialog extends SelectionStatusDialog { // SelectionStatusDialog // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() + */ @Override protected void computeResult() { } - + + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#create() + */ @Override public void create() { super.create(); getButton(IDialogConstants.OK_ID).setEnabled(false); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed() + */ @Override protected void okPressed() { IResource trace = copyTrace(fNewTraceName.getText()); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizard.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizard.java index f8624d5745..f3416fe407 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizard.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Ericsson + * Copyright (c) 2010, 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 @@ -24,8 +24,10 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.ide.IDE; /** - * ImportTraceWizard + * The import trace wizard implementation. *

+ * @version 1.0 + * @author Francois Chouinard */ public class ImportTraceWizard extends Wizard implements IImportWizard { @@ -48,7 +50,9 @@ public class ImportTraceWizard extends Wizard implements IImportWizard { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Default constructor + */ public ImportTraceWizard() { IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings(); IDialogSettings section = workbenchSettings.getSection(IMPORT_WIZARD); @@ -62,6 +66,10 @@ public class ImportTraceWizard extends Wizard implements IImportWizard { // Wizard // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) + */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { fWorkbench = workbench; @@ -77,13 +85,21 @@ public class ImportTraceWizard extends Wizard implements IImportWizard { setNeedsProgressMonitor(true); } + /* + * (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#addPages() + */ @Override public void addPages() { super.addPages(); fTraceImportWizardPage = new ImportTraceWizardPage(fWorkbench, fSelection); addPage(fTraceImportWizardPage); } - + + /* + * (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#performFinish() + */ @Override public boolean performFinish() { return fTraceImportWizardPage.finish(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java index 1b141c60f0..217dc217c7 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010, 2011 Ericsson + * Copyright (c) 2009, 2010, 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 @@ -96,7 +96,9 @@ import org.eclipse.ui.wizards.datatransfer.ImportOperation; * For our purpose, a trace can either be a single file or a whole directory sub-tree, whichever is reached first from * the root directory. *

- * TODO: Consider adding Filter/Select/Deselect buttons + * + * @version 1.0 + * @author Francois Chouinard */ public class ImportTraceWizardPage extends WizardResourceImportPage implements Listener { @@ -129,10 +131,22 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L // Constructors // ------------------------------------------------------------------------ + /** + * Constructor. + * Creates the trace wizard page. + * + * @param name The name of the page. + * @param selection The current selection + */ protected ImportTraceWizardPage(String name, IStructuredSelection selection) { super(name, selection); } + /** + * Constructor + * @param workbench The workbench reference. + * @param selection The current selection + */ public ImportTraceWizardPage(IWorkbench workbench, IStructuredSelection selection) { this(IMPORT_WIZARD_PAGE, selection); setTitle(Messages.ImportTraceWizard_FileSystemTitle); @@ -167,7 +181,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L // ------------------------------------------------------------------------ // WizardResourceImportPage // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createControl(org.eclipse.swt.widgets.Composite) + */ @Override public void createControl(Composite parent) { super.createControl(parent); @@ -178,6 +195,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L } } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createSourceGroup(org.eclipse.swt.widgets.Composite) + */ @Override protected void createSourceGroup(Composite parent) { createDirectorySelectionGroup(parent); @@ -186,6 +207,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L validateSourceGroup(); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createFileSelectionGroup(org.eclipse.swt.widgets.Composite) + */ @Override protected void createFileSelectionGroup(Composite parent) { @@ -229,11 +254,19 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L }); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFolderProvider() + */ @Override protected ITreeContentProvider getFolderProvider() { return null; } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFileProvider() + */ @Override protected ITreeContentProvider getFileProvider() { return new WorkbenchContentProvider() { @@ -276,7 +309,11 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L } } } - + + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getSelectedResources() + */ @Override protected List getSelectedResources() { List resources = new ArrayList(); @@ -293,10 +330,20 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L // Directory Selection Group (forked WizardFileSystemResourceImportPage1) // ------------------------------------------------------------------------ + /** + * The directory name field + */ protected Combo directoryNameField; + /** + * The directory browse button. + */ protected Button directoryBrowseButton; private boolean entryChanged = false; + /** + * creates the directory selection group. + * @param parent the parent composite + */ protected void createDirectorySelectionGroup(Composite parent) { Composite directoryContainerGroup = new Composite(parent, SWT.NONE); @@ -370,6 +417,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L // Browse for the source directory // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardResourceImportPage#handleEvent(org.eclipse.swt.widgets.Event) + */ @Override public void handleEvent(Event event) { if (event.widget == directoryBrowseButton) { @@ -378,6 +429,9 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L super.handleEvent(event); } + /** + * Handle the button pressed event + */ protected void handleSourceDirectoryBrowseButtonPressed() { String currentSource = directoryNameField.getText(); DirectoryDialog dialog = new DirectoryDialog(directoryNameField.getShell(), SWT.SAVE | SWT.SHEET); @@ -603,6 +657,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L private Button overwriteExistingResourcesCheckbox; private Button createLinksInWorkspaceButton; + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardDataTransferPage#createOptionsGroupButtons(org.eclipse.swt.widgets.Group) + */ @Override protected void createOptionsGroupButtons(Group optionsGroup) { @@ -632,6 +690,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L // Determine if the finish button can be enabled // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.WizardDataTransferPage#validateSourceGroup() + */ @Override public boolean validateSourceGroup() { @@ -733,6 +795,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage implements L // Import the trace(s) // ------------------------------------------------------------------------ + /** + * Finish the import. + * @return true if successful else false + */ public boolean finish() { // Ensure source is valid File sourceDir = new File(getSourceDirectoryName()); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/Messages.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/Messages.java index 215bc8b358..a0cae2cf03 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/Messages.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -14,13 +14,18 @@ package org.eclipse.linuxtools.tmf.ui.project.wizards; import org.eclipse.osgi.util.NLS; +/** + * Message string for TMF model handling. + * @version 1.0 + * @author Francois Chouinard + * + */ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.project.wizards.messages"; //$NON-NLS-1$ public static String NewProjectWizard_DialogHeader; public static String NewProjectWizard_DialogMessage; - public static String ImportTraceWizard_DialogTitle; public static String ImportTraceWizard_FileSystemTitle; public static String ImportTraceWizard_ImportTrace; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewExperimentDialog.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewExperimentDialog.java index 6d1819e139..f75132796b 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewExperimentDialog.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewExperimentDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Ericsson + * Copyright (c) 2009, 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 @@ -48,8 +48,11 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SelectionStatusDialog; /** - * NewExperimentHandler + * Implementation of new experiment dialog that creates the experiment element. *

+ * @version 1.0 + * @author Francois Chouinard + */ public class NewExperimentDialog extends SelectionStatusDialog { @@ -64,7 +67,11 @@ public class NewExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor + * @param shell The parent shell + * @param experimentFolder The parent experiment folder element + */ public NewExperimentDialog(Shell shell, TmfExperimentFolder experimentFolder) { super(shell); fExperimentFolder = experimentFolder.getResource(); @@ -76,7 +83,10 @@ public class NewExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Dialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); @@ -142,17 +152,28 @@ public class NewExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // SelectionStatusDialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() + */ @Override protected void computeResult() { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#create() + */ @Override public void create() { super.create(); getButton(IDialogConstants.OK_ID).setEnabled(false); } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed() + */ @Override protected void okPressed() { IFolder folder = createNewExperiment(fExperimentName.getText()); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectMainWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectMainWizardPage.java index 6e71cf8db1..e266865da4 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectMainWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectMainWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Ericsson + * Copyright (c) 2009, 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 @@ -15,10 +15,11 @@ package org.eclipse.linuxtools.tmf.ui.project.wizards; import org.eclipse.ui.dialogs.WizardNewProjectCreationPage; /** - * NewProjectMainWizardPage + * The wizard page for creation of a new TMF tracing project. *

- * - * TODO: Implement me. Please. + * @version 1.0 + * @author Francois Chouinard + */ public class NewTmfProjectMainWizardPage extends WizardNewProjectCreationPage { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectWizard.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectWizard.java index 4a46cb3cbc..f4eefa0d5c 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectWizard.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/NewTmfProjectWizard.java @@ -37,31 +37,49 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard; /** - * NewTmfProjectWizard + * Wizard implementation for creating a TMF tracing project. *

+ * @version 1.0 + * @author Francois Chouinard */ public class NewTmfProjectWizard extends Wizard implements INewWizard, IExecutableExtension { private final String fTtitle; private final String fDescription; + /** + * Wizard main page + */ protected NewTmfProjectMainWizardPage fMainPage; + /** + * The Project name + */ protected String fProjectName; + /** + * The project location + */ protected URI fProjectLocation; + /** + * The configuration element. + */ protected IConfigurationElement fConfigElement; + /** + * The project reference + */ protected IProject fProject; /** - * + * Default constructor */ public NewTmfProjectWizard() { this(Messages.NewProjectWizard_DialogHeader, Messages.NewProjectWizard_DialogMessage); } /** - * @param title - * @param desc + * Constructor + * @param title The tile string + * @param desc The description string */ public NewTmfProjectWizard(String title, String desc) { super(); @@ -110,12 +128,6 @@ public class NewTmfProjectWizard extends Wizard implements INewWizard, IExecutab return true; } - /** - * @param projectName - * @param projectLocation - * @param monitor - * @return - */ private IProject createProject(String projectName, URI projectLocation, IProgressMonitor monitor) { IWorkspace workspace = ResourcesPlugin.getWorkspace(); @@ -173,6 +185,10 @@ public class NewTmfProjectWizard extends Wizard implements INewWizard, IExecutab // IExecutableExtension // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) + */ @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { fConfigElement = config; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameExperimentDialog.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameExperimentDialog.java index ff639aa7aa..64cdeff85a 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameExperimentDialog.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameExperimentDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -49,8 +49,10 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SelectionStatusDialog; /** - * RenameExperimentDialog - *

+ * Implementation of a dialog box to rename an experiment. + *

+ * @version 1.0 + * @author Francois Chouinard */ public class RenameExperimentDialog extends SelectionStatusDialog { @@ -67,6 +69,11 @@ public class RenameExperimentDialog extends SelectionStatusDialog { // Constructor // ------------------------------------------------------------------------ + /** + * Constructor + * @param shell The parent shell + * @param experiment The experiment element rename + */ public RenameExperimentDialog(Shell shell, TmfExperimentElement experiment) { super(shell); fExperiment = experiment; @@ -80,7 +87,10 @@ public class RenameExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Dialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); @@ -160,17 +170,28 @@ public class RenameExperimentDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // SelectionStatusDialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() + */ @Override protected void computeResult() { } + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#create() + */ @Override public void create() { super.create(); getButton(IDialogConstants.OK_ID).setEnabled(false); } - + + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed() + */ @Override protected void okPressed() { IFolder folder = renameExperiment(fNewExperimentName.getText()); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameTraceDialog.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameTraceDialog.java index fae0aea1ec..9b81c19de5 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameTraceDialog.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/RenameTraceDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -49,8 +49,10 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SelectionStatusDialog; /** - * RenameTraceDialog - *

+ * Implementation of a dialog box to rename a trace. + *

+ * @version 1.0 + * @author Francois Chouinard */ public class RenameTraceDialog extends SelectionStatusDialog { @@ -67,7 +69,11 @@ public class RenameTraceDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor + * @param shell The parent shell + * @param trace The trace element to rename + */ public RenameTraceDialog(Shell shell, TmfTraceElement trace) { super(shell); fTrace = trace; @@ -81,7 +87,10 @@ public class RenameTraceDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // Dialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); @@ -133,6 +142,10 @@ public class RenameTraceDialog extends SelectionStatusDialog { }); } + /** + * Returns the new trace name + * @return the new trace name + */ public String getNewTraceName() { return fNewTraceName; } @@ -167,17 +180,26 @@ public class RenameTraceDialog extends SelectionStatusDialog { // ------------------------------------------------------------------------ // SelectionStatusDialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() + */ @Override protected void computeResult() { } - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#create() + */ @Override public void create() { super.create(); getButton(IDialogConstants.OK_ID).setEnabled(false); } - + /* + * (non-Javadoc) + * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed() + */ @Override protected void okPressed() { IResource trace = renameTrace(fNewTraceNameText.getText()); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizard.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizard.java index 2fbf3a8c95..65b6942c05 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizard.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010, 2011 Ericsson + * Copyright (c) 2009, 2010, 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 @@ -20,8 +20,10 @@ import org.eclipse.ui.IImportWizard; import org.eclipse.ui.IWorkbench; /** - * SelectTracesWizard + * Wizard implementation to select traces for an experiment. *

+ * @version 1.0 + * @author Francois Chouinard */ public class SelectTracesWizard extends Wizard implements IImportWizard { @@ -36,7 +38,11 @@ public class SelectTracesWizard extends Wizard implements IImportWizard { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor + * @param project The project model element + * @param experiment The experiemnt model element + */ public SelectTracesWizard(TmfProjectElement project, TmfExperimentElement experiment) { fProject = project; fExperiment = experiment; @@ -46,11 +52,19 @@ public class SelectTracesWizard extends Wizard implements IImportWizard { // Wizard // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) + */ @Override public void init(IWorkbench workbench, IStructuredSelection selection) { setWindowTitle(Messages.SelectTracesWizard_WindowTitle); } + /* + * (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#addPages() + */ @Override public void addPages() { super.addPages(); @@ -58,6 +72,10 @@ public class SelectTracesWizard extends Wizard implements IImportWizard { addPage(fSelectTraceWizardPage); } + /* + * (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#performFinish() + */ @Override public boolean performFinish() { return fSelectTraceWizardPage.performFinish(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java index 92415c4542..4e70547fc1 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/SelectTracesWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010, 2011 Ericsson + * Copyright (c) 2009, 2010, 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 @@ -45,8 +45,11 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; /** - * SelectTracesWizardPage + * Implementation of a wizard page for selecting trace for an experiment. *

+ * + * @version 1.0 + * @author Francois Chouinard */ public class SelectTracesWizardPage extends WizardPage { @@ -62,7 +65,11 @@ public class SelectTracesWizardPage extends WizardPage { // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor + * @param project The project model element. + * @param experiment The experiment model experiment. + */ protected SelectTracesWizardPage(TmfProjectElement project, TmfExperimentElement experiment) { super(""); //$NON-NLS-1$ setTitle(Messages.SelectTracesWizardPage_WindowTitle); @@ -74,7 +81,10 @@ public class SelectTracesWizardPage extends WizardPage { // ------------------------------------------------------------------------ // Dialog // ------------------------------------------------------------------------ - + /* + * (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) + */ @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -127,6 +137,10 @@ public class SelectTracesWizardPage extends WizardPage { } } + /** + * Method to finalize the select operation. + * @return true if successful else false + */ public boolean performFinish() { IFolder experiment = fExperiment.getResource(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/FullTraceHistogram.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/FullTraceHistogram.java index f95d39d456..f5328486bc 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/FullTraceHistogram.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/FullTraceHistogram.java @@ -9,7 +9,6 @@ * Contributors: * Francois Chouinard - Initial API and implementation * Bernd Hufmann - Changed to updated histogram data model - * Francois Chouinard - Initial API and implementation *******************************************************************************/ package org.eclipse.linuxtools.tmf.ui.views.histogram; @@ -25,11 +24,12 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; /** - * FullTraceHistogram - *

* A histogram that displays the full trace. *

* It also features a selected range window that can be dragged and zoomed. + * + * @version 1.0 + * @author Francois Chouinard */ public class FullTraceHistogram extends Histogram implements MouseMoveListener { @@ -53,6 +53,12 @@ public class FullTraceHistogram extends Histogram implements MouseMoveListener { // Construction // ------------------------------------------------------------------------ + /** + * Standard Constructor. + * + * @param view A reference to the parent histogram view + * @param parent A reference to the parent composite + */ public FullTraceHistogram(HistogramView view, Composite parent) { super(view, parent); fZoom = new HistogramZoom(this, fCanvas, getStartTime(), getTimeLimit()); @@ -69,10 +75,22 @@ public class FullTraceHistogram extends Histogram implements MouseMoveListener { // Operations // ------------------------------------------------------------------------ + /** + * Sets the time range of the full histogram. + * + * @param startTime A start time + * @param endTime A end time + */ public void setFullRange(long startTime, long endTime) { fZoom.setFullRange(startTime, endTime); } + /** + * Sets the selected time range. + * + * @param startTime A start time + * @param duration A window duration + */ public void setTimeRange(long startTime, long duration) { fRangeStartTime = startTime; fRangeDuration = duration; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java index fd53cdcfbb..17efdea650 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java @@ -38,9 +38,9 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Text; /** - * Histogram - *

- * Re-usable histogram widget with the following features: + * Re-usable histogram widget. + * + * It has the following features: *

    *
  • Y-axis labels displaying min/max count values *
  • X-axis labels displaying time range @@ -70,6 +70,9 @@ import org.eclipse.swt.widgets.Text; *
  • end of the time range *
  • number of events in that time range *
+ * + * @version 1.0 + * @author Francois Chouinard */ public abstract class Histogram implements ControlListener, PaintListener, KeyListener, MouseListener, MouseTrackListener, IHistogramModelListener { @@ -84,8 +87,14 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi private final Color fHistoBarColor = new Color(Display.getDefault(), 74, 112, 139); // Timestamp scale (nanosecond) + /** + * The time scale of the histogram (nano seconds) + */ public static final byte TIME_SCALE = -9; + /** + * The histogram bar width (number of pixels). + */ public static final int HISTOGRAM_BAR_WIDTH = 1; // ------------------------------------------------------------------------ @@ -93,6 +102,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi // ------------------------------------------------------------------------ // Owner view + /** + * The parent TMF view. + */ protected TmfView fParentView; // Histogram text fields @@ -101,11 +113,17 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi private Text fTimeRangeStartText; private Text fTimeRangeEndText; - // Histogram drawing area + /** + * Histogram drawing area + */ protected Canvas fCanvas; - - // Data model + /** + * The histogram data model. + */ protected final HistogramDataModel fDataModel; + /** + * The histogram data model scaled to current resolution and screen width. + */ protected HistogramScaledData fScaledData; protected long fCurrentEventTime = 0; @@ -114,6 +132,12 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi // Construction // ------------------------------------------------------------------------ + /** + * Standard constructor. + * + * @param view A reference to the parent TMF view. + * @param parent A parent composite + */ public Histogram(final TmfView view, final Composite parent) { fParentView = view; @@ -129,6 +153,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi fCanvas.addMouseTrackListener(this); } + /** + * Dispose resources and deregisters listeners. + */ public void dispose() { fHistoBarColor.dispose(); fDataModel.removeHistogramListener(this); @@ -240,18 +267,34 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi // Accessors // ------------------------------------------------------------------------ + /** + * Returns the start time (equal first bucket time). + * @return the start time. + */ public long getStartTime() { return fDataModel.getFirstBucketTime(); } + /** + * Returns the end time. + * @return the end time. + */ public long getEndTime() { return fDataModel.getEndTime(); } + /** + * Returns the time limit (end of last bucket) + * @return the time limit. + */ public long getTimeLimit() { return fDataModel.getTimeLimit(); } + /** + * Returns a data model reference. + * @return data model. + */ public HistogramDataModel getDataModel() { return fDataModel; } @@ -259,6 +302,11 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi // ------------------------------------------------------------------------ // Operations // ------------------------------------------------------------------------ + /** + * Updates the time range. + * @param startTime A start time + * @param endTime A end time. + */ public abstract void updateTimeRange(long startTime, long endTime); /** @@ -412,7 +460,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi // ------------------------------------------------------------------------ // PaintListener // ------------------------------------------------------------------------ - + /** + * Image key string for the canvas. + */ protected final String IMAGE_KEY = "double-buffer-image"; //$NON-NLS-1$ @Override diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java index 0a1dd9bbb7..79a502633f 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramCurrentTimeControl.java @@ -16,9 +16,10 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; import org.eclipse.swt.widgets.Composite; /** - * HistogramCurrentTimeControl - *

* This control provides a group containing a text control. + * + * @version 1.0 + * @author Francois Chouinard */ public class HistogramCurrentTimeControl extends HistogramTextControl { @@ -26,10 +27,28 @@ public class HistogramCurrentTimeControl extends HistogramTextControl { // Construction // ------------------------------------------------------------------------ + /** + * Constructor with default group and text value. + * + * @param parentView A parent histogram view + * @param parent A parent composite to draw in + * @param textStyle A test style + * @param groupStyle A group style + */ public HistogramCurrentTimeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle) { this(parentView, parent, textStyle, groupStyle, "", HistogramUtils.nanosecondsToString(0L)); //$NON-NLS-1$ } + /** + * + * Constructor + * @param parentView A parent histogram view + * @param parent A parent composite to draw in + * @param textStyle A test style + * @param groupStyle A group style + * @param groupValue A group value + * @param textValue A text value + */ public HistogramCurrentTimeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle, String groupValue, String textValue) { super(parentView, parent, textStyle, groupStyle, groupValue, textValue); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramDataModel.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramDataModel.java index c9db53399a..0e10f58739 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramDataModel.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramDataModel.java @@ -20,9 +20,9 @@ import java.util.Arrays; import org.eclipse.core.runtime.ListenerList; /** - * HistogramDataModel - *

- * Histogram-independent data model with the following characteristics: + * Histogram-independent data model. + * + * It has the following characteristics: *

    *
  • The basetime is the timestamp of the first event *
  • There is a fixed number (n) of buckets of uniform duration @@ -57,10 +57,9 @@ import org.eclipse.core.runtime.ListenerList; * respect to to the number of pixels in the actual histogram, we should achieve * a nice result when visualizing the histogram. *

    - * TODO: Add filter support for more refined event counting (e.g. by trace, - * event type, etc.) - *

    - * TODO: Cut-off eccentric values? TODO: Support for going back in time? + * + * @version 1.0 + * @author Francois Chouinard */ public class HistogramDataModel implements IHistogramDataModel { @@ -68,9 +67,14 @@ public class HistogramDataModel implements IHistogramDataModel { // Constants // ------------------------------------------------------------------------ - // The default number of buckets + /** + * The default number of buckets + */ public static final int DEFAULT_NUMBER_OF_BUCKETS = 16 * 1000; + /** + * Number of events after which listeners will be notified. + */ public static final int REFRESH_FREQUENCY = DEFAULT_NUMBER_OF_BUCKETS; // ------------------------------------------------------------------------ @@ -98,10 +102,17 @@ public class HistogramDataModel implements IHistogramDataModel { // Constructors // ------------------------------------------------------------------------ + /** + * Default constructor with default number of buckets. + */ public HistogramDataModel() { this(DEFAULT_NUMBER_OF_BUCKETS); } + /** + * Constructor with non-default number of buckets. + * @param nbBuckets A number of buckets. + */ public HistogramDataModel(int nbBuckets) { fNbBuckets = nbBuckets; fBuckets = new long[nbBuckets]; @@ -109,6 +120,10 @@ public class HistogramDataModel implements IHistogramDataModel { clear(); } + /** + * Copy constructor. + * @param other A model to copy. + */ public HistogramDataModel(HistogramDataModel other) { fNbBuckets = other.fNbBuckets; fBuckets = Arrays.copyOf(other.fBuckets, fNbBuckets); @@ -131,34 +146,66 @@ public class HistogramDataModel implements IHistogramDataModel { // Accessors // ------------------------------------------------------------------------ + /** + * Returns the number of events in the data model. + * @return number of events. + */ public long getNbEvents() { return fNbEvents; } + /** + * Returns the number of buckets in the model. + * @return number of buckets. + */ public int getNbBuckets() { return fNbBuckets; } + /** + * Returns the current bucket duration. + * @return bucket duration + */ public long getBucketDuration() { return fBucketDuration; } + /** + * Returns the time value of the first bucket in the model. + * @return time of first bucket. + */ public long getFirstBucketTime() { return fFirstBucketTime; } + /** + * Returns the time of the first event in the model. + * @return time of first event. + */ public long getStartTime() { return fFirstEventTime; } + /** + * Returns the time of the last event in the model. + * @return the time of last event. + */ public long getEndTime() { return fLastEventTime; } + /** + * Returns the time of the current event in the model. + * @return the time of the current event. + */ public long getCurrentEventTime() { return fCurrentEventTime; } + /** + * Returns the time limit with is: start time + nbBuckets * bucketDuration + * @return the time limit. + */ public long getTimeLimit() { return fTimeLimit; } @@ -167,18 +214,28 @@ public class HistogramDataModel implements IHistogramDataModel { // Listener handling // ------------------------------------------------------------------------ + /** + * Add a listener to the model to be informed about model changes. + * @param listener A listener to add. + */ public void addHistogramListener(IHistogramModelListener listener) { fModelListeners.add(listener); } + /** + * Remove a given model listener. + * @param listener A listener to remove. + */ public void removeHistogramListener(IHistogramModelListener listener) { fModelListeners.remove(listener); } + // Notify listeners (always) private void fireModelUpdateNotification() { fireModelUpdateNotification(0); } + // Notify listener on boundary private void fireModelUpdateNotification(long count) { if ((count % REFRESH_FREQUENCY) == 0) { Object[] listeners = fModelListeners.getListeners(); @@ -193,6 +250,10 @@ public class HistogramDataModel implements IHistogramDataModel { // Operations // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.views.distribution.model.IBaseDistributionModel#complete() + */ @Override public void complete() { fireModelUpdateNotification(); @@ -200,6 +261,7 @@ public class HistogramDataModel implements IHistogramDataModel { /** * Clear the histogram model. + * @see org.eclipse.linuxtools.tmf.ui.views.distribution.model.IBaseDistributionModel#clear() */ @Override public void clear() { @@ -215,18 +277,18 @@ public class HistogramDataModel implements IHistogramDataModel { } /** - * Sets the current event time + * Sets the current event time (no notification of listeners) * - * @param timestamp + * @param timestamp A time stamp to set. */ public void setCurrentEvent(long timestamp) { fCurrentEventTime = timestamp; } /** - * Sets the current event time + * Sets the current event time with notification of listeners * - * @param timestamp + * @param timestamp A time stamp to set. */ public void setCurrentEventNotifyListeners(long timestamp) { fCurrentEventTime = timestamp; @@ -236,7 +298,9 @@ public class HistogramDataModel implements IHistogramDataModel { /** * Add event to the correct bucket, compacting the if needed. * - * @param timestamp the timestamp of the event to count + * @param eventCount The current event Count (for notification purposes) + * @param timestamp The timestamp of the event to count + * */ @Override public void countEvent(long eventCount, long timestamp) { @@ -301,11 +365,12 @@ public class HistogramDataModel implements IHistogramDataModel { /** * Scale the model data to the width, height and bar width requested. * - * @param width - * @param height - * @param barWidth - * @return the result array of size [width] and where the highest value - * doesn't exceed [height] + * @param width A width of the histogram canvas + * @param height A height of the histogram canvas + * @param barWidth A width (in pixel) of a histogram bar + * @return the result array of size [width] and where the highest value doesn't exceed [height] + * + * @see org.eclipse.linuxtools.tmf.ui.views.histogram.IHistogramDataModel#scaleTo(int, int, int) */ @Override public HistogramScaledData scaleTo(int width, int height, int barWidth) { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramRequest.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramRequest.java index 4de693cb48..7631916631 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramRequest.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramRequest.java @@ -22,7 +22,10 @@ import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest; import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace; /** - * HistogramRequest + * Class to request events for given time range from a trace to fill a HistogramDataModel and HistogramView. + * + * @version 1.0 + * @author Francois Chouinard *

    */ public class HistogramRequest extends TmfEventRequest { @@ -31,12 +34,25 @@ public class HistogramRequest extends TmfEventRequest { // Attributes // ------------------------------------------------------------------------ + /** + * The histogram data model to fill. + */ protected final HistogramDataModel fHistogram; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ + /** + * Constructor + * @param histogram The histogram data model + * @param range The time range to request data + * @param rank The index of the first event to retrieve + * @param nbEvents The number of events requested + * @param blockSize the number of events per block + * @param priority the requested execution priority + * + */ public HistogramRequest(HistogramDataModel histogram, TmfTimeRange range, int rank, int nbEvents, int blockSize, ITmfDataRequest.ExecutionType execType) { super(ITmfEvent.class, range, rank, nbEvents, (blockSize > 0) ? blockSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, execType); fHistogram = histogram; @@ -45,7 +61,13 @@ public class HistogramRequest extends TmfEventRequest { // ------------------------------------------------------------------------ // TmfEventRequest // ------------------------------------------------------------------------ - + + /** + * Handle the event from the trace by updating the histogram data model. + * + * @param event a event from the trace + * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleData(org.eclipse.linuxtools.tmf.core.event.ITmfEvent) + */ @Override public void handleData(ITmfEvent event) { super.handleData(event); @@ -55,15 +77,14 @@ public class HistogramRequest extends TmfEventRequest { } } + /** + * Complete the request. It also notifies the histogram model about the completion. + * + * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleCompleted() + */ @Override public void handleCompleted() { fHistogram.complete(); super.handleCompleted(); } - - @Override - public void handleCancel() { - super.handleCancel(); - } - } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramScaledData.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramScaledData.java index 648d7c8e38..3d7b36b922 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramScaledData.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramScaledData.java @@ -17,9 +17,10 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; import java.util.Arrays; /** - * HistogramScaledData - *

    * Convenience class/struct for scaled histogram data. + * + * @version 1.0 + * @author Francois Chouinard */ public class HistogramScaledData { @@ -27,28 +28,69 @@ public class HistogramScaledData { // Constants // ------------------------------------------------------------------------ + /** + * Indicator value that bucket is out of range (not filled). + */ public static final int OUT_OF_RANGE_BUCKET = -1; // ------------------------------------------------------------------------ // Attributes // ------------------------------------------------------------------------ - + /** + * Width of histogram canvas (number of pixels). + */ public int fWidth; + /** + * Height of histogram canvas (number of pixels). + */ public int fHeight; + /** + * Width of one histogram bar (number of pixels). + */ public int fBarWidth; + /** + * Array of scaled values + */ public int[] fData; + /** + * The bucket duration of a scaled data bucket. + */ public long fBucketDuration; + /** + * The maximum number of events of all buckets. + */ public long fMaxValue; + /** + * The index of the current bucket. + */ public int fCurrentBucket; + /** + * The index of the last bucket. + */ public int fLastBucket; + /** + * The scaling factor used to fill the scaled data. + */ public double fScalingFactor; + /** + * Time of first bucket. + */ public long fFirstBucketTime; + /** + * The time of the first event. + */ public long fFirstEventTime; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ + /** + * Constructor. + * @param width the canvas width + * @param height the canvas height + * @param barWidth the required bar width + */ public HistogramScaledData(int width, int height, int barWidth) { fWidth = width; fHeight = height; @@ -63,6 +105,10 @@ public class HistogramScaledData { fFirstBucketTime = 0; } + /** + * Copy constructor + * @param other another scaled data. + */ public HistogramScaledData(HistogramScaledData other) { fWidth = other.fWidth; fHeight = other.fHeight; @@ -80,24 +126,45 @@ public class HistogramScaledData { // Setter and Getter // ------------------------------------------------------------------------ + /** + * Returns the time of the first bucket of the scaled data. + * @return the time of the first bucket. + */ public long getFirstBucketTime() { return fFirstBucketTime; } + /** + * Set the first event time. + * @param firstEventTime + */ public void setFirstBucketTime(long firstEventTime) { fFirstBucketTime = firstEventTime; } + /** + * Returns the time of the last bucket. + * @return last bucket time + */ public long getLastBucketTime() { return getBucketStartTime(fLastBucket); } + /** + * Returns the time of the bucket start time for given index. + * @param index A bucket index. + * @return the time of the bucket start time + */ public long getBucketStartTime(int index) { return fFirstBucketTime + index * fBucketDuration; } + /** + * Returns the time of the bucket end time for given index. + * @param index A bucket index. + * @return the time of the bucket end time + */ public long getBucketEndTime(int index) { return getBucketStartTime(index) + fBucketDuration; } - } \ No newline at end of file diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTextControl.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTextControl.java index 104bd0074a..6fd482ff94 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTextControl.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTextControl.java @@ -29,9 +29,10 @@ import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Text; /** - * HistogramTextControl - *

    * This control provides a group containing a text control. + * + * @version 1.0 + * @author Francois Chouinard */ public abstract class HistogramTextControl implements FocusListener, KeyListener { @@ -39,11 +40,17 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener // Attributes // ------------------------------------------------------------------------ + /** + * The parent histogram view. + */ protected final HistogramView fParentView; private final Composite fParent; // Controls private final Group fGroup; + /** + * The text value field. + */ protected final Text fTextValue; private long fValue; @@ -51,10 +58,29 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener // Constructors // ------------------------------------------------------------------------ + /** + * Constructor default values + * + * @param parentView The parent histogram view. + * @param parent The parent composite + * @param textStyle The text style bits. + * @param groupStyle The group style bits. + * + */ public HistogramTextControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle) { this(parentView, parent, textStyle, groupStyle, "", HistogramUtils.nanosecondsToString(0L)); //$NON-NLS-1$ } + /** + * Constructor with given group and text values. + * + * @param parentView The parent histogram view. + * @param parent The parent composite + * @param textStyle The text style bits. + * @param groupStyle The group style bits. + * @param groupValue A group value + * @param textValue A text value + */ public HistogramTextControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle, String groupValue, String textValue) { fParentView = parentView; @@ -117,7 +143,10 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener // Accessors // ------------------------------------------------------------------------ - // State + /** + * Returns if widget isDisposed or not + * @return true if widget is disposed else false + */ public boolean isDisposed() { return fGroup.isDisposed(); } @@ -126,19 +155,32 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener // Operations // ------------------------------------------------------------------------ + /** + * Updates the text value. + */ protected abstract void updateValue(); - // LayoutData + /** + * Set the Grid Layout Data for the group. + * @param layoutData A GridData to set. + */ public void setLayoutData(GridData layoutData) { fGroup.setLayoutData(layoutData); } - // Time value + /** + * Sets the value converted to nano-seconds in the text field. + * @param timeString the time string (input) + */ public void setValue(String timeString) { long timeValue = HistogramUtils.stringToNanoseconds(timeString); setValue(timeValue); } + /** + * The time value in nano-seconds to set in the text field. + * @param time the time to set + */ public void setValue(final long time) { // If this is the UI thread, process now Display display = Display.getCurrent(); @@ -160,7 +202,11 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener }); } } - + + /** + * Returns the time value. + * @return time value. + */ public long getValue() { return fValue; } @@ -169,10 +215,18 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener // FocusListener // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent) + */ @Override public void focusGained(FocusEvent event) { } + /* + * (non-Javadoc) + * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent) + */ @Override public void focusLost(FocusEvent event) { updateValue(); @@ -182,6 +236,10 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener // KeyListener // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.swt.events.KeyListener#keyPressed(org.eclipse.swt.events.KeyEvent) + */ @Override public void keyPressed(KeyEvent event) { switch (event.keyCode) { @@ -193,6 +251,10 @@ public abstract class HistogramTextControl implements FocusListener, KeyListener } } + /* + * (non-Javadoc) + * @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent) + */ @Override public void keyReleased(KeyEvent e) { } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTimeRangeControl.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTimeRangeControl.java index 2d221921a7..2b436bbefd 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTimeRangeControl.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramTimeRangeControl.java @@ -16,20 +16,37 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; import org.eclipse.swt.widgets.Composite; /** - * HistogramTimeRangeControl - *

    * This control provides a group containing a text control. + * + * @version 1.0 + * @author Francois Chouinard */ public class HistogramTimeRangeControl extends HistogramTextControl { // ------------------------------------------------------------------------ // Construction // ------------------------------------------------------------------------ - + /** + * Constructor default values + * @param parentView The parent histogram view. + * @param parent The parent composite + * @param textStyle The text style bits. + * @param groupStyle The group style bits. + */ public HistogramTimeRangeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle) { this(parentView, parent, textStyle, groupStyle, "", HistogramUtils.nanosecondsToString(0L)); //$NON-NLS-1$ } + /** + * Constructor with given group and text values. + * + * @param parentView The parent histogram view. + * @param parent The parent composite + * @param textStyle The text style bits. + * @param groupStyle The group style bits. + * @param groupValue A group value + * @param textValue A text value + */ public HistogramTimeRangeControl(HistogramView parentView, Composite parent, int textStyle, int groupStyle, String groupValue, String textValue) { super(parentView, parent, textStyle, groupStyle, groupValue, textValue); } @@ -38,6 +55,10 @@ public class HistogramTimeRangeControl extends HistogramTextControl { // Operations // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.views.histogram.HistogramTextControl#updateValue() + */ @Override protected void updateValue() { String stringValue = fTextValue.getText(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramUtils.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramUtils.java index 552dab3f45..bf203842a5 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramUtils.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramUtils.java @@ -18,9 +18,10 @@ import org.eclipse.swt.graphics.GC; import org.eclipse.swt.widgets.Composite; /** - * HistogramUtils - *

    * Bunch of conversion utilities. + * + * @version 1.0 + * @author Francois Chouinard *

    */ public abstract class HistogramUtils { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java index 7221b2c31b..d5dcae7232 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java @@ -58,10 +58,14 @@ public class HistogramView extends TmfView { // Constants // ------------------------------------------------------------------------ - // The view ID as defined in plugin.xml + /** + * The view ID as defined in plugin.xml + */ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.histogram"; //$NON-NLS-1$ - // The initial window span (in nanoseconds) + /** + * The initial window span (in nanoseconds) + */ public static final long INITIAL_WINDOW_SPAN = (1L * 100 * 1000 * 1000); // .1sec // Time scale @@ -101,6 +105,9 @@ public class HistogramView extends TmfView { // Constructor // ------------------------------------------------------------------------ + /** + * Default constructor + */ public HistogramView() { super(ID); } @@ -258,6 +265,11 @@ public class HistogramView extends TmfView { // Accessors // ------------------------------------------------------------------------ + /** + * Returns the time range of the current selected window (base on default time scale). + * + * @return the time range of current selected window. + */ public TmfTimeRange getTimeRange() { return new TmfTimeRange(new TmfTimestamp(fWindowStartTime, TIME_SCALE), new TmfTimestamp(fWindowEndTime, TIME_SCALE)); @@ -267,6 +279,10 @@ public class HistogramView extends TmfView { // Operations // ------------------------------------------------------------------------ + /** + * Broadcast TmfSignal about new current time value. + * @param newTime the new current time. + */ public void updateCurrentEventTime(long newTime) { if (fCurrentExperiment != null) { TmfTimeRange timeRange = new TmfTimeRange(new TmfTimestamp(newTime, TIME_SCALE), TmfTimestamp.BIG_CRUNCH); @@ -283,6 +299,11 @@ public class HistogramView extends TmfView { } } + /** + * Broadcast TmfSignal about new selected time range. + * @param startTime the new start time + * @param endTime the new end time + */ public void updateTimeRange(long startTime, long endTime) { if (fCurrentExperiment != null) { // Build the new time range; keep the current time @@ -298,6 +319,10 @@ public class HistogramView extends TmfView { } } + /** + * Broadcast TmfSignal about new selected time range. + * @param newDuration new duration (relative to current start time) + */ public synchronized void updateTimeRange(long newDuration) { if (fCurrentExperiment != null) { long delta = newDuration - fWindowSpan; @@ -326,6 +351,11 @@ public class HistogramView extends TmfView { // Signal handlers // ------------------------------------------------------------------------ + /** + * Handles experiment selected signal. Loads histogram if new experiment time range is not + * equal TmfTimeRange.NULL_RANGE + * @param signal the experiment selected signal + */ @TmfSignalHandler @SuppressWarnings("unchecked") public void experimentSelected(TmfExperimentSelectedSignal signal) { @@ -339,6 +369,13 @@ public class HistogramView extends TmfView { fParent.redraw(); } + /** + * Handles experiment range updated signal. Extends histogram according to the new time range. If a + * HistogramRequest is already ongoing, it will be cancelled and a new request with the new range + * will be issued. + * + * @param signal the experiment range updated signal + */ @TmfSignalHandler public void experimentRangeUpdated(TmfExperimentRangeUpdatedSignal signal) { @@ -366,6 +403,10 @@ public class HistogramView extends TmfView { sendFullRangeRequest(fullRange); } + /** + * Handles the experiment updated signal. Used to update time limits (start and end time) + * @param signal the experiment updated signal + */ @TmfSignalHandler public void experimentUpdated(TmfExperimentUpdatedSignal signal) { if (signal.getExperiment() != fCurrentExperiment) { @@ -379,6 +420,12 @@ public class HistogramView extends TmfView { fTimeRangeHistogram.setFullRange(fExperimentStartTime, fExperimentEndTime); } + /** + * Handles the current time updated signal. Sets the current time in the time range + * histogram as well as the full histogram. + * + * @param signal the signal to process + */ @TmfSignalHandler public void currentTimeUpdated(TmfTimeSynchSignal signal) { // Because this can't happen :-) @@ -394,6 +441,10 @@ public class HistogramView extends TmfView { fCurrentEventTimeControl.setValue(fCurrentTimestamp); } + /** + * Updates the current time range in the time range histogram and full range histogram. + * @param signal the signal to process + */ @TmfSignalHandler public void timeRangeUpdated(TmfRangeSynchSignal signal) { // Because this can't happen :-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramZoom.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramZoom.java index 3b9b060557..b42c807ccb 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramZoom.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramZoom.java @@ -18,7 +18,10 @@ import org.eclipse.swt.events.MouseWheelListener; import org.eclipse.swt.widgets.Canvas; /** - * HistogramZoom + * Class to handle zooming within histogram windows.. + * + * @version 1.0 + * @author Francois Chouinard *

    */ public class HistogramZoom implements MouseWheelListener { @@ -66,14 +69,26 @@ public class HistogramZoom implements MouseWheelListener { // Accessors // ------------------------------------------------------------------------ + /** + * Get start time of the zoom window. + * @return the start time. + */ public synchronized long getStartTime() { return fRangeStartTime; } + /** + * Get the end time of the zoom window. + * @return the end time + */ public synchronized long getEndTime() { return fRangeStartTime + fRangeDuration; } + /** + * Get the duration of the zoom window. + * @return the duration of the zoom window. + */ public synchronized long getDuration() { return fRangeDuration; } @@ -82,6 +97,9 @@ public class HistogramZoom implements MouseWheelListener { // Operations // ------------------------------------------------------------------------ + /** + * Stops the zooming (multiple consecutive execution) + */ public synchronized void stop() { if (fScrollCounter != null) { fScrollCounter.interrupt(); @@ -89,11 +107,22 @@ public class HistogramZoom implements MouseWheelListener { } } + /** + * The the full time range of the histogram + * + * @param startTime the start time the histogram + * @param endTime the end time of the histogram + */ public synchronized void setFullRange(long startTime, long endTime) { fAbsoluteStartTime = startTime; fAbsoluteEndTime = endTime; } + /** + * Sets the new zoom window + * @param startTime the start time + * @param duration the duration + */ public synchronized void setNewRange(long startTime, long duration) { if (startTime < fAbsoluteStartTime) startTime = fAbsoluteStartTime; @@ -186,6 +215,10 @@ public class HistogramZoom implements MouseWheelListener { // Constructors // -------------------------------------------------------------------- + /** + * Constructor of inner class to handle consecutive scrolls of mouse wheel. + * @param zoom the histogram zoom reference + */ public MouseScrollCounter(HistogramZoom zoom) { fZoom = zoom; fLastPoolTime = System.currentTimeMillis(); @@ -194,7 +227,11 @@ public class HistogramZoom implements MouseWheelListener { // -------------------------------------------------------------------- // Operation // -------------------------------------------------------------------- - + + /** + * Increments the number of scroll clicks. + * @param nbScrolls the number to add to the current value + */ public void incrementMouseScroll(int nbScrolls) { fLastPoolTime = System.currentTimeMillis(); nbScrollClick += nbScrolls; diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramDataModel.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramDataModel.java index 3e793d5394..a0177e8439 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramDataModel.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramDataModel.java @@ -16,27 +16,27 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; import org.eclipse.linuxtools.tmf.ui.views.distribution.model.IBaseDistributionModel; /** - * IHistogramDataModel - *

    + * Histogram data model interface. + * + * @version 1.0 + * @author Bernd Hufmann */ - public interface IHistogramDataModel extends IBaseDistributionModel { /** * Add event to the correct bucket, compacting the if needed. * - * @param eventCount the event to count + * @param eventCount the event to count * @param timestamp the timestamp of the event to count */ public void countEvent(long eventCount, long timestamp); - /** * Scale the model data to the width, height and bar width requested. - * - * @param width - * @param height - * @param barWidth - * @return the result array of size [width] and where the highest value - * doesn't exceed [height] considering the bar width [barWidth] + * + * @param width A width of the histogram canvas + * @param height A height of the histogram canvas + * @param barWidth A width (in pixel) of a histogram bar + * @return the result array of size [width] and where the highest value doesn't exceed [height] + * while considering the bar width [barWidth] */ public HistogramScaledData scaleTo(int width, int height, int barWidth); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramModelListener.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramModelListener.java index 2dfd3f21d4..658b7bbb60 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramModelListener.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/IHistogramModelListener.java @@ -14,12 +14,14 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; /** - * IHistogramModelListener - *

    + * Listener interface for receiving histogram data model notifications. + * + * @version 1.0 + * @author Bernd Hufmann */ public interface IHistogramModelListener { /** - * Method to notify listeners about model updates + * Method to implement to receive notification about model updates. */ public void modelUpdated(); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Messages.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Messages.java index 0b067a6d0f..1a0b628333 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Messages.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Messages.java @@ -17,8 +17,10 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; import org.eclipse.osgi.util.NLS; /** - * Messages + * Messages file for the histogram widgets. *

    + * @version 1.0 + * @author Francois Chouinard */ public class Messages extends NLS { @@ -28,7 +30,13 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.views.histogram.messages"; //$NON-NLS-1$ + /** + * The label for the current event time + */ public static String HistogramView_currentEventLabel; + /** + * The label for the window span. + */ public static String HistogramView_windowSpanLabel; // ------------------------------------------------------------------------ diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java index bf8e2030fb..9d65dcf810 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/TimeRangeHistogram.java @@ -17,13 +17,15 @@ package org.eclipse.linuxtools.tmf.ui.views.histogram; import org.eclipse.swt.widgets.Composite; /** - * TimeRangeHistogram *

    * A basic histogram with the following additional features: *

      *
    • zoom in: mouse wheel up (or forward) *
    • zoom out: mouse wheel down (or backward) *
    + * + * @version 1.0 + * @author Francois Chouinard */ public class TimeRangeHistogram extends Histogram { @@ -31,12 +33,16 @@ public class TimeRangeHistogram extends Histogram { // Attributes // ------------------------------------------------------------------------ - HistogramZoom fZoom = null; + private HistogramZoom fZoom = null; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ - + /** + * Constructor + * @param view The parent histogram view + * @param parent The parent composite + */ public TimeRangeHistogram(HistogramView view, Composite parent) { super(view, parent); fZoom = new HistogramZoom(this, fCanvas, getStartTime(), getTimeLimit()); @@ -46,11 +52,19 @@ public class TimeRangeHistogram extends Histogram { // Operations // ------------------------------------------------------------------------ + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.views.histogram.Histogram#updateTimeRange(long, long) + */ @Override public void updateTimeRange(long startTime, long endTime) { ((HistogramView) fParentView).updateTimeRange(startTime, endTime); } + /* + * (non-Javadoc) + * @see org.eclipse.linuxtools.tmf.ui.views.histogram.Histogram#clear() + */ @Override public synchronized void clear() { if (fZoom != null) @@ -58,10 +72,20 @@ public class TimeRangeHistogram extends Histogram { super.clear(); } + /** + * Sets the time range of the histogram + * @param startTime The start time + * @param duration The duration of the time range + */ public synchronized void setTimeRange(long startTime, long duration) { fZoom.setNewRange(startTime, duration); } + /** + * Sets the full time range of the whole trace. + * @param startTime The start time + * @param endTime The end time + */ public void setFullRange(long startTime, long endTime) { long currentFirstEvent = getStartTime(); fZoom.setFullRange((currentFirstEvent == 0) ? startTime : currentFirstEvent, endTime); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/ITmfExtraEventInfo.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/ITmfExtraEventInfo.java index 68c30e0dc1..ed77056a42 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/ITmfExtraEventInfo.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/ITmfExtraEventInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -15,7 +15,14 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics; /** * This class provides an extension for updating data model and to pass along more information beside events + * + * @version 1.0 + * @author Mathieu Denis */ public interface ITmfExtraEventInfo { + /** + * Returns the trace name. + * @return the name of the trace. + */ public String getTraceName(); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java index 7708fd63bc..0f4995c31b 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -14,12 +14,34 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics; import org.eclipse.osgi.util.NLS; +/** + * Messages file for statistics view strings. + * + * @version 1.0 + * @author Mathieu Denis + * + */ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.views.statistics.messages"; //$NON-NLS-1$ + /** + * Level column name + */ public static String TmfStatisticsView_LevelColumn; + /** + * Level column tool tip. + */ public static String TmfStatisticsView_LevelColumnTip; + /** + * Number of events column name. + */ public static String TmfStatisticsView_NbEventsColumn; + /** + * Number of events column tool tip. + */ public static String TmfStatisticsView_NbEventsTip; + /** + * String for unknown trace name. + */ public static String TmfStatisticsView_UnknownTraceName; static { // initialize resource bundle diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java index 4d39a429fb..e127e6bd89 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * Copyright (c) 2011, 20112 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -7,8 +7,12 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Mathieu Denis (mathieu.denis@polymtl.ca) - Generalized version based on LTTng + * Mathieu Denis (mathieu.denis@polymtl.ca) - Generalized version based on LTTng * Bernd Hufmann - Updated to use trace reference in TmfEvent and streaming + * + * @version 1.0 + * @author Mathieu Denis + * *******************************************************************************/ package org.eclipse.linuxtools.tmf.ui.views.statistics; @@ -53,13 +57,13 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; /** - * TmfStatisticsView - *

    * The generic Statistics View displays statistics for any kind of traces. * * It is implemented according to the MVC pattern. - The model is a TmfStatisticsTreeNode built by the State Manager. - The view is built with a * TreeViewer. - The controller that keeps model and view synchronized is an observer of the model. *

    + * + * */ public class TmfStatisticsView extends TmfView { /** diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/AbsTmfStatisticsTree.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/AbsTmfStatisticsTree.java index 76f754f8de..75e5e3528d 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/AbsTmfStatisticsTree.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/AbsTmfStatisticsTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -7,7 +7,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Mathieu Denis (mathieu.denis@polymtl.ca) - Implementation and Initial API + * Mathieu Denis (mathieu.denis@polymtl.ca) - Implementation and Initial API + * *******************************************************************************/ package org.eclipse.linuxtools.tmf.ui.views.statistics.model; @@ -27,6 +28,9 @@ import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo; * It allow to implement a tree structure while avoiding the need to run through * the tree each time you need to add a node at a given place. *

    + * + * @version 1.0 + * @author Mathieu Denis */ public abstract class AbsTmfStatisticsTree { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfColumnDataProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfColumnDataProvider.java index abd9e79adc..8caa77e7af 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfColumnDataProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfColumnDataProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -15,10 +15,10 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics.model; import java.util.List; /** - * ITmfColumnDataProvider - *

    * Basic methods that must be implemented in a column data provider. *

    + * @version 1.0 + * @author Mathieu Denis */ public interface ITmfColumnDataProvider { /** diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfStatisticsColumnData.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfStatisticsColumnData.java index 22b3f0917c..59043d8d3d 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfStatisticsColumnData.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/ITmfStatisticsColumnData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -17,7 +17,10 @@ import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.linuxtools.tmf.ui.views.statistics.model.TmfBaseColumnData.ITmfColumnPercentageProvider; /** - * Provide the basic interface to create a statistics column + * Provide the basic interface to create a statistics column for the statistics table tree. + * + * @version 1.0 + * @author Mathieu Denis */ public interface ITmfStatisticsColumnData { diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/Messages.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/Messages.java index 43d1713b05..4f9df85f6c 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/Messages.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -14,10 +14,24 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics.model; import org.eclipse.osgi.util.NLS; +/** + * Message strings for the statistics framework. + * + * @version 1.0 + * @author Mathieu Denis + * + */ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.views.statistics.model.messages"; //$NON-NLS-1$ + /** + * CPU statistic name. + */ public static String TmfStatisticsData_CPUs; + /** + * Event type statistic name. + */ public static String TmfStatisticsData_EventTypes; + static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnData.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnData.java index c3efedfc4c..bb2f2dc293 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnData.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -18,32 +18,50 @@ import org.eclipse.jface.viewers.ViewerComparator; /** * Contains all the information necessary to build a column of the table. + * @version 1.0 + * @author Mathieu Denis */ public class TmfBaseColumnData implements ITmfStatisticsColumnData { - // Name of the column. + /** + * Name of the column. + */ protected final String fHeader; - // Width of the column. + /** + * Width of the column. + */ protected final int fWidth; - // Alignment of the column. + /** + * Alignment of the column. + */ protected final int fAlignment; - // Tooltip of the column. + /** + * Tooltip of the column. + */ protected final String fTooltip; - // Adapts a StatisticsTreeNode into the content of it's corresponding - // cell for that column. + /** + * Adapts a StatisticsTreeNode into the content of it's corresponding cell for that column. + */ protected final ColumnLabelProvider fLabelProvider; - // Used to sort elements of this column. Can be null. + /** + * Used to sort elements of this column. Can be null. + */ protected final ViewerComparator fComparator; - // Used to draw bar charts in this column. Can be null. + /** + * Used to draw bar charts in this column. Can be null. + */ protected final ITmfColumnPercentageProvider fPercentageProvider; - // Used to draw bar charts in columns. + /** + * Used to draw bar charts in columns. + */ public interface ITmfColumnPercentageProvider { public double getPercentage(TmfStatisticsTreeNode node); } /** * Constructor with parameters + * * @param h header of the column. The name will be shown at the top of the column. * @param w width of the column. * @param a alignment of the text diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnDataProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnDataProvider.java index 97869998cc..309cb167df 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnDataProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnDataProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * Copyright (c) 2011, 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 @@ -29,7 +29,10 @@ import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; /** - * Create a basic list of columns with providers + * Create a basic list of columns with providers. + * + * @version 1.0 + * @author Mathieu Denis */ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider { @@ -37,7 +40,6 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider { * Contains the list of the columns */ protected List fColumnData = null; - /** * Level column names */ @@ -46,7 +48,6 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider { * Number of events column names */ protected final static String EVENTS_COUNT_COLUMN = Messages.TmfStatisticsView_NbEventsColumn; - /** * Level column tooltips */ @@ -55,12 +56,10 @@ public class TmfBaseColumnDataProvider implements ITmfColumnDataProvider { * Number of events column tooltips */ protected final static String EVENTS_COUNT_COLUMN_TIP = Messages.TmfStatisticsView_NbEventsTip; - /** * Level for which statistics should not be displayed. */ protected Set fFolderLevels = new HashSet(Arrays.asList(new String[] { "Event Types" })); //$NON-NLS-1$ - /** * Create basic columns to represent the statistics data */ diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseStatisticsTree.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseStatisticsTree.java index 81c9d501af..fd0b20a948 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseStatisticsTree.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseStatisticsTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -23,8 +23,11 @@ import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray; import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo; /** - *

    Store information about base statistics data

    + * Store information about base statistics data. *

    This class provides a way to represent statistics data that is compatible to every kind of traces

    + * + * @version 1.0 + * @author Mathieu Denis */ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree { @@ -44,8 +47,15 @@ public class TmfBaseStatisticsTree extends AbsTmfStatisticsTree { *

    */ protected static final String NODE = "z"; //$NON-NLS-1$ + /** + * Root node key. + */ protected static final String ROOT_NODE_KEY = mergeString(ROOT.get(0), NODE); + /** + * Default constructor. Creates base statistics tree for counting total + * number of events and number of events per event type. + */ public TmfBaseStatisticsTree() { super(); Map> keys = getKeys(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatistics.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatistics.java index 8d6ec5c10b..6bac33eaec 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatistics.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatistics.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -15,6 +15,9 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics.model; /** *

    Primitive container for Statistics data

    *

    Contains information about statistics that can be retrieved with any kind of traces

    + * + * @version 1.0 + * @author Mathieu Denis */ public class TmfStatistics { /** diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeNode.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeNode.java index cb7408336d..b81ee4d527 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeNode.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeNode.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -22,6 +22,9 @@ import org.eclipse.linuxtools.tmf.core.util.TmfFixedArray; *

    A tree where nodes can be accessed efficiently using paths.

    * *

    It works like file systems. Each node is identified by a key. A path is an array ({@link TmfFixedArray}) of String. The elements of the array represent the path from the root to this node.

    + * + * @version 1.0 + * @author Mathieu Denis */ public class TmfStatisticsTreeNode { /** diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeRootFactory.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeRootFactory.java index 24bdc65be9..02d8d74551 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeRootFactory.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeRootFactory.java @@ -15,6 +15,17 @@ package org.eclipse.linuxtools.tmf.ui.views.statistics.model; import java.util.HashMap; import java.util.Map; +/** + * Factory class to create and store TMF statistic trees. + * + * Based on a given tree node ID a TMF statistic tree is stored internally. + * A root node is created for each tree. Using the tree node ID the statistics + * tree can be retrieved. + * + * @version 1.0 + * @author Mathieu Denis + * + */ public class TmfStatisticsTreeRootFactory { // ----------------------------------------------------------------------- diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfTreeContentProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfTreeContentProvider.java index 39d36d0591..7174b3c914 100755 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfTreeContentProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfTreeContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Ericsson + * 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 @@ -18,6 +18,8 @@ import org.eclipse.jface.viewers.Viewer; /** * Adapter TreeViewers can use to interact with StatisticsTreeNode objects. * + * @version 1.0 + * @author Mathieu Denis * @see org.eclipse.jface.viewers.ITreeContentProvider */ public class TmfTreeContentProvider implements ITreeContentProvider {