Package org.sonar.api.web

Examples of org.sonar.api.web.Dashboard$Widget


    this.filterDao = filterDao;
  }

  @Override
  public Dashboard createDashboard() {
    Dashboard dashboard = Dashboard.create()
      .setGlobal(true)
      .setLayout(DashboardLayout.TWO_COLUMNS);

    dashboard.addWidget(WelcomeWidget.ID, 1);
    addMyFavouritesWidget(dashboard);
    addProjectsWidgets(dashboard);

    return dashboard;
  }
View Full Code Here


    return "Dashboard";
  }

  @Override
  public Dashboard createDashboard() {
    Dashboard dashboard = Dashboard.create();
    dashboard.setLayout(DashboardLayout.TWO_COLUMNS);
    addFirstColumn(dashboard);
    addSecondColumn(dashboard);
    return dashboard;
  }
View Full Code Here

    return "TimeMachine";
  }

  @Override
  public Dashboard createDashboard() {
    Dashboard dashboard = Dashboard.create();
    dashboard.setLayout(DashboardLayout.TWO_COLUMNS);
    addFirstColumn(dashboard);
    addSecondColumn(dashboard);
    return dashboard;
  }
View Full Code Here

    return "Issues";
  }

  @Override
  public Dashboard createDashboard() {
    Dashboard dashboard = Dashboard.create();
    dashboard.setLayout(DashboardLayout.TWO_COLUMNS);
    addFirstColumn(dashboard);
    addSecondColumn(dashboard);
    return dashboard;
  }
View Full Code Here

      new MeasureFilterDto().setId(100L)
    );
    when(dao.findSystemFilterByName(ProjectFilter.NAME)).thenReturn(
      new MeasureFilterDto().setId(101L)
    );
    Dashboard dashboard = template.createDashboard();
    List<Widget> firstColumn = dashboard.getWidgetsOfColumn(1);
    assertThat(firstColumn).hasSize(2);
    assertThat(firstColumn.get(0).getId()).isEqualTo(WelcomeWidget.ID);
    assertThat(firstColumn.get(1).getId()).isEqualTo(MeasureFilterListWidget.ID);
    assertThat(firstColumn.get(1).getProperty("filter")).isEqualTo("100");

    List<Widget> secondColumn = dashboard.getWidgetsOfColumn(2);
    assertThat(secondColumn).hasSize(2);
    assertThat(secondColumn.get(0).getId()).isEqualTo(MeasureFilterListWidget.ID);
    assertThat(secondColumn.get(0).getProperty("filter")).isEqualTo("101");
    assertThat(secondColumn.get(1).getId()).isEqualTo(MeasureFilterAsTreemapWidget.ID);
    assertThat(secondColumn.get(1).getProperty("filter")).isEqualTo("101");
View Full Code Here

  @Test
  public void should_not_fail_if_filter_widgets_not_found() {
    when(dao.findSystemFilterByName(MyFavouritesFilter.NAME)).thenReturn(null);
    when(dao.findSystemFilterByName(ProjectFilter.NAME)).thenReturn(null);

    Dashboard dashboard = template.createDashboard();
    List<Widget> firstColumn = dashboard.getWidgetsOfColumn(1);
    assertThat(firstColumn).hasSize(1);
    assertThat(firstColumn.get(0).getId()).isEqualTo(WelcomeWidget.ID);

    List<Widget> secondColumn = dashboard.getWidgetsOfColumn(2);
    assertThat(secondColumn).isEmpty();
  }
View Full Code Here

    assertThat(new CorePlugin().getExtensions()).contains(template.getClass());
  }

  @Test
  public void should_create_dashboard() {
    Dashboard dashboard = template.createDashboard();

    assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS);
    assertThat(dashboard.getWidgets()).hasSize(5);
  }
View Full Code Here

    assertThat(new CorePlugin().getExtensions()).contains(template.getClass());
  }

  @Test
  public void should_create_dashboard() {
    Dashboard dashboard = template.createDashboard();

    assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS);
    assertThat(dashboard.getWidgets()).hasSize(7);

    for (Widget widget : dashboard.getWidgets()) {
      if (widget.getId().equals("time_machine")) {
        assertThat(widget.getProperty("displaySparkLine")).isEqualTo("true");
      }
    }
  }
View Full Code Here

    assertThat(new CorePlugin().getExtensions()).contains(template.getClass());
  }

  @Test
  public void should_create_dashboard() {
    Dashboard dashboard = template.createDashboard();

    assertThat(dashboard.getLayout()).isEqualTo(DashboardLayout.TWO_COLUMNS);
    assertThat(dashboard.getWidgets()).hasSize(10);
  }
View Full Code Here

    TimeProfiler profiler = new TimeProfiler(LOG).start("Register dashboards");

    List<DashboardDto> registeredDashboards = Lists.newArrayList();
    for (DashboardTemplate template : dashboardTemplates) {
      if (shouldRegister(template.getName())) {
        Dashboard dashboard = template.createDashboard();
        DashboardDto dto = register(template.getName(), dashboard);
        if ((dto != null) && (dashboard.isActivated())) {
          registeredDashboards.add(dto);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.sonar.api.web.Dashboard$Widget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.