Author: dgeraskov
Date: 2011-02-11 07:27:58 -0500 (Fri, 11 Feb 2011)
New Revision: 29110
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/CodeGenerationResourceNameChange.java
Log:
Misprint fix.
Copied:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/CodeGenerationResourceNameChange.java
(from rev 29061,
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/CodeGenerationReseourceNameChange.java)
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/CodeGenerationResourceNameChange.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/CodeGenerationResourceNameChange.java 2011-02-11
12:27:58 UTC (rev 29110)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009 - 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.hibernate.eclipse.launch.core.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class CodeGenerationResourceNameChange extends Change {
+
+ private ILaunchConfiguration fLaunchConfiguration;
+ private IPath fOldPath;
+ private IPath fNewPath;
+
+ CodeGenerationResourceNameChange(ILaunchConfiguration launchConfiguration, IPath
oldPath, IPath newPath){
+ fLaunchConfiguration = launchConfiguration;
+ fOldPath = oldPath;
+ fNewPath = newPath;
+ }
+
+ @Override
+ public Object getModifiedElement() {
+ return fLaunchConfiguration;
+ }
+
+ @Override
+ public String getName() {
+ return
NLS.bind(HibernateConsoleMessages.LaunchConfigurationResourceNameChange_update_resource_path_in_launch_cfg,
fLaunchConfiguration.getName());
+ }
+
+ @Override
+ public void initializeValidationData(IProgressMonitor pm) { }
+
+ @Override
+ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+ return new RefactoringStatus();
+ }
+
+ @Override
+ public Change perform(IProgressMonitor pm) throws CoreException {
+ fLaunchConfiguration =
HibernateRefactoringUtil.updateCodeGenerationConfig(fLaunchConfiguration, fOldPath,
fNewPath);
+ return new CodeGenerationResourceNameChange(fLaunchConfiguration, fNewPath, fOldPath);
+ }
+
+}