use of com.intellij.openapi.actionSystem.DefaultActionGroup in project android by JetBrains.
the class AndroidToolWindowFactory method getToolbarActions.
@NotNull
public ActionGroup getToolbarActions(Project project, DeviceContext deviceContext) {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new ScreenshotAction(project, deviceContext));
group.add(new ScreenRecorderAction(project, deviceContext));
group.add(DumpSysActions.create(project, deviceContext));
group.add(new Separator());
group.add(new TerminateVMAction(deviceContext));
group.add(new HierarchyViewAction(project, deviceContext));
group.add(new Separator());
group.add(new BrowserHelpAction("Android Monitor", "http://developer.android.com/r/studio-ui/android-monitor.html"));
return group;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project android by JetBrains.
the class CpuMonitorView method getToolbarActions.
@Override
@NotNull
public ActionGroup getToolbarActions() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new RecordingAction(this));
group.add(new Separator());
group.add(new ToggleMethodProfilingAction(myProject, myDeviceContext));
//group.add(new MyThreadDumpAction()); // thread dump -> systrace
group.add(new Separator());
group.add(new BrowserHelpAction("CPU monitor", "http://developer.android.com/r/studio-ui/am-cpu.html"));
return group;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project android by JetBrains.
the class MemoryMonitorView method getToolbarActions.
@Override
@NotNull
public ActionGroup getToolbarActions() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new RecordingAction(this));
group.add(new Separator());
group.add(new GcAction(myDeviceContext));
group.add(new DumpHprofAction(myProject, myDeviceContext, myEvents));
group.add(new ToggleAllocationTrackingAction(myProject, myDeviceContext, myEvents));
group.add(new Separator());
group.add(new BrowserHelpAction("Memory monitor", "http://developer.android.com/r/studio-ui/am-memory.html"));
if (Boolean.getBoolean("studio.profiling.debug")) {
group.addSeparator();
group.add(new ToggleDebugRender(myTimelineComponent));
}
return group;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project android by JetBrains.
the class NetworkMonitorView method getToolbarActions.
@Override
@NotNull
public ActionGroup getToolbarActions() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new RecordingAction(this));
group.add(new Separator());
group.add(new BrowserHelpAction("Network monitor", "http://developer.android.com/r/studio-ui/am-network.html"));
return group;
}
use of com.intellij.openapi.actionSystem.DefaultActionGroup in project android by JetBrains.
the class DeviceMenuAction method createPopupActionGroup.
@Override
@NotNull
protected DefaultActionGroup createPopupActionGroup() {
DefaultActionGroup group = new DefaultActionGroup(null, true);
Configuration configuration = myRenderContext.getConfiguration();
if (configuration == null) {
return group;
}
Device current = configuration.getDevice();
ConfigurationManager configurationManager = configuration.getConfigurationManager();
List<Device> deviceList = configurationManager.getDevices();
if (LIST_RECENT_DEVICES) {
List<Device> recent = configurationManager.getDevices();
if (recent.size() > 1) {
boolean separatorNeeded = false;
for (Device device : recent) {
String label = getLabel(device, isNexus(device));
Icon icon = getDeviceClassIcon(device);
group.add(new SetDeviceAction(myRenderContext, label, device, icon, device == current));
separatorNeeded = true;
}
if (separatorNeeded) {
group.addSeparator();
}
}
}
AndroidFacet facet = AndroidFacet.getInstance(configurationManager.getModule());
if (facet == null) {
// Unlikely, but has happened - see http://b.android.com/68091
return group;
}
if (!deviceList.isEmpty()) {
Map<String, List<Device>> manufacturers = new TreeMap<>();
for (Device device : deviceList) {
List<Device> devices;
if (manufacturers.containsKey(device.getManufacturer())) {
devices = manufacturers.get(device.getManufacturer());
} else {
devices = new ArrayList<>();
manufacturers.put(device.getManufacturer(), devices);
}
devices.add(device);
}
List<Device> nexus = new ArrayList<>();
Map<FormFactor, List<Device>> deviceMap = Maps.newEnumMap(FormFactor.class);
for (FormFactor factor : FormFactor.values()) {
deviceMap.put(factor, Lists.newArrayList());
}
for (List<Device> devices : manufacturers.values()) {
for (Device device : devices) {
if (isNexus(device) && !device.getManufacturer().equals(MANUFACTURER_GENERIC) && !isWear(device) && !isTv(device)) {
nexus.add(device);
} else {
deviceMap.get(FormFactor.getFormFactor(device)).add(device);
}
}
}
sortDevicesByScreenSize(nexus);
for (List<Device> list : splitDevicesByScreenSize(nexus)) {
addNexusDeviceSection(group, current, list);
group.addSeparator();
}
addDeviceSection(group, current, deviceMap, false, FormFactor.WEAR);
group.addSeparator();
addDeviceSection(group, current, deviceMap, false, FormFactor.TV);
group.addSeparator();
final AvdManager avdManager = facet.getAvdManagerSilently();
if (avdManager != null) {
boolean separatorNeeded = false;
boolean first = true;
for (AvdInfo avd : avdManager.getValidAvds()) {
Device device = configurationManager.createDeviceForAvd(avd);
if (device != null) {
String avdName = "AVD: " + avd.getName();
boolean selected = current != null && (current.getDisplayName().equals(avdName) || current.getId().equals(avdName));
Icon icon = first ? getDeviceClassIcon(device) : null;
group.add(new SetDeviceAction(myRenderContext, avdName, device, icon, selected));
first = false;
separatorNeeded = true;
}
}
if (separatorNeeded) {
group.addSeparator();
}
}
DefaultActionGroup genericGroup = new DefaultActionGroup("_Generic Phones and Tablets", true);
sortDevicesByScreenSize(deviceMap.get(FormFactor.MOBILE));
addDeviceSection(genericGroup, current, deviceMap, true, FormFactor.MOBILE);
group.add(genericGroup);
}
group.add(new RunAndroidAvdManagerAction("Add Device Definition..."));
return group;
}
Aggregations