use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite in project cubrid-manager by CUBRID.
the class DbSystemMonitorHistoryViewPart method createPartControl.
/**
* Creates the SWT controls for this workbench part.
*
* @param parent the parent control
*/
public void createPartControl(Composite parent) {
final ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
composite = new Composite(scrolledComp, SWT.RESIZE);
GridLayout layout = new GridLayout(1, false);
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
final HistoryComposite historyComposite = new HistoryComposite();
historyComposite.loadTimeSelection(composite);
Label sepWithResult = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_OUT);
sepWithResult.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
chartComp = new Composite(composite, SWT.RESIZE);
GridLayout chartCompLayout = new GridLayout(1, true);
chartComp.setLayout(chartCompLayout);
chartComp.setLayoutData(new GridData(GridData.FILL_BOTH));
loadCpuChart(chartComp);
loadMemoryChart(chartComp);
scrolledComp.setContent(composite);
scrolledComp.setExpandHorizontal(true);
scrolledComp.setExpandVertical(true);
scrolledComp.setMinHeight(800);
scrolledComp.setMinWidth(545);
historyComposite.getQueryBtn().addSelectionListener(new HistoryBtnSelectionListener(historyComposite));
List<String> databaseLst = new ArrayList<String>();
List<DatabaseInfo> databaseInfoLst = serverInfo.getLoginedUserInfo().getDatabaseInfoList();
for (DatabaseInfo databaseInfo : databaseInfoLst) {
DbRunningType dbRunningType = databaseInfo.getRunningType();
if (dbRunningType == DbRunningType.CS) {
databaseLst.add(databaseInfo.getDbName());
}
}
dbCombo = new DbComboContribution("database");
dbCombo.setDatabaseLst(databaseLst);
if (!databaseLst.isEmpty()) {
databaseLst.add(0, ALL_DB_NAME);
dbCombo.setSelectedDb(databaseLst.get(0));
}
String selectDb = dbCombo.getSelectedDb();
if (ALL_DB_NAME.equals(selectDb)) {
dbName = "";
} else {
dbName = selectDb;
}
makeActions();
}
Aggregations