From 0d4d66ec6e22720d9e567944293b8f05ca008be0 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 3 Feb 2012 14:20:09 -0800 Subject: [PATCH] Cosmetics. --- .../changegenerator/ChangeGeneratorTest.java | 6 +- .../org/eclipse/cdt/core/dom/IName.java | 2 +- .../eclipse/cdt/core/dom/ast/IASTName.java | 2 +- .../eclipse/cdt/core/dom/ast/IASTNode.java | 3 +- .../internal/core/dom/parser/c/CVisitor.java | 11 +-- .../ui/refactoring/CCompositeChange.java | 11 +-- .../dialogs/VisibilitySelectionPanel.java | 18 ++--- .../implementmethod/ParameterInfo.java | 7 +- .../ui/refactoring/utils/ASTHelper.java | 77 +++++++------------ .../classwizard/BaseClassesLabelProvider.java | 35 +++------ .../MethodStubsListDialogField.java | 3 +- .../dialogfields/CheckedListDialogField.java | 17 +--- 12 files changed, 67 insertions(+), 125 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ChangeGeneratorTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ChangeGeneratorTest.java index f40b77b2e2f..eabbbc053e6 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ChangeGeneratorTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/rewrite/changegenerator/ChangeGeneratorTest.java @@ -63,13 +63,13 @@ public abstract class ChangeGeneratorTest extends BaseTestFramework { assertTrue("The indexing operation of the test CProject has not finished jet. This should not happen...", joined); IASTTranslationUnit unit = CoreModelUtil.findTranslationUnit(testFile).getAST(); - final ChangeGenerator changegenartor = new ChangeGenerator(modStore, + final ChangeGenerator changeGenerator = new ChangeGenerator(modStore, ASTCommenter.getCommentedNodeMap(unit)); unit.accept(visitor); - changegenartor.generateChange(unit); + changeGenerator.generateChange(unit); Document doc = new Document(source); - for (Change curChange : ((CompositeChange) changegenartor.getChange()).getChildren()) { + for (Change curChange : ((CompositeChange) changeGenerator.getChange()).getChildren()) { if (curChange instanceof TextFileChange) { TextFileChange textChange = (TextFileChange) curChange; textChange.getEdit().apply(doc); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IName.java index 55f0f72f189..2aed6c65fb8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IName.java @@ -24,7 +24,7 @@ public interface IName { /** * @since 5.2 */ - IName[] EMPTY_ARRAY= {}; + public static final IName[] EMPTY_ARRAY= {}; /** * Returns the name without qualification and without template arguments. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java index 37ca44358e8..18853e2629c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java @@ -26,7 +26,7 @@ public interface IASTName extends IASTNode, IName { /** * Constant sentinel. */ - public static final IASTName[] EMPTY_NAME_ARRAY = new IASTName[0]; + public static final IASTName[] EMPTY_NAME_ARRAY = {}; /** * Returns the name including qualification and template arguments. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java index f840a8daf7f..7db3fed28ea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java @@ -24,7 +24,6 @@ import org.eclipse.cdt.core.parser.IToken; * @noextend This interface is not intended to be extended by clients. */ public interface IASTNode { - /** * @since 5.3 */ @@ -42,7 +41,7 @@ public interface IASTNode { withLocations } - public static final IASTNode[] EMPTY_NODE_ARRAY = new IASTNode[0]; + public static final IASTNode[] EMPTY_NODE_ARRAY = {}; /** * Get the translation unit (master) node that is the ancestor of all nodes diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java index 68a1410a18b..a9287c1947f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java @@ -1207,14 +1207,15 @@ public class CVisitor extends ASTQueries { node = node.getParent(); } - if (node instanceof IASTParameterDeclaration) - declSpec = ((IASTParameterDeclaration) node).getDeclSpecifier(); - else if (node instanceof IASTSimpleDeclaration) + if (node instanceof IASTSimpleDeclaration) { declSpec = ((IASTSimpleDeclaration) node).getDeclSpecifier(); - else if (node instanceof IASTFunctionDefinition) + } else if (node instanceof IASTParameterDeclaration) { + declSpec = ((IASTParameterDeclaration) node).getDeclSpecifier(); + } else if (node instanceof IASTFunctionDefinition) { declSpec = ((IASTFunctionDefinition) node).getDeclSpecifier(); - else if (node instanceof IASTTypeId) + } else if (node instanceof IASTTypeId) { declSpec = ((IASTTypeId) node).getDeclSpecifier(); + } boolean isParameter = (node instanceof IASTParameterDeclaration || node.getParent() instanceof ICASTKnRFunctionDeclarator); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CCompositeChange.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CCompositeChange.java index d1c036de860..27b668eb970 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CCompositeChange.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/CCompositeChange.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Institute for Software (IFS)- initial API and implementation + * Institute for Software (IFS)- initial API and implementation ******************************************************************************/ package org.eclipse.cdt.internal.ui.refactoring; @@ -18,10 +18,8 @@ import org.eclipse.ltk.core.refactoring.RefactoringChangeDescriptor; /** * @author Emanuel Graf IFS - * */ public class CCompositeChange extends CompositeChange { - private RefactoringChangeDescriptor desc; public CCompositeChange(String name, Change[] children) { @@ -38,12 +36,9 @@ public class CCompositeChange extends CompositeChange { @Override public ChangeDescriptor getDescriptor() { - if(desc == null) { - return super.getDescriptor(); - }else { + if (desc != null) { return desc; } + return super.getDescriptor(); } - - } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/VisibilitySelectionPanel.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/VisibilitySelectionPanel.java index 76ab8f8d84a..bf9f7c33bbe 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/VisibilitySelectionPanel.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/dialogs/VisibilitySelectionPanel.java @@ -22,14 +22,12 @@ import org.eclipse.swt.widgets.Group; import org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum; /** - * 3 radio buttons in a group, labeled according to the corresponding visibility name (public, private, protected). + * Three radio buttons in a group, labeled according to the corresponding visibility name + * (public, private, protected). * * @author Thomas Corbat - * */ public class VisibilitySelectionPanel extends Composite { - - private Button publicAccessRadioButton; private Button protectedAccessRadioButton; private Button privateAccessRadioButton; @@ -46,12 +44,10 @@ public class VisibilitySelectionPanel extends Composite { createAccessModifierComposite(this); setSelected(defaultVisibility); - } private void createAccessModifierComposite(Composite control) { - - accessModifierGroup = new Group(this, SWT.SHADOW_NONE ); + accessModifierGroup = new Group(this, SWT.SHADOW_NONE); RowLayout groupLayout = new RowLayout(SWT.HORIZONTAL); groupLayout.fill = true; accessModifierGroup.setLayout(groupLayout); @@ -65,11 +61,10 @@ public class VisibilitySelectionPanel extends Composite { privateAccessRadioButton = new Button(accessModifierGroup, SWT.RADIO | SWT.LEFT); privateAccessRadioButton.setText(VisibilityEnum.v_private.toString()); - } private void setSelected(VisibilityEnum defaultVisibility) { - switch (defaultVisibility){ + switch (defaultVisibility) { case v_public: publicAccessRadioButton.setSelection(true); break; @@ -79,7 +74,7 @@ public class VisibilitySelectionPanel extends Composite { case v_private: privateAccessRadioButton.setSelection(true); break; - } + } } public Group getGroup() { @@ -87,12 +82,11 @@ public class VisibilitySelectionPanel extends Composite { } @Override - public void setEnabled(boolean enabled){ + public void setEnabled(boolean enabled) { accessModifierGroup.setEnabled(enabled); publicAccessRadioButton.setEnabled(enabled); protectedAccessRadioButton.setEnabled(enabled); privateAccessRadioButton.setEnabled(enabled); super.setEnabled(enabled); } - } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterInfo.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterInfo.java index 55adcb1bfba..e06af942720 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterInfo.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ParameterInfo.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Institute for Software - initial API and implementation + * Institute for Software - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.refactoring.implementmethod; @@ -21,16 +21,15 @@ import org.eclipse.cdt.internal.ui.refactoring.utils.NameHelper; /** * @author Lukas Felber - * */ public class ParameterInfo { private IASTParameterDeclaration parameter; private boolean hasNewName; private String parameterName; - public ParameterInfo(IASTParameterDeclaration parameter, String parameterName, boolean HasNewName) { + public ParameterInfo(IASTParameterDeclaration parameter, String parameterName, boolean hasNewName) { this.parameter = parameter; - this.hasNewName = HasNewName; + this.hasNewName = hasNewName; this.parameterName = parameterName; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java index 95b3d41c5f8..552290d5db9 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/ASTHelper.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Institute for Software - initial API and implementation + * Institute for Software - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.refactoring.utils; @@ -78,7 +78,8 @@ public class ASTHelper { return null; } - public static boolean samePointers(IASTPointerOperator[] pointerOperators1, IASTPointerOperator[] pointerOperators2, TrailNodeEqualityChecker checker) { + public static boolean samePointers(IASTPointerOperator[] pointerOperators1, + IASTPointerOperator[] pointerOperators2, TrailNodeEqualityChecker checker) { if (pointerOperators2.length == pointerOperators1.length) { for (int i = 0; i < pointerOperators2.length; i++) { IASTPointerOperator operator1 = pointerOperators1[i]; @@ -110,7 +111,7 @@ public class ASTHelper { for (IASTNode aktNode = node; aktNode != null; aktNode = aktNode.getParent()) { if (aktNode instanceof ICPPASTNamespaceDefinition) { namespaces.add(0, (ICPPASTNamespaceDefinition) aktNode); - } else if(aktNode instanceof ICPPASTQualifiedName) { + } else if (aktNode instanceof ICPPASTQualifiedName) { namespaces.addAll(getNamespaces((ICPPASTQualifiedName) aktNode)); } } @@ -119,10 +120,10 @@ public class ASTHelper { public static ArrayList getNamespaces(ICPPASTQualifiedName qualifiedName) { ArrayList namespaces = new ArrayList(); - for(IASTName aktQualifiedPartName : qualifiedName.getNames()) { + for (IASTName aktQualifiedPartName : qualifiedName.getNames()) { IBinding binding = aktQualifiedPartName.resolveBinding(); - for(IASTName aktResolvedName : qualifiedName.getTranslationUnit().getDefinitionsInAST(binding)) { - if(aktResolvedName.getParent() instanceof ICPPASTNamespaceDefinition) { + for (IASTName aktResolvedName : qualifiedName.getTranslationUnit().getDefinitionsInAST(binding)) { + if (aktResolvedName.getParent() instanceof ICPPASTNamespaceDefinition) { namespaces.add((ICPPASTNamespaceDefinition) aktResolvedName.getParent()); break; } @@ -146,10 +147,11 @@ public class ASTHelper { return specifiers; } - public static Collection getAllInFilePreprocessorStatements(IASTTranslationUnit unit, String aktFileName) { + public static Collection getAllInFilePreprocessorStatements( + IASTTranslationUnit unit, String aktFileName) { Collection statements = new ArrayList(); - for(IASTPreprocessorStatement aktStatement : unit.getAllPreprocessorStatements()) { - if(aktStatement.getFileLocation() == null) { + for (IASTPreprocessorStatement aktStatement : unit.getAllPreprocessorStatements()) { + if (aktStatement.getFileLocation() == null) { continue; } else if (aktStatement.getFileLocation().getFileName().equals(aktFileName)) { statements.add(aktStatement); @@ -160,10 +162,10 @@ public class ASTHelper { public static Collection getAllInFileDeclarations(IASTTranslationUnit unit, String aktFileName) { Collection decls = new ArrayList(); - for(IASTDeclaration aktDecl: unit.getDeclarations()) { - if(aktDecl.getFileLocation() == null) { + for (IASTDeclaration aktDecl: unit.getDeclarations()) { + if (aktDecl.getFileLocation() == null) { continue; - } else if(aktDecl.getFileLocation().getFileName().equals(aktFileName)) { + } else if (aktDecl.getFileLocation().getFileName().equals(aktFileName)) { decls.add(aktDecl); } } @@ -172,11 +174,11 @@ public class ASTHelper { public static ICPPASTUsingDirective getActiveUsingDirecitveForNode(IASTNode node, IASTTranslationUnit unit) { ICPPASTUsingDirective activeDirective = null; - for(IASTDeclaration aktDeclaration : getAllInFileDeclarations(unit, node.getFileLocation().getFileName())) { - if(aktDeclaration.getFileLocation().getNodeOffset() >= node.getFileLocation().getNodeOffset()) { + for (IASTDeclaration aktDeclaration : getAllInFileDeclarations(unit, node.getFileLocation().getFileName())) { + if (aktDeclaration.getFileLocation().getNodeOffset() >= node.getFileLocation().getNodeOffset()) { break; } - if(aktDeclaration instanceof ICPPASTUsingDirective) { + if (aktDeclaration instanceof ICPPASTUsingDirective) { activeDirective = (ICPPASTUsingDirective) aktDeclaration; } } @@ -185,7 +187,7 @@ public class ASTHelper { public static Collection getUsingDeclarations(IASTTranslationUnit unit) { Collection usingDecls = new ArrayList(); - for(IASTDeclaration aktDecl : unit.getDeclarations()) { + for (IASTDeclaration aktDecl : unit.getDeclarations()) { if (aktDecl instanceof ICPPASTUsingDeclaration) { usingDecls.add((ICPPASTUsingDeclaration) aktDecl); } @@ -193,33 +195,10 @@ public class ASTHelper { return usingDecls; } - public static boolean isClassDefinitionName(IASTName name) { - try { - if(!(name.getParent().getParent().getParent() instanceof IASTFunctionDefinition)) { - return false; - } - ICPPASTQualifiedName qName = (ICPPASTQualifiedName) name.getParent(); - IASTName secondLastName = qName.getNames()[qName.getNames().length-2]; - if(!(name.equals(secondLastName))) { - return false; - } - IBinding binding = name.resolveBinding(); - for(IASTName aktName : name.getTranslationUnit().getDeclarationsInAST(binding)) { - if(!isClassDeclarationName(aktName)) { - return false; - } - } - - } catch (NullPointerException e) { - return false; - } - return true; - } - public static IASTCompositeTypeSpecifier getCompositeTypeSpecifierForName(IASTName name) { IBinding binding = name.resolveBinding(); - for(IASTName aktName : name.getTranslationUnit().getDefinitionsInAST(binding)) { - if(aktName.getParent() instanceof IASTCompositeTypeSpecifier) { + for (IASTName aktName : name.getTranslationUnit().getDefinitionsInAST(binding)) { + if (aktName.getParent() instanceof IASTCompositeTypeSpecifier) { return (IASTCompositeTypeSpecifier) aktName.getParent(); } } @@ -228,10 +207,10 @@ public class ASTHelper { public static Collection getFunctionDeclaratorsForClass(IASTCompositeTypeSpecifier klass) { Collection declarators = new ArrayList(); - for(IASTDeclaration aktDeclaration : klass.getMembers()) { - if(aktDeclaration instanceof IASTSimpleDeclaration) { - for(IASTDeclarator aktDeclarator : ((IASTSimpleDeclaration) aktDeclaration).getDeclarators()) { - if(aktDeclarator instanceof IASTFunctionDeclarator) { + for (IASTDeclaration aktDeclaration : klass.getMembers()) { + if (aktDeclaration instanceof IASTSimpleDeclaration) { + for (IASTDeclarator aktDeclarator : ((IASTSimpleDeclaration) aktDeclaration).getDeclarators()) { + if (aktDeclarator instanceof IASTFunctionDeclarator) { declarators.add((IASTFunctionDeclarator) aktDeclarator); } } @@ -239,13 +218,13 @@ public class ASTHelper { } return declarators; } - + public static Collection getFunctionDefinitionsForClass(IASTCompositeTypeSpecifier klass) { Collection definitions = new ArrayList(); - for(IASTFunctionDeclarator aktDeclarator : getFunctionDeclaratorsForClass(klass)) { + for (IASTFunctionDeclarator aktDeclarator : getFunctionDeclaratorsForClass(klass)) { IBinding binding = aktDeclarator.getName().resolveBinding(); - for(IASTName aktName : aktDeclarator.getTranslationUnit().getDefinitionsInAST(binding)) { - if(aktName.getParent().getParent().getParent() instanceof IASTFunctionDefinition) { + for (IASTName aktName : aktDeclarator.getTranslationUnit().getDefinitionsInAST(binding)) { + if (aktName.getParent().getParent().getParent() instanceof IASTFunctionDefinition) { definitions.add((IASTFunctionDefinition) aktName.getParent().getParent().getParent()); } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesLabelProvider.java index 6490e002a38..e58396c5d7c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/BaseClassesLabelProvider.java @@ -10,15 +10,14 @@ *******************************************************************************/ package org.eclipse.cdt.internal.ui.wizards.classwizard; -import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; -import org.eclipse.cdt.ui.browser.typeinfo.TypeInfoLabelProvider; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.swt.graphics.Image; +import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility; +import org.eclipse.cdt.ui.browser.typeinfo.TypeInfoLabelProvider; public final class BaseClassesLabelProvider implements ITableLabelProvider { - private static final String YES_VALUE = NewClassWizardMessages.BaseClassesLabelProvider_boolean_yes_label; private static final String NO_VALUE = NewClassWizardMessages.BaseClassesLabelProvider_boolean_no_label; private static final String ACCESS_PUBLIC = NewClassWizardMessages.BaseClassesLabelProvider_access_public_label; @@ -34,7 +33,7 @@ public final class BaseClassesLabelProvider implements ITableLabelProvider { return ACCESS_PRIVATE; if (access == ASTAccessVisibility.PROTECTED) return ACCESS_PROTECTED; - return ACCESS_PUBLIC; + return ACCESS_PUBLIC; } private static TypeInfoLabelProvider fTypeInfoLabelProvider = new TypeInfoLabelProvider(TypeInfoLabelProvider.SHOW_FULLY_QUALIFIED); @@ -59,42 +58,30 @@ public final class BaseClassesLabelProvider implements ITableLabelProvider { IBaseClassInfo info = (IBaseClassInfo) element; switch (columnIndex) { - case 0: - return fTypeInfoLabelProvider.getText(info.getType()); - case 1: - return getAccessText(info.getAccess()); - case 2: - return getYesNoText(info.isVirtual()); - default: - return null; + case 0: + return fTypeInfoLabelProvider.getText(info.getType()); + case 1: + return getAccessText(info.getAccess()); + case 2: + return getYesNoText(info.isVirtual()); + default: + return null; } } - /* - * @see IBaseLabelProvider#addListener(ILabelProviderListener) - */ @Override public void addListener(ILabelProviderListener listener) { } - /* - * @see IBaseLabelProvider#dispose() - */ @Override public void dispose() { } - /* - * @see IBaseLabelProvider#isLabelProperty(Object, String) - */ @Override public boolean isLabelProperty(Object element, String property) { return false; } - /* - * @see IBaseLabelProvider#removeListener(ILabelProviderListener) - */ @Override public void removeListener(ILabelProviderListener listener) { } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java index dca05979335..5f6d13d47ca 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/MethodStubsListDialogField.java @@ -33,7 +33,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.IListAdapter; import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField; public class MethodStubsListDialogField extends CheckedListDialogField { - // column properties private static final String CP_NAME = "name"; //$NON-NLS-1$ private static final String CP_ACCESS = "access"; //$NON-NLS-1$ @@ -154,7 +153,7 @@ public class MethodStubsListDialogField extends CheckedListDialogField extends ListDialogField { Assert.isTrue(uncheckButtonIndex < fButtonLabels.length); fUncheckAllButtonIndex= uncheckButtonIndex; } - - /* - * @see ListDialogField#createTableViewer - */ @Override protected TableViewer createTableViewer(Composite parent) { Table table= new Table(parent, SWT.CHECK + getListStyle()); @@ -81,11 +77,7 @@ public class CheckedListDialogField extends ListDialogField { }); return tableViewer; } - - - /* - * @see ListDialogField#getListControl - */ + @Override public Control getListControl(Composite parent) { Control control= super.getListControl(parent); @@ -110,7 +102,7 @@ public class CheckedListDialogField extends ListDialogField { } private void checkStateChanged() { - //call super and do not update check model + // Call super and do not update check model super.dialogFieldChanged(); } @@ -166,7 +158,7 @@ public class CheckedListDialogField extends ListDialogField { fCheckElements.remove(object); } if (fTable != null) { - ((CheckboxTableViewer)fTable).setChecked(object, state); + ((CheckboxTableViewer) fTable).setChecked(object, state); } } @@ -196,9 +188,6 @@ public class CheckedListDialogField extends ListDialogField { checkStateChanged(); } - /* (non-Javadoc) - * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField#replaceElement(java.lang.Object, java.lang.Object) - */ @Override public void replaceElement(T oldElement, T newElement) throws IllegalArgumentException { boolean wasChecked= isChecked(oldElement);