protected abstract String getFilterKey();
@Override
- public Dashboard createDashboard() {
+ public final Dashboard createDashboard() {
Dashboard dashboard = Dashboard.create()
.setGlobal(true)
.setLayout(DashboardLayout.ONE_COLUMN);
.addWidget("filter", 1)
.setProperty(FilterWidget.FILTER, getFilterKey());
+ doCompleteDashboard(dashboard);
return dashboard;
}
+
+ /**
+ * Override this method to complete dashboard
+ */
+ protected void doCompleteDashboard(Dashboard dashboard) {
+ }
}
@Override
protected String getFilterKey() {
- return new MyFavouritesFilter().getName();
+ return MyFavouritesFilter.NAME;
}
@Override
- public Dashboard createDashboard() {
- return super.createDashboard().setActivated(false);
+ protected void doCompleteDashboard(Dashboard dashboard) {
+ dashboard.setActivated(false);
}
}
\ No newline at end of file
* @since 3.1
*/
public class MyFavouritesFilter extends FilterTemplate {
+ public static final String NAME = "My favourites";
+
@Override
public String getName() {
- return "My favourites";
+ return NAME;
}
@Override
Filter filter = Filter.create();
filter.setDisplayAs(Filter.LIST);
filter.setFavouritesOnly(true);
- filter.add(Criterion.createForQualifier("VW", "SVW", "TRK", "BRC", "DIR", "PAC", "FIL", "CLA", "UTS", "LIB"));
+ filter.add(Criterion.createForQualifier("VW", "SVW", "TRK", "BRC", "DIR", "PAC", "FIL", "CLA", "UTS"));
filter.add(FilterColumn.create("metric", CoreMetrics.ALERT_STATUS_KEY, FilterColumn.DESC, false));
filter.add(FilterColumn.create("name", null, FilterColumn.ASC, false));
filter.add(FilterColumn.create("metric", CoreMetrics.NCLOC_KEY, FilterColumn.DESC, false));