Skip to content

Commit 1f06187

Browse files
Bananeweizenlkoe
authored andcommitted
Multiple fixes of violations views
* fix typos, improve wording * remove useless action icon (it was the one that is generated by the PDE wizard) * pie chart tooltip displayed the percentage as wrong absolute number * disabling a filter did not refresh the pie chart
1 parent cf14d2c commit 1f06187

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/stats/messages.properties

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ CheckstyleMarkerFilterDialog_msgInvalidRegex = Invalid regular expression: {0}
4545

4646
CheckstyleMarkerFilterDialog_msgNoRegexDefined = <no regular expressions defined>
4747

48-
CheckstyleMarkerFilterDialog_msgNoWorkingSetSelected = <no woking set selected>
48+
CheckstyleMarkerFilterDialog_msgNoWorkingSetSelected = <no working set selected>
4949

5050
CheckstyleMarkerFilterDialog_title = Checkstyle markers filter
5151

52-
CheckstyleMarkerFilterDialog_titleMessage = Use this filter settings to specify on which resources/severities\nthe the markers will be shown.
52+
CheckstyleMarkerFilterDialog_titleMessage = Use these filter settings to specify on which resources/severities\nthe markers will be shown.
5353

5454
CheckstyleMarkerFilterDialog_titleRegexEditor = Edit regular expression filter
5555

@@ -69,13 +69,13 @@ GraphStatsView_displayAllCategories = Display categories < 1%
6969

7070
GraphStatsView_displayJavadocErrors = Display Javadoc violations
7171

72-
GraphStatsView_displayListing = Show the violation listing
72+
GraphStatsView_displayListing = Show the violations listing
7373

7474
GraphStatsView_errorsRepartition = Checkstyle error repartition
7575

7676
GraphStatsView_javadocNotDisplayed = (Javadoc not displayed)
7777

78-
GraphStatsView_lblViewMessage = Graph of Checkstyle violations - {0} markers in {1} categories (Filter matched {0} of {2} items)
78+
GraphStatsView_lblViewMessage = Graph of Checkstyle violations - {0} markers in {1} categories (filter matched {0} of {2} items)
7979

8080
GraphStatsView_noDataToDisplay = No Checkstyle violations matched the filter settings.
8181

@@ -113,29 +113,29 @@ MarkerStatsView_kindOfErrorColumn = Checkstyle violation type
113113

114114
MarkerStatsView_lblDetailMessage = Details of Checkstyle violation "{0}" - {1} occurrences
115115

116-
MarkerStatsView_lblOverviewMessage = Overview of Checkstyle violations - {0} markers in {1} categories (Filter matched {0} of {2} items)
116+
MarkerStatsView_lblOverviewMessage = Overview of Checkstyle violations - {0} markers in {1} categories (filter matched {0} of {2} items)
117117

118118
MarkerStatsView_lineColumn = Line
119119

120120
MarkerStatsView_messageColumn = Message
121121

122-
MarkerStatsView_numberOfErrorsColumn = Marker count
122+
MarkerStatsView_numberOfErrorsColumn = Occurrences
123123

124124
MarkerStatsView_reportGenerationFailed = Report generation has failed.
125125

126126
MarkerStatsView_showDetails = Show details
127127

128128
MarkerStatsView_showDetailsTooltip = Lists all the violations for this type.
129129

130-
MarkerStatsView_unableToOpenGraph = An error occured while opening the graph view "{0}".
130+
MarkerStatsView_unableToOpenGraph = An error occurred while opening the graph view "{0}".
131131

132132
MarkerStatsView_unableToShowMarker = Error while displaying the marker.
133133

134134
MarkerStatsView_unknownProblem = Unknown
135135

136-
PreferencePage_displayAllCategories = By default, display all types of violation in the pie chart (do not gather percentages under 1%).
136+
PreferencePage_displayAllCategories = By default, display all types of violations in the pie chart (do not gather percentages under 1%).
137137

138-
PreferencePage_displayJavadocErrors = By default, display Javadoc violations in the Checkstyle stats pie chart.
138+
PreferencePage_displayJavadocErrors = By default, display Javadoc violations in the Checkstyle statistics pie chart.
139139

140140
StatsViewUtils_checkstyleErrorsCount = {0} Checkstyle violations
141141

net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/stats/views/GraphStatsView.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.awt.Color;
2424
import java.awt.Font;
2525
import java.awt.event.MouseEvent;
26+
import java.text.AttributedString;
2627
import java.util.ArrayList;
2728
import java.util.Collection;
2829
import java.util.Iterator;
@@ -81,7 +82,11 @@
8182
import org.jfree.chart.ChartMouseListener;
8283
import org.jfree.chart.JFreeChart;
8384
import org.jfree.chart.entity.PieSectionEntity;
85+
import org.jfree.chart.labels.PieSectionLabelGenerator;
86+
import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
87+
import org.jfree.chart.labels.StandardPieToolTipGenerator;
8488
import org.jfree.chart.plot.PiePlot;
89+
import org.jfree.data.general.PieDataset;
8590
import org.jfree.experimental.chart.swt.ChartComposite;
8691
import org.jfree.ui.RectangleInsets;
8792
import org.jfree.util.Rotation;
@@ -381,8 +386,6 @@ public void run() {
381386
}
382387
};
383388
mShowAllCategoriesAction.setToolTipText(Messages.GraphStatsView_displayAllCategories);
384-
mShowAllCategoriesAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
385-
.getImageDescriptor(ISharedImages.IMG_OBJ_ELEMENT));
386389
mShowAllCategoriesAction.setChecked(CheckstyleUIPluginPrefs
387390
.getBoolean(CheckstyleUIPluginPrefs.PREF_STATS_SHOW_ALL_CATEGORIES));
388391

@@ -564,7 +567,8 @@ private JFreeChart createChart(GraphPieDataset piedataset) {
564567
pieplot3d.setLabelShadowPaint(null);
565568
pieplot3d.setLabelBackgroundPaint(Color.WHITE);
566569
pieplot3d.setBackgroundPaint(Color.WHITE);
567-
570+
// avoid showing the percentage as an absolute number in the tooltip
571+
pieplot3d.setToolTipGenerator(new StandardPieToolTipGenerator("{0}: {2}"));
568572
pieplot3d.setInteriorGap(0.02);
569573
pieplot3d.setMaximumLabelWidth(0.20);
570574

net.sf.eclipsecs.ui/src/net/sf/eclipsecs/ui/stats/views/internal/CheckstyleMarkerFilter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ private List<IMarker> findCheckstyleMarkers(IResource[] resources, int depth, IP
484484
resultList.addAll(markers);
485485
}
486486
}
487+
488+
if (!mEnabled) {
489+
return resultList;
490+
}
487491

488492
if (mSelectBySeverity) {
489493
// further filter the markers by severity

0 commit comments

Comments
 (0)