1 /******************************************************************************* 2 * Copyright (c) 2011 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 * Brian de Alwis - port to Eclipse 4 14 ******************************************************************************/ 15 16 package org.eclipse.e4.ui.workbench.renderers.swt.cocoa; 17 18 import javax.inject.Named; 19 import org.eclipse.e4.core.di.annotations.Execute; 20 import org.eclipse.e4.ui.services.IServiceConstants; 21 import org.eclipse.swt.internal.cocoa.NSWindow; 22 import org.eclipse.swt.widgets.Shell; 23 24 /** 25 * @since 4.1 26 */ 27 public class ZoomWindowHandler extends AbstractWindowHandler { 28 @Execute execute(@amedIServiceConstants.ACTIVE_SHELL) Shell shell)29 public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell) { 30 if (shell == null) { 31 return; 32 } 33 NSWindow window = shell.view.window(); 34 if (window == null) { 35 return; 36 } 37 window.zoom(window); 38 } 39 40 } 41