Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Stornelli2019-05-04 03:05:11 -0400
committerMarco Stornelli2019-05-16 13:42:24 -0400
commitbdb0da6b73c5d9f161eea1a0ab99fa060d13f794 (patch)
tree1d268fe647048f7b57c7af0139327ab870b0c8f7
parentf90cd7214dca372e6b7ba008a484359b45753b16 (diff)
downloadorg.eclipse.cdt-bdb0da6b73c5d9f161eea1a0ab99fa060d13f794.tar.gz
org.eclipse.cdt-bdb0da6b73c5d9f161eea1a0ab99fa060d13f794.tar.xz
org.eclipse.cdt-bdb0da6b73c5d9f161eea1a0ab99fa060d13f794.zip
Bug 120883 - Compliant "rule of 5" class wizard
Added the optional generation of copy constructor, move constructor, assignment operator and move assignment operator. Change-Id: I1fc0a04fd52ea828ca24d0fe57148b06dd27ed95 Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AbstractMethodStub.java5
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AssignOpMethodStub.java95
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/CopyConstructorMethodStub.java94
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/IMethodStub.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveAssignOpMethodStub.java95
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveConstructorMethodStub.java94
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.java4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.properties4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java10
9 files changed, 401 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AbstractMethodStub.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AbstractMethodStub.java
index d3e9a12f78..46970bc339 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AbstractMethodStub.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AbstractMethodStub.java
@@ -104,4 +104,9 @@ public abstract class AbstractMethodStub implements IMethodStub {
@Override
public abstract String createMethodImplementation(ITranslationUnit tu, String className,
IBaseClassInfo[] baseClasses, String lineDelimiter) throws CoreException;
+
+ @Override
+ public boolean isEnabledByDefault() {
+ return true;
+ }
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AssignOpMethodStub.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AssignOpMethodStub.java
new file mode 100644
index 0000000000..9609dd37ed
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/AssignOpMethodStub.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marco Stornelli
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Marco Stornelli - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.wizards.classwizard;
+
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.ui.CodeGeneration;
+import org.eclipse.core.runtime.CoreException;
+
+public final class AssignOpMethodStub extends AbstractMethodStub {
+ private static String NAME = NewClassWizardMessages.NewClassCodeGeneration_stub_assign_op_name;
+
+ public AssignOpMethodStub() {
+ this(ASTAccessVisibility.PUBLIC, false);
+ }
+
+ public AssignOpMethodStub(ASTAccessVisibility access, boolean isInline) {
+ super(NAME, access, false, isInline);
+ }
+
+ @Override
+ public String createMethodDeclaration(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("& operator=(const "); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("& other)"); //$NON-NLS-1$
+ if (fIsInline) {
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getMethodBodyContent(tu, className, "operator=", null, lineDelimiter); //$NON-NLS-1$
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ } else {
+ buf.append(";"); //$NON-NLS-1$
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public String createMethodImplementation(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ if (fIsInline) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("& "); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("::"); //$NON-NLS-1$
+ buf.append("operator=(const "); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("& other)"); //$NON-NLS-1$
+ buf.append(lineDelimiter);
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getMethodBodyContent(tu, className, "operator=", null, lineDelimiter); //$NON-NLS-1$
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ return buf.toString();
+ }
+
+ @Override
+ public boolean isConstructor() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabledByDefault() {
+ return false;
+ }
+
+ @Override
+ public boolean canModifyVirtual() {
+ return false;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/CopyConstructorMethodStub.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/CopyConstructorMethodStub.java
new file mode 100644
index 0000000000..2dbae40e58
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/CopyConstructorMethodStub.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marco Stornelli
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Marco Stornelli - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.wizards.classwizard;
+
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.ui.CodeGeneration;
+import org.eclipse.core.runtime.CoreException;
+
+public final class CopyConstructorMethodStub extends AbstractMethodStub {
+ private static String NAME = NewClassWizardMessages.NewClassCodeGeneration_stub_copy_constructor_name;
+
+ public CopyConstructorMethodStub() {
+ this(ASTAccessVisibility.PUBLIC, false);
+ }
+
+ public CopyConstructorMethodStub(ASTAccessVisibility access, boolean isInline) {
+ super(NAME, access, false, isInline);
+ }
+
+ @Override
+ public String createMethodDeclaration(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("(const "); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("& other)"); //$NON-NLS-1$
+ if (fIsInline) {
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getConstructorBodyContent(tu, className, null, lineDelimiter);
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ } else {
+ buf.append(";"); //$NON-NLS-1$
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public String createMethodImplementation(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ if (fIsInline) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("::"); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("(const "); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("& other)"); //$NON-NLS-1$
+ buf.append(lineDelimiter);
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getConstructorBodyContent(tu, className, null, lineDelimiter);
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ return buf.toString();
+ }
+
+ @Override
+ public boolean isConstructor() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnabledByDefault() {
+ return false;
+ }
+
+ @Override
+ public boolean canModifyVirtual() {
+ return false;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/IMethodStub.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/IMethodStub.java
index 9026edc9ff..7191ce8913 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/IMethodStub.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/IMethodStub.java
@@ -45,6 +45,8 @@ public interface IMethodStub {
public boolean isDestructor();
+ public boolean isEnabledByDefault();
+
public String createMethodDeclaration(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
String lineDelimiter) throws CoreException;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveAssignOpMethodStub.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveAssignOpMethodStub.java
new file mode 100644
index 0000000000..b337e18238
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveAssignOpMethodStub.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marco Stornelli
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Marco Stornelli - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.wizards.classwizard;
+
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.ui.CodeGeneration;
+import org.eclipse.core.runtime.CoreException;
+
+public final class MoveAssignOpMethodStub extends AbstractMethodStub {
+ private static String NAME = NewClassWizardMessages.NewClassCodeGeneration_stub_move_op_name;
+
+ public MoveAssignOpMethodStub() {
+ this(ASTAccessVisibility.PUBLIC, false);
+ }
+
+ public MoveAssignOpMethodStub(ASTAccessVisibility access, boolean isInline) {
+ super(NAME, access, false, isInline);
+ }
+
+ @Override
+ public String createMethodDeclaration(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("& operator=("); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("&& other)"); //$NON-NLS-1$
+ if (fIsInline) {
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getMethodBodyContent(tu, className, "operator=", null, lineDelimiter); //$NON-NLS-1$
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ } else {
+ buf.append(";"); //$NON-NLS-1$
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public String createMethodImplementation(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ if (fIsInline) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("& "); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("::"); //$NON-NLS-1$
+ buf.append("operator=("); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("&& other)"); //$NON-NLS-1$
+ buf.append(lineDelimiter);
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getMethodBodyContent(tu, className, "operator=", null, lineDelimiter); //$NON-NLS-1$
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ return buf.toString();
+ }
+
+ @Override
+ public boolean isConstructor() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnabledByDefault() {
+ return false;
+ }
+
+ @Override
+ public boolean canModifyVirtual() {
+ return false;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveConstructorMethodStub.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveConstructorMethodStub.java
new file mode 100644
index 0000000000..8213eede30
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MoveConstructorMethodStub.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Marco Stornelli
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Marco Stornelli - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.internal.ui.wizards.classwizard;
+
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
+import org.eclipse.cdt.ui.CodeGeneration;
+import org.eclipse.core.runtime.CoreException;
+
+public final class MoveConstructorMethodStub extends AbstractMethodStub {
+ private static String NAME = NewClassWizardMessages.NewClassCodeGeneration_stub_move_constructor_name;
+
+ public MoveConstructorMethodStub() {
+ this(ASTAccessVisibility.PUBLIC, false);
+ }
+
+ public MoveConstructorMethodStub(ASTAccessVisibility access, boolean isInline) {
+ super(NAME, access, false, isInline);
+ }
+
+ @Override
+ public String createMethodDeclaration(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("("); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("&& other)"); //$NON-NLS-1$
+ if (fIsInline) {
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getConstructorBodyContent(tu, className, null, lineDelimiter);
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ } else {
+ buf.append(";"); //$NON-NLS-1$
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public String createMethodImplementation(ITranslationUnit tu, String className, IBaseClassInfo[] baseClasses,
+ String lineDelimiter) throws CoreException {
+ if (fIsInline) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuilder buf = new StringBuilder();
+ buf.append(className);
+ buf.append("::"); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("("); //$NON-NLS-1$
+ buf.append(className);
+ buf.append("&& other)"); //$NON-NLS-1$
+ buf.append(lineDelimiter);
+ buf.append('{');
+ buf.append(lineDelimiter);
+ String body = CodeGeneration.getConstructorBodyContent(tu, className, null, lineDelimiter);
+ if (body != null) {
+ buf.append(body);
+ buf.append(lineDelimiter);
+ }
+ buf.append('}');
+ return buf.toString();
+ }
+
+ @Override
+ public boolean isConstructor() {
+ return true;
+ }
+
+ @Override
+ public boolean isEnabledByDefault() {
+ return false;
+ }
+
+ @Override
+ public boolean canModifyVirtual() {
+ return false;
+ }
+}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.java
index c6d9839e73..056d1e8878 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.java
@@ -123,6 +123,10 @@ public final class NewClassWizardMessages extends NLS {
public static String NewClassCodeGeneration_createType_task_source;
public static String NewClassCodeGeneration_stub_constructor_name;
public static String NewClassCodeGeneration_stub_destructor_name;
+ public static String NewClassCodeGeneration_stub_copy_constructor_name;
+ public static String NewClassCodeGeneration_stub_move_constructor_name;
+ public static String NewClassCodeGeneration_stub_assign_op_name;
+ public static String NewClassCodeGeneration_stub_move_op_name;
static {
NLS.initializeMessages(NewClassWizardMessages.class.getName(), NewClassWizardMessages.class);
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.properties
index 6bdf972179..66386faa77 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.properties
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassWizardMessages.properties
@@ -151,3 +151,7 @@ NewClassCodeGeneration_createType_task_header_addIncludePaths=Adding new include
NewClassCodeGeneration_createType_task_source=Creating source file....
NewClassCodeGeneration_stub_constructor_name=Constructor
NewClassCodeGeneration_stub_destructor_name=Destructor
+NewClassCodeGeneration_stub_copy_constructor_name=Copy constructor
+NewClassCodeGeneration_stub_move_constructor_name=Move constructor
+NewClassCodeGeneration_stub_assign_op_name=Copy assignment operator
+NewClassCodeGeneration_stub_move_op_name=Move assignment operator
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java
index 5608e93590..1d2a9d3b45 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java
@@ -44,13 +44,17 @@ import org.eclipse.cdt.internal.ui.dialogs.StatusUtil;
import org.eclipse.cdt.internal.ui.util.SWTUtil;
import org.eclipse.cdt.internal.ui.wizards.NewElementWizardPage;
import org.eclipse.cdt.internal.ui.wizards.SourceFolderSelectionDialog;
+import org.eclipse.cdt.internal.ui.wizards.classwizard.AssignOpMethodStub;
import org.eclipse.cdt.internal.ui.wizards.classwizard.BaseClassInfo;
import org.eclipse.cdt.internal.ui.wizards.classwizard.BaseClassesListDialogField;
import org.eclipse.cdt.internal.ui.wizards.classwizard.ConstructorMethodStub;
+import org.eclipse.cdt.internal.ui.wizards.classwizard.CopyConstructorMethodStub;
import org.eclipse.cdt.internal.ui.wizards.classwizard.DestructorMethodStub;
import org.eclipse.cdt.internal.ui.wizards.classwizard.IBaseClassInfo;
import org.eclipse.cdt.internal.ui.wizards.classwizard.IMethodStub;
import org.eclipse.cdt.internal.ui.wizards.classwizard.MethodStubsListDialogField;
+import org.eclipse.cdt.internal.ui.wizards.classwizard.MoveAssignOpMethodStub;
+import org.eclipse.cdt.internal.ui.wizards.classwizard.MoveConstructorMethodStub;
import org.eclipse.cdt.internal.ui.wizards.classwizard.NamespaceSelectionDialog;
import org.eclipse.cdt.internal.ui.wizards.classwizard.NewBaseClassSelectionDialog;
import org.eclipse.cdt.internal.ui.wizards.classwizard.NewBaseClassSelectionDialog.ITypeSelectionListener;
@@ -491,7 +495,7 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
if (stub.canModifyInline()) {
stub.setInline(getBooleanSettingWithDefault(KEY_STUB_INLINE + i, stub.isInline()));
}
- addMethodStub(stub, getBooleanSettingWithDefault(KEY_STUB_SELECTED + i, true));
+ addMethodStub(stub, getBooleanSettingWithDefault(KEY_STUB_SELECTED + i, stub.isEnabledByDefault()));
}
setTestFileSelection(fDialogSettings.getBoolean(KEY_TEST_FILE_SELECTED), true);
@@ -574,7 +578,9 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
protected IMethodStub[] getDefaultMethodStubs() {
- return new IMethodStub[] { new ConstructorMethodStub(), new DestructorMethodStub() };
+ return new IMethodStub[] { new ConstructorMethodStub(), new DestructorMethodStub(),
+ new CopyConstructorMethodStub(), new MoveConstructorMethodStub(), new AssignOpMethodStub(),
+ new MoveAssignOpMethodStub() };
}
/**

Back to the top