Search in sources :

Example 1 with DbSystemMonitorCompositePart

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();
}
Also used : DbSystemMonitorCompositePart(com.cubrid.cubridmanager.ui.monitoring.editor.internal.DbSystemMonitorCompositePart) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) HistoryComposite(com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite) DatabaseInfo(com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) ArrayList(java.util.ArrayList) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) DbRunningType(com.cubrid.cubridmanager.core.common.model.DbRunningType)

Aggregations

DbRunningType (com.cubrid.cubridmanager.core.common.model.DbRunningType)1 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)1 DbSystemMonitorCompositePart (com.cubrid.cubridmanager.ui.monitoring.editor.internal.DbSystemMonitorCompositePart)1 HistoryComposite (com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite)1 ArrayList (java.util.ArrayList)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1