1 /******************************************************************************* 2 * Copyright (c) 2005, 2015 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.ltk.internal.core.refactoring.history; 15 16 import org.eclipse.core.runtime.Assert; 17 import org.eclipse.core.runtime.IProgressMonitor; 18 19 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; 20 import org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy; 21 22 /** 23 * Adapter class which adapts refactoring descriptors to refactoring descriptor 24 * proxies. 25 * 26 * @since 3.2 27 */ 28 public final class RefactoringDescriptorProxyAdapter extends RefactoringDescriptorProxy { 29 30 /** The encapsulated descriptor */ 31 private final RefactoringDescriptor fDescriptor; 32 33 /** 34 * Creates a new refactoring descriptor proxy adapter. 35 * 36 * @param descriptor 37 * the descriptor to encapsulate 38 */ RefactoringDescriptorProxyAdapter(final RefactoringDescriptor descriptor)39 public RefactoringDescriptorProxyAdapter(final RefactoringDescriptor descriptor) { 40 Assert.isNotNull(descriptor); 41 fDescriptor= descriptor; 42 } 43 44 @Override getDescription()45 public String getDescription() { 46 return fDescriptor.getDescription(); 47 } 48 49 @Override getProject()50 public String getProject() { 51 return fDescriptor.getProject(); 52 } 53 54 @Override getTimeStamp()55 public long getTimeStamp() { 56 return fDescriptor.getTimeStamp(); 57 } 58 59 @Override requestDescriptor(final IProgressMonitor monitor)60 public RefactoringDescriptor requestDescriptor(final IProgressMonitor monitor) { 61 return fDescriptor; 62 } 63 64 @Override toString()65 public String toString() { 66 return fDescriptor.toString(); 67 } 68 }