use of org.netxms.ui.eclipse.dashboard.widgets.DashboardControl in project netxms by netxms.
the class DashboardView method rebuildDashboard.
/**
* Rebuild current dashboard
*
* @param reload if true, dashboard object will be reloaded and all unsaved changes
* will be lost
*/
private void rebuildDashboard(boolean reload) {
if (dashboard == null)
return;
if (dbc != null)
dbc.dispose();
if (reload) {
dashboard = (Dashboard) ((NXCSession) ConsoleSharedData.getSession()).findObjectById(dashboard.getObjectId(), Dashboard.class);
if (dashboard != null) {
dbc = new DashboardControl(parentComposite, SWT.NONE, dashboard, this, selectionProvider, false);
parentComposite.layout(true, true);
setPartName(Messages.get().DashboardView_PartNamePrefix + dashboard.getObjectName());
if (!readOnly) {
dbc.setModifyListener(dbcModifyListener);
}
} else {
dbc = null;
}
} else {
dbc = new DashboardControl(parentComposite, SWT.NONE, dashboard, dbc.getElements(), this, selectionProvider, dbc.isModified());
parentComposite.layout(true, true);
if (!readOnly) {
dbc.setModifyListener(dbcModifyListener);
}
}
actionSave.setEnabled((dbc != null) ? dbc.isModified() : false);
firePropertyChange(PROP_DIRTY);
}
Aggregations