use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.DbSystemMonitorCompositePart in project cubrid-manager by CUBRID.
the class DbSystemMonitorViewPart 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));
compositePart = new DbSystemMonitorCompositePart(composite);
compositePart.setCpuSeriesKey(new String[] { DbProcStatEnum.USER_PERCENT.name(), DbProcStatEnum.KERNEL_PERCENT.name() });
compositePart.setMemorySeriesKey(new String[] { DbProcStatEnum.MEMPHY_PERCENT.name() });
//history setting
compositePart.setHistoryFileName(historyFileName);
compositePart.setHistoryPath(historyPath);
compositePart.setHistoryFileHelp(historyFileHelp);
compositePart.load();
scrolledComp.setContent(composite);
scrolledComp.setExpandHorizontal(true);
scrolledComp.setExpandVertical(true);
scrolledComp.setMinHeight(800);
scrolledComp.setMinWidth(350);
ServerInfo serverInfo = cubridNode.getServer().getServerInfo();
ArrayList<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()) {
runflag = false;
} else {
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();
new DataGenerator().start();
}
Aggregations