1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.hierarchyviewer.ui.action; 17 18 import com.android.hierarchyviewer.ui.Workspace; 19 20 import javax.swing.KeyStroke; 21 import java.awt.event.KeyEvent; 22 import java.awt.event.ActionEvent; 23 import java.awt.Toolkit; 24 25 public class DumpDisplayListAction extends BackgroundAction { 26 public static final String ACTION_NAME = "dumpDisplayList"; 27 private Workspace mWorkspace; 28 29 public DumpDisplayListAction(Workspace workspace) { 30 putValue(NAME, "Dump DisplayList"); 31 putValue(SHORT_DESCRIPTION, "Dump DisplayList"); 32 putValue(LONG_DESCRIPTION, "Dump DisplayList"); 33 this.mWorkspace = workspace; 34 } 35 36 public void actionPerformed(ActionEvent e) { 37 executeBackgroundTask(mWorkspace.outputDisplayList()); 38 } 39 } 40