1 /******************************************************************************* 2 * Copyright (c) 2000, 2017 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 *******************************************************************************/ 14 package org.eclipse.team.ui; 15 16 import org.eclipse.compare.CompareEditorInput; 17 import org.eclipse.compare.CompareUI; 18 import org.eclipse.ui.IPropertyListener; 19 import org.eclipse.ui.IWorkbenchPart; 20 import org.eclipse.ui.IWorkbenchPartSite; 21 22 /** 23 * This adapter provides default implementations for methods on {@link ISaveableWorkbenchPart} and 24 * {@link IWorkbenchPart}. 25 * <p> 26 * Classes that want to implement a saveable part can simply implement the methods that 27 * they need while accepting the provided defaults for most of the methods. 28 * </p> 29 * @see SaveablePartDialog 30 * @since 3.0 31 * @deprecated Clients should use a subclass of {@link CompareEditorInput} 32 * and {@link CompareUI#openCompareDialog(org.eclipse.compare.CompareEditorInput)} 33 */ 34 @Deprecated 35 public abstract class SaveablePartAdapter implements ISaveableWorkbenchPart { 36 37 @Override doSaveAs()38 public void doSaveAs() { 39 } 40 41 @Override isSaveAsAllowed()42 public boolean isSaveAsAllowed() { 43 return false; 44 } 45 46 @Override isSaveOnCloseNeeded()47 public boolean isSaveOnCloseNeeded() { 48 return false; 49 } 50 51 @Override addPropertyListener(IPropertyListener listener)52 public void addPropertyListener(IPropertyListener listener) { 53 } 54 55 @Override dispose()56 public void dispose() { 57 } 58 59 @Override getSite()60 public IWorkbenchPartSite getSite() { 61 return null; 62 } 63 64 @Override getTitleToolTip()65 public String getTitleToolTip() { 66 return null; 67 } 68 69 @Override removePropertyListener(IPropertyListener listener)70 public void removePropertyListener(IPropertyListener listener) { 71 } 72 73 @Override setFocus()74 public void setFocus() { 75 } 76 77 @Override getAdapter(Class<T> adapter)78 public <T> T getAdapter(Class<T> adapter) { 79 return null; 80 } 81 } 82