Search in sources :

Example 6 with HistoryComposite

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();
}
Also used : 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) Label(org.eclipse.swt.widgets.Label) ArrayList(java.util.ArrayList) HistoryComposite(com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite) 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

HistoryComposite (com.cubrid.cubridmanager.ui.monitoring.editor.internal.HistoryComposite)6 GridData (org.eclipse.swt.layout.GridData)6 GridLayout (org.eclipse.swt.layout.GridLayout)6 Composite (org.eclipse.swt.widgets.Composite)6 Label (org.eclipse.swt.widgets.Label)6 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)4 ArrayList (java.util.ArrayList)3 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)2 CounterFile (com.cubrid.cubridmanager.ui.monitoring.editor.count.CounterFile)2 ChartCompositePart (com.cubrid.cubridmanager.ui.monitoring.editor.internal.ChartCompositePart)2 ShowSetting (com.cubrid.cubridmanager.ui.monitoring.editor.internal.ShowSetting)2 IOException (java.io.IOException)2 Calendar (java.util.Calendar)2 List (java.util.List)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 IPath (org.eclipse.core.runtime.IPath)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2 XYPlot (org.jfree.chart.plot.XYPlot)2