aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Stoffalette Joao2013-04-26 10:54:10 (EDT)
committerJeff Johnston2013-05-02 15:40:09 (EDT)
commita51b10e651b121b231794d5b46bc36b7c2425728 (patch)
tree08d33e3e917681cb971b314815db44e14a443504
parenta98940c68795a20b8d43ed8dfd86bc18a613cda6 (diff)
downloadorg.eclipse.linuxtools-a51b10e651b121b231794d5b46bc36b7c2425728.zip
org.eclipse.linuxtools-a51b10e651b121b231794d5b46bc36b7c2425728.tar.gz
org.eclipse.linuxtools-a51b10e651b121b231794d5b46bc36b7c2425728.tar.bz2
Some work to add javadoc to Oprofile Ui modelrefs/changes/33/12333/7
Change-Id: Ib551625b7dcb08bdd72f98b32619a321142b7a37 Reviewed-on: https://git.eclipse.org/r/12333 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> IP-Clean: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelDependent.java25
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelError.java24
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelEvent.java16
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelImage.java28
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelRoot.java13
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSample.java4
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSession.java30
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSymbol.java43
8 files changed, 174 insertions, 9 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelDependent.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelDependent.java
index 71d75ae..4a86a1a 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelDependent.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelDependent.java
@@ -21,7 +21,14 @@ public class UiModelDependent implements IUiModelElement {
private UiModelImage dependents[];
private int totalCount;
private int depCount;
-
+
+ /**
+ * Constructor to this UiModelDependent class
+ * @param parent The parent element
+ * @param dependents The dependent images
+ * @param totalCount The total count of samples for the parent session
+ * @param depCount The count for all dependent images
+ */
public UiModelDependent(IUiModelElement parent, OpModelImage dependents[], int totalCount, int depCount) {
this.parent = parent;
this.dataModelDependents = dependents;
@@ -52,18 +59,34 @@ public class UiModelDependent implements IUiModelElement {
return toString();
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements or null
+ */
public IUiModelElement[] getChildren() {
return dependents;
}
+ /**
+ * Returns if the element has any children.
+ * @return true if the element has children, false otherwise
+ */
public boolean hasChildren() {
return true; //must have children, or this object wouldn't be created
}
+ /**
+ * Returns the parent element.
+ * @return the parent element or null
+ */
public IUiModelElement getParent() {
return parent;
}
+ /**
+ * Returns the Image to display next to the text in the tree viewer.
+ * @return an Image object of the icon
+ */
public Image getLabelImage() {
return OprofileUiPlugin.getImageDescriptor(OprofileUiPlugin.DEPENDENT_ICON).createImage();
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelError.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelError.java
index 5e23114..d2b7d06 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelError.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelError.java
@@ -14,11 +14,18 @@ import org.eclipse.linuxtools.internal.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.internal.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;
+/**
+ * This is an error element
+ */
public class UiModelError implements IUiModelElement {
public static final UiModelError NO_SAMPLES_ERROR = new UiModelError(OprofileUiMessages.getString("root.error.nosamples")); //$NON-NLS-1$
private String errorMessage;
+ /**
+ * Constructor to the UiModelError class
+ * @param message Error message
+ */
public UiModelError(String message) {
errorMessage = message;
}
@@ -28,18 +35,35 @@ public class UiModelError implements IUiModelElement {
return errorMessage;
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements or null
+ */
public IUiModelElement[] getChildren() {
return null;
}
+ /**
+ * Return whether the element has any children
+ * @return true if the element has any children, false otherwise
+ */
public boolean hasChildren() {
return false;
}
+ /**
+ * Returns the element's parent.
+ * @return The parent element or null
+ */
public IUiModelElement getParent() {
return null;
}
+ /**
+ * Returns the Image to display next to the text in the tree viewer.
+ * In this case it is an error icon.
+ * @return an Image object of the icon
+ */
public Image getLabelImage() {
return OprofileUiPlugin.getImageDescriptor(OprofileUiPlugin.ERROR_ICON).createImage();
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelEvent.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelEvent.java
index b5297e7..1c73980 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelEvent.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelEvent.java
@@ -53,18 +53,34 @@ public class UiModelEvent implements IUiModelElement {
return toString();
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements or null
+ */
public IUiModelElement[] getChildren() {
return sessions;
}
+ /**
+ * Returns if the element has any children.
+ * @return true if the element has children, false otherwise
+ */
public boolean hasChildren() {
return (sessions == null || sessions.length == 0 ? false : true);
}
+ /**
+ * Returns the element's parent.
+ * @return parent The parent element or null
+ */
public IUiModelElement getParent() {
return parent;
}
+ /**
+ * Returns the Image to display next to the text in the tree viewer.
+ * @return an Image object of the icon
+ */
public Image getLabelImage() {
return OprofileUiPlugin.getImageDescriptor(OprofileUiPlugin.EVENT_ICON).createImage();
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelImage.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelImage.java
index 196219d..4eb0f26 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelImage.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelImage.java
@@ -29,6 +29,13 @@ public class UiModelImage implements IUiModelElement {
private int totalCount; //total number of samples
private int depCount; //number of samples from dependent images
+ /**
+ * Constructor to the UiModelImage class
+ * @param parent The parent element
+ * @param image The image node object in the data model
+ * @param totalCount The total number of samples
+ * @param depCount The number of samples from dependent images
+ */
public UiModelImage(IUiModelElement parent, OpModelImage image, int totalCount, int depCount) {
this.parent = parent;
this.image = image;
@@ -37,7 +44,9 @@ public class UiModelImage implements IUiModelElement {
this.depCount = depCount;
refreshModel();
}
-
+ /**
+ * Create the ui symbols from the data model.
+ */
private void refreshModel() {
OpModelSymbol[] dataModelSymbols = image.getSymbols();
@@ -68,6 +77,10 @@ public class UiModelImage implements IUiModelElement {
return toString();
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements or null
+ */
public IUiModelElement[] getChildren() {
IUiModelElement children[] = null;
@@ -81,15 +94,26 @@ public class UiModelImage implements IUiModelElement {
return children;
}
-
+ /**
+ * Returns if the element has any children.
+ * @return true if the element has children, false otherwise
+ */
public boolean hasChildren() {
return (symbols == null || symbols.length == 0 ? false : true);
}
+ /**
+ * Returns the element's parent.
+ * @return parent The parent element or null
+ */
public IUiModelElement getParent() {
return parent;
}
+ /**
+ * Returns the Image to display next to the text in the tree viewer.
+ * @return an Image object of the icon
+ */
public Image getLabelImage() {
return OprofileUiPlugin.getImageDescriptor(OprofileUiPlugin.IMAGE_ICON).createImage();
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelRoot.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelRoot.java
index 82f68d9..e41a2c7 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelRoot.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelRoot.java
@@ -68,17 +68,28 @@ public class UiModelRoot implements IUiModelElement {
return null;
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements or null
+ */
public IUiModelElement[] getChildren() {
if (events != null)
return events;
else
return new IUiModelElement[] { rootError };
}
-
+ /**
+ * Returns if the element has any children.
+ * @return true if the element has children, false otherwise
+ */
public boolean hasChildren() {
return true;
}
+ /**
+ * Returns the element's parent.
+ * @return The parent element or null
+ */
public IUiModelElement getParent() {
return null;
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSample.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSample.java
index d4b4fcf..65782bb 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSample.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSample.java
@@ -70,8 +70,8 @@ public class UiModelSample implements IUiModelElement {
}
/**
- * Returns this element children
- * @return An array of IUiModelElements
+ * Returns the children of this element.
+ * @return An array of child elements or null
*/
public IUiModelElement[] getChildren() {
return null;
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSession.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSession.java
index 97a6141..0c59907 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSession.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSession.java
@@ -31,6 +31,11 @@ public class UiModelSession implements IUiModelElement {
//OProfile's default session name
private static final String DEFAULT_SESSION_NAME = "current"; //$NON-NLS-1$
+ /**
+ * Constructor to the UiModelSession class
+ * @param parent The parent element
+ * @param session Oprofile session node in the data model
+ */
public UiModelSession(IUiModelElement parent, OpModelSession session) {
this.parent = parent;
this.session = session;
@@ -55,11 +60,18 @@ public class UiModelSession implements IUiModelElement {
return session.getName();
}
+ /**
+ * Check if this is Oprofile's default session name
+ * @return true whether this is Oprofile's default session, false otherwise
+ */
public boolean isDefaultSession() {
return session.getName().equalsIgnoreCase(DEFAULT_SESSION_NAME);
}
- /** IUiModelElement functions **/
+ /** IUiModelElement functions
+ * Returns the text to display in the tree viewer as required by the label provider.
+ * @return text Text string describing this element
+ */
public String getLabelText() {
if (session.getName().equals(DEFAULT_SESSION_NAME)){
return OprofileUiMessages.getString("UiModelSession_current"); //$NON-NLS-1$
@@ -67,6 +79,10 @@ public class UiModelSession implements IUiModelElement {
return toString();
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements
+ */
public IUiModelElement[] getChildren() {
if (dependent != null) {
return new IUiModelElement[] {image, dependent};
@@ -75,14 +91,26 @@ public class UiModelSession implements IUiModelElement {
}
}
+ /**
+ * Returns if the element has any children.
+ * @return true if the element has children, false otherwise
+ */
public boolean hasChildren() {
return (image != null);
}
+ /**
+ * Returns the element's parent.
+ * @return parent The parent element
+ */
public IUiModelElement getParent() {
return parent;
}
+ /**
+ * Returns the Image to display next to the text in the tree viewer.
+ * @return an Image object of the icon
+ */
public Image getLabelImage() {
return OprofileUiPlugin.getImageDescriptor(OprofileUiPlugin.SESSION_ICON).createImage();
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSymbol.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSymbol.java
index fba8d08..5ab588b 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSymbol.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/internal/oprofile/ui/model/UiModelSymbol.java
@@ -29,6 +29,12 @@ public class UiModelSymbol implements IUiModelElement {
private UiModelSample samples[]; //this node's children
private int totalCount; //total count of samples for the parent session
+ /**
+ * Constructor to the UiModelSymbol class
+ * @param parent The parent element
+ * @param symbol The debugging symbol node object in the data model
+ * @param totalCount The total count of samples for the parent session
+ */
public UiModelSymbol(IUiModelElement parent, OpModelSymbol symbol, int totalCount) {
this.parent = parent;
this.symbol = symbol;
@@ -37,6 +43,9 @@ public class UiModelSymbol implements IUiModelElement {
refreshModel();
}
+ /**
+ * Creates the ui samples from the data model
+ */
private void refreshModel() {
ArrayList<UiModelSample> sampleList = new ArrayList<UiModelSample>();
OpModelSample dataModelSamples []= symbol.getSamples();
@@ -63,36 +72,66 @@ public class UiModelSymbol implements IUiModelElement {
return percentage + " " + OprofileUiMessages.getString("uimodel.percentage.in") + symbol.getName() + (fileName.length() == 0 ? "" : " [" + fileName + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
-
+ /**
+ * Return the file path for the current debugging symbol
+ * @return the file path
+ */
public String getFileName() {
return symbol.getFilePath();
}
+ /**
+ * Return the debugging symbol function name
+ * @return the function name
+ */
public String getFunctionName(){
return symbol.getName();
}
+ /**
+ * Return the debugging symbol line number
+ * @return the line number
+ */
public int getLineNumber(){
return symbol.getLine();
}
- /** IUiModelElement functions **/
+ /** IUiModelElement functions
+ * Returns the text to display in the tree viewer as required by the label provider.
+ * @return text describing this element
+ */
public String getLabelText() {
return toString();
}
+ /**
+ * Returns the children of this element.
+ * @return An array of child elements or null
+ */
public IUiModelElement[] getChildren() {
return samples;
}
+ /**
+ * Returns if the element has any children.
+ * @return true if the element has children, false otherwise
+ */
public boolean hasChildren() {
return (samples == null || samples.length == 0 ? false : true);
}
+ /**
+ * Returns the element's parent.
+ * @return parent The parent element
+ */
public IUiModelElement getParent() {
return parent;
}
+ /**
+ * Returns the Image to display next to the text in the tree viewer.
+ * @return an Image object of the icon
+ */
public Image getLabelImage() {
return OprofileUiPlugin.getImageDescriptor(OprofileUiPlugin.SYMBOL_ICON).createImage();
}