@Override public void updateNode() throws CoreException { if (canChangeNameAndReturnType()) changeMethodName(); }
@Override public void updateNode() throws CoreException { if (canChangeNameAndReturnType()) changeMethodName(); }
private void createNameControl(Composite parent) { Composite name= new Composite(parent, SWT.NONE); name.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; name.setLayout(layout); Label label= new Label(name, SWT.NONE); label.setText(RefactoringMessages.ChangeSignatureInputPage_method_name); final Text text= new Text(name, SWT.BORDER); text.setText(getChangeMethodSignatureProcessor().getMethodName()); text.setLayoutData((new GridData(GridData.FILL_HORIZONTAL))); TextFieldNavigationHandler.install(text); if (getChangeMethodSignatureProcessor().canChangeNameAndReturnType()) { text.addModifyListener(new ModifyListener(){ @Override public void modifyText(ModifyEvent e) { getChangeMethodSignatureProcessor().setNewMethodName(text.getText()); update(true); } }); } else { text.setEnabled(false); } }
private void createNameControl(Composite parent) { Composite name= new Composite(parent, SWT.NONE); name.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; name.setLayout(layout); Label label= new Label(name, SWT.NONE); label.setText(RefactoringMessages.ChangeSignatureInputPage_method_name); final Text text= new Text(name, SWT.BORDER); text.setText(getChangeMethodSignatureProcessor().getMethodName()); text.setLayoutData((new GridData(GridData.FILL_HORIZONTAL))); TextFieldNavigationHandler.install(text); if (getChangeMethodSignatureProcessor().canChangeNameAndReturnType()) { text.addModifyListener(new ModifyListener(){ @Override public void modifyText(ModifyEvent e) { getChangeMethodSignatureProcessor().setNewMethodName(text.getText()); update(true); } }); } else { text.setEnabled(false); } }
@Override public void updateNode() { if (fNode instanceof MethodRef) { changeParamguments(); reshuffleElements(); } if (canChangeNameAndReturnType()) changeMethodName(); }
@Override public void updateNode() { if (fNode instanceof MethodRef) { changeParamguments(); reshuffleElements(); } if (canChangeNameAndReturnType()) changeMethodName(); }
private void checkMethodName(RefactoringStatus result) { if (isMethodNameSameAsInitial() || ! canChangeNameAndReturnType()) return; if ("".equals(fMethodName.trim())) { //$NON-NLS-1$ String msg= RefactoringCoreMessages.ChangeSignatureRefactoring_method_name_not_empty; result.addFatalError(msg); return; } if (fMethodName.equals(fMethod.getDeclaringType().getElementName())) { String msg= RefactoringCoreMessages.ChangeSignatureRefactoring_constructor_name; result.addWarning(msg); } result.merge(Checks.checkMethodName(fMethodName, fMethod)); }
private void checkMethodName(RefactoringStatus result) { if (isMethodNameSameAsInitial() || ! canChangeNameAndReturnType()) return; if ("".equals(fMethodName.trim())) { //$NON-NLS-1$ String msg= RefactoringCoreMessages.ChangeSignatureRefactoring_method_name_not_empty; result.addFatalError(msg); return; } if (fMethodName.equals(fMethod.getDeclaringType().getElementName())) { String msg= RefactoringCoreMessages.ChangeSignatureRefactoring_constructor_name; result.addWarning(msg); } result.merge(Checks.checkMethodName(fMethodName, fMethod)); }
private void createReturnTypeControl(Composite parent) { Composite returnType= new Composite(parent, SWT.NONE); returnType.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; returnType.setLayout(layout); Label label= new Label(returnType, SWT.NONE); label.setText(RefactoringMessages.ChangeSignatureInputPage_return_type); final Text text= new Text(returnType, SWT.BORDER); text.setText(getChangeMethodSignatureProcessor().getReturnTypeString()); text.setLayoutData((new GridData(GridData.FILL_HORIZONTAL))); TextFieldNavigationHandler.install(text); if (getChangeMethodSignatureProcessor().canChangeNameAndReturnType()) { text.addModifyListener(new ModifyListener(){ @Override public void modifyText(ModifyEvent e) { getChangeMethodSignatureProcessor().setNewReturnTypeName(text.getText()); update(true); } }); } else { text.setEnabled(false); } JavaTypeCompletionProcessor processor= new JavaTypeCompletionProcessor(true, true); StubTypeContext stubTypeContext= getChangeMethodSignatureProcessor().getStubTypeContext(); processor.setCompletionContext(stubTypeContext.getCuHandle(), stubTypeContext.getBeforeString(), stubTypeContext.getAfterString()); ControlContentAssistHelper.createTextContentAssistant(text, processor); }
private void createReturnTypeControl(Composite parent) { Composite returnType= new Composite(parent, SWT.NONE); returnType.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout= new GridLayout(1, false); layout.marginHeight= 0; layout.marginWidth= 0; returnType.setLayout(layout); Label label= new Label(returnType, SWT.NONE); label.setText(RefactoringMessages.ChangeSignatureInputPage_return_type); final Text text= new Text(returnType, SWT.BORDER); text.setText(getChangeMethodSignatureProcessor().getReturnTypeString()); text.setLayoutData((new GridData(GridData.FILL_HORIZONTAL))); TextFieldNavigationHandler.install(text); if (getChangeMethodSignatureProcessor().canChangeNameAndReturnType()) { text.addModifyListener(new ModifyListener(){ @Override public void modifyText(ModifyEvent e) { getChangeMethodSignatureProcessor().setNewReturnTypeName(text.getText()); update(true); } }); } else { text.setEnabled(false); } JavaTypeCompletionProcessor processor= new JavaTypeCompletionProcessor(true, true); StubTypeContext stubTypeContext= getChangeMethodSignatureProcessor().getStubTypeContext(); processor.setCompletionContext(stubTypeContext.getCuHandle(), stubTypeContext.getBeforeString(), stubTypeContext.getAfterString()); ControlContentAssistHelper.createTextContentAssistant(text, processor); }
@Override public void updateNode() throws CoreException { changeParamguments(); if (canChangeNameAndReturnType()) { changeMethodName(); changeReturnType(); } if (needsVisibilityUpdate()) changeVisibility(); reshuffleElements(); changeExceptions(); changeJavadocTags(); if (fBodyUpdater == null || fBodyUpdater.needsParameterUsedCheck()) checkIfDeletedParametersUsed(); if (fBodyUpdater != null) fBodyUpdater.updateBody(fMethDecl, fCuRewrite, fResult); if (fDelegateUpdating) addDelegate(); }
@Override public void updateNode() throws CoreException { changeParamguments(); if (canChangeNameAndReturnType()) { changeMethodName(); changeReturnType(); } if (needsVisibilityUpdate()) changeVisibility(); reshuffleElements(); changeExceptions(); changeJavadocTags(); if (fBodyUpdater == null || fBodyUpdater.needsParameterUsedCheck()) checkIfDeletedParametersUsed(); if (fBodyUpdater != null) fBodyUpdater.updateBody(fMethDecl, fCuRewrite, fResult); if (fDelegateUpdating) addDelegate(); }