Search in sources :

Example 6 with DevicesView

use of com.tencent.wstt.apt.ui.views.DevicesView in project GT by Tencent.

the class DumpHprofAction method run.

@Override
public void run() {
    DevicesView deviceViewPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    TableItem[] selectData = deviceViewPart.sourcePkgTableViewer.getTable().getSelection();
    if (selectData == null || selectData.length == 0) {
        APTConsoleFactory.getInstance().APTPrint("进程列表为空");
        return;
    }
    PkgInfo itemData = (PkgInfo) selectData[0].getData();
    final String pkgName = itemData.contents[PkgInfo.NAME_INDEX];
    DDMSUtil.dump(pkgName);
}
Also used : TableItem(org.eclipse.swt.widgets.TableItem) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView) PkgInfo(com.tencent.wstt.apt.data.PkgInfo)

Example 7 with DevicesView

use of com.tencent.wstt.apt.ui.views.DevicesView in project GT by Tencent.

the class GCAction method run.

@Override
public void run() {
    DevicesView deviceViewPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    TableItem[] selectData = deviceViewPart.sourcePkgTableViewer.getTable().getSelection();
    if (selectData == null || selectData.length == 0) {
        APTConsoleFactory.getInstance().APTPrint("进程列表为空");
        return;
    }
    PkgInfo itemData = (PkgInfo) selectData[0].getData();
    final String pkgName = itemData.contents[PkgInfo.NAME_INDEX];
    DDMSUtil.gc(pkgName);
}
Also used : TableItem(org.eclipse.swt.widgets.TableItem) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView) PkgInfo(com.tencent.wstt.apt.data.PkgInfo)

Example 8 with DevicesView

use of com.tencent.wstt.apt.ui.views.DevicesView in project GT by Tencent.

the class TestSenceUtil method update.

/**
	* @Description 获取当前的测试设置 
	* @param @return   
	* @return boolean 
	* @throws
	 */
public static boolean update() {
    DevicesView dvPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
    SettingView svPart = (SettingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(SettingView.ID);
    if (dvPart == null || svPart == null) {
        return false;
    }
    /**
		 * 用这种方式获取测试参数的方式有很大的问题
		 * 比如用户设置完后,关闭了settings页面,然后点击开始测试
		 * 
		 * 理想的方式应该是用编辑器实现,页面背后对应一个xml文件进行存储
		 */
    dvPart.getTargetPkgInfoList();
    svPart.getTestArgs();
    return true;
}
Also used : SettingView(com.tencent.wstt.apt.ui.views.SettingView) DevicesView(com.tencent.wstt.apt.ui.views.DevicesView)

Example 9 with DevicesView

use of com.tencent.wstt.apt.ui.views.DevicesView in project GT by Tencent.

the class APTState method DealWithEventBefore_Display.

private void DealWithEventBefore_Display(APTEventEnum event) {
    switch(event) {
        case CONFIGRURE_OPER:
            //清除曲线、统计表格
            //APTConsoleFactory.getInstance().APTPrint("CONFIGRURE_OPER");
            APTConsoleFactory.getInstance().APTPrint("clearChartAndTableData");
            clearChartAndTableData();
            APTConsoleFactory.getInstance().APTPrint("clearChartAndTableData ends");
            break;
        case START_OPER:
            //清除曲线、统计表格列表清空
            clearChartAndTableData();
            break;
        case STOP_OPER:
            APTConsoleFactory.getInstance().APTPrint("展示状态下不可能接收STOP事件");
            StatusBar.getInstance().showInfo("展示状态下不可能接收STOP事件");
            break;
        case OPENLOG_OPER:
            //APTConsoleFactory.getInstance().APTPrint("OPENLOG_OPER");
            clearChartAndTableData();
            DevicesView deviceViewPart = (DevicesView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(DevicesView.ID);
            if (deviceViewPart == null) {
                APTConsoleFactory.getInstance().APTPrint("setUIEnable:Setting或者Device视图对象为空");
                return;
            }
            //TODO:尽量使用UIThread,因为非UI的那种方式,会存在延时,导致删除
            //延时这段时间发生的许多数据
            deviceViewPart.clearTargetPkgTableViewerForUIThread();
            break;
        default:
            APTConsoleFactory.getInstance().APTPrint("展示状态default");
            StatusBar.getInstance().showInfo("展示状态default");
            break;
    }
    APTConsoleFactory.getInstance().APTPrint("DealWithEventBefore_Display ends");
}
Also used : DevicesView(com.tencent.wstt.apt.ui.views.DevicesView)

Aggregations

DevicesView (com.tencent.wstt.apt.ui.views.DevicesView)9 SettingView (com.tencent.wstt.apt.ui.views.SettingView)4 PkgInfo (com.tencent.wstt.apt.data.PkgInfo)2 CPUView (com.tencent.wstt.apt.ui.views.CPUView)2 MemoryView (com.tencent.wstt.apt.ui.views.MemoryView)2 TableItem (org.eclipse.swt.widgets.TableItem)2 CPUProvider (com.tencent.wstt.apt.chart.CPUProvider)1 ChartObserver (com.tencent.wstt.apt.chart.ChartObserver)1 DataProvider (com.tencent.wstt.apt.chart.DataProvider)1 FileObserver (com.tencent.wstt.apt.chart.FileObserver)1 HprofDumpObserver (com.tencent.wstt.apt.chart.HprofDumpObserver)1 JiffiesProviderNew (com.tencent.wstt.apt.chart.JiffiesProviderNew)1 JiffiesTableObserver (com.tencent.wstt.apt.chart.JiffiesTableObserver)1 MemProvider (com.tencent.wstt.apt.chart.MemProvider)1 PidUpdateObserver (com.tencent.wstt.apt.chart.PidUpdateObserver)1 TableAllDataObserver (com.tencent.wstt.apt.chart.TableAllDataObserver)1 TableViewFilter (com.tencent.wstt.apt.util.TableViewFilter)1 Date (java.util.Date)1