Search in sources :

Example 1 with DashboardView

use of org.netxms.ui.android.main.views.DashboardView in project netxms by netxms.

the class EmbeddedDashboardElement method refresh.

/* (non-Javadoc)
	 * @see org.netxms.ui.android.main.dashboards.elements.AbstractDashboardElement#refresh()
	 */
@Override
public void refresh() {
    final Dashboard dashboard = (Dashboard) service.getSession().findObjectById(config.getDashboardObjects()[current], Dashboard.class);
    current++;
    if (current >= config.getDashboardObjects().length)
        current = 0;
    post(new Runnable() {

        @Override
        public void run() {
            removeAllViews();
            if (dashboard != null) {
                DashboardView view = new DashboardView(getContext(), dashboard, service, scheduleTaskExecutor);
                addView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.FILL));
            }
        }
    });
}
Also used : Dashboard(org.netxms.client.objects.Dashboard) DashboardView(org.netxms.ui.android.main.views.DashboardView)

Aggregations

Dashboard (org.netxms.client.objects.Dashboard)1 DashboardView (org.netxms.ui.android.main.views.DashboardView)1