package com.sap.dbmtk.demo;

import com.sap.dbmtk.demo.SqlStatement.Type;


public class DataPanelStatistics
extends DataPanelAbstract
{
	private static final long serialVersionUID = 1L;
	public static final String NAME = "Demo Statistics";

	public DataPanelStatistics(DemoApp owner)
	{
		super(owner, NAME, true);
	}

	@Override public boolean showAddButton()    { return false; }
	@Override public boolean showChangeButton() { return false; }
	@Override public boolean showRemoveButton() { return false; }

	@Override
	public SqlStatement getTableDataSqlStatement()
	{
		SqlStatement stmnt = new SqlStatement(Type.CALLABLE, "{call get_demoapp_usage_statistics(?)}");
		stmnt.addParam( SqlStatementParam.createOracleResultSetParam("a_cursor") );

		return stmnt;
	}

	@Override
	public void onTabSelected()
	{
		if ( ! getConnectionProvider().isConnected() )
			return;

		refreshTableData();
	}
}
