Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Sebastian2009-01-22 21:06:48 +0000
committerKent Sebastian2009-01-22 21:06:48 +0000
commit1b52121f1aad703cb7ccfd78b750c4ba51f26134 (patch)
tree1481db6a3e525e825af71c28aedc9dbd8cb0d33b /oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse
parent572484fc2ac94fbc2293cf2a30e37146d469ff34 (diff)
downloadorg.eclipse.linuxtools-1b52121f1aad703cb7ccfd78b750c4ba51f26134.tar.gz
org.eclipse.linuxtools-1b52121f1aad703cb7ccfd78b750c4ba51f26134.tar.xz
org.eclipse.linuxtools-1b52121f1aad703cb7ccfd78b750c4ba51f26134.zip
added a check and test if oprofile was run outside of eclipse and the samples are read by opxml -- discard and display an error
Diffstat (limited to 'oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse')
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java30
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/oprofileui.properties4
2 files changed, 20 insertions, 14 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java
index bce8b78d6b..f43cabe62a 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java
@@ -56,21 +56,25 @@ public class UiModelImage implements IUiModelElement {
@Override
public String toString() {
- NumberFormat nf = NumberFormat.getPercentInstance();
- if (nf instanceof DecimalFormat) {
- nf.setMinimumFractionDigits(2);
- nf.setMaximumFractionDigits(2);
- }
- double countPercentage = (double)(_image.getCount() - _depCount) / (double)_totalCount;
-
- String percentage;
- if (countPercentage < OprofileUiPlugin.MINIMUM_SAMPLE_PERCENTAGE) {
- percentage = "<" + nf.format(OprofileUiPlugin.MINIMUM_SAMPLE_PERCENTAGE); //$NON-NLS-1$
+ if (_image.getCount() == OpModelImage.IMAGE_PARSE_ERROR) {
+ return OprofileUiMessages.getString("opxmlParse.error.multipleImages"); //$NON-NLS-1$
} else {
- percentage = nf.format(countPercentage);
+ NumberFormat nf = NumberFormat.getPercentInstance();
+ if (nf instanceof DecimalFormat) {
+ nf.setMinimumFractionDigits(2);
+ nf.setMaximumFractionDigits(2);
+ }
+ double countPercentage = (double)(_image.getCount() - _depCount) / (double)_totalCount;
+
+ String percentage;
+ if (countPercentage < OprofileUiPlugin.MINIMUM_SAMPLE_PERCENTAGE) {
+ percentage = "<" + nf.format(OprofileUiPlugin.MINIMUM_SAMPLE_PERCENTAGE); //$NON-NLS-1$
+ } else {
+ percentage = nf.format(countPercentage);
+ }
+
+ return percentage + " " + OprofileUiMessages.getString("uimodel.percentage.in") + _image.getName(); //$NON-NLS-1$ //$NON-NLS-2$
}
-
- return percentage + " " + OprofileUiMessages.getString("uimodel.percentage.in") + _image.getName(); //$NON-NLS-1$ //$NON-NLS-2$
}
/** IUiModelElement functions **/
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/oprofileui.properties b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/oprofileui.properties
index aead64da58..85890e938f 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/oprofileui.properties
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/oprofileui.properties
@@ -26,4 +26,6 @@ oprofiled.logreader.error.io=Error reading log file.
uimodel.percentage.in=in
uimodel.sample.on.line=on line
-uimodel.dependent.dependent.images=dependent images \ No newline at end of file
+uimodel.dependent.dependent.images=dependent images
+
+opxmlParse.error.multipleImages=Error: samples not created from Eclipse-OProfile plugin. Please remove this session. \ No newline at end of file

Back to the top