FileDocCategorySizeDatePackage
EventLogView.javaAPI DocAndroid 1.5 API4298Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.ddms.views

EventLogView

public class EventLogView extends SelectionDependentViewPart

Fields Summary
private com.android.ddmuilib.log.event.EventLogPanel
mLogPanel
Constructors Summary
Methods Summary
public voidcreatePartControl(org.eclipse.swt.widgets.Composite parent)

        ImageLoader loader = DdmsPlugin.getImageLoader();

        // create the external actions
        CommonAction optionsAction = new CommonAction("Options...");
        optionsAction.setToolTipText("Opens the options panel");
        optionsAction.setImageDescriptor(loader
                .loadDescriptor("edit.png")); // $NON-NLS-1$

        CommonAction clearLogAction = new CommonAction("Clear Log");
        clearLogAction.setToolTipText("Clears the event log");
        clearLogAction.setImageDescriptor(loader
                .loadDescriptor("clear.png")); // $NON-NLS-1$

        CommonAction saveAction = new CommonAction("Save Log");
        saveAction.setToolTipText("Saves the event log");
        saveAction.setImageDescriptor(loader
                .loadDescriptor("save.png")); // $NON-NLS-1$

        CommonAction loadAction = new CommonAction("Load Log");
        loadAction.setToolTipText("Loads an event log");
        loadAction.setImageDescriptor(loader
                .loadDescriptor("load.png")); // $NON-NLS-1$

        CommonAction importBugAction = new CommonAction("Import Bug Report Log");
        importBugAction.setToolTipText("Imports a bug report.");
        importBugAction.setImageDescriptor(loader
                .loadDescriptor("importBug.png")); // $NON-NLS-1$

        placeActions(optionsAction, clearLogAction, saveAction, loadAction, importBugAction);

        mLogPanel = new EventLogPanel(DdmsPlugin.getImageLoader());
        mLogPanel.setActions(optionsAction, clearLogAction, saveAction, loadAction, importBugAction);
        mLogPanel.createPanel(parent);
        setSelectionDependentPanel(mLogPanel);
    
public voiddispose()

        if (mLogPanel != null) {
            mLogPanel.stopEventLog(true);
        }
    
private voidplaceActions(org.eclipse.jface.action.IAction optionAction, org.eclipse.jface.action.IAction clearAction, org.eclipse.jface.action.IAction saveAction, org.eclipse.jface.action.IAction loadAction, com.android.ide.eclipse.ddms.CommonAction importBugAction)
Places the actions in the toolbar and in the menu.

param
importBugAction

        IActionBars actionBars = getViewSite().getActionBars();

        // first in the menu
        IMenuManager menuManager = actionBars.getMenuManager();
        menuManager.add(clearAction);
        menuManager.add(new Separator());
        menuManager.add(saveAction);
        menuManager.add(loadAction);
        menuManager.add(importBugAction);
        menuManager.add(new Separator());
        menuManager.add(optionAction);

        // and then in the toolbar
        IToolBarManager toolBarManager = actionBars.getToolBarManager();
        toolBarManager.add(clearAction);
        toolBarManager.add(new Separator());
        toolBarManager.add(saveAction);
        toolBarManager.add(loadAction);
        toolBarManager.add(importBugAction);
        toolBarManager.add(new Separator());
        toolBarManager.add(optionAction);
    
public voidsetFocus()

        mLogPanel.setFocus();