private FieldInfo(ParameterInfo parameterInfo, IField ifield) { super(); this.pi= parameterInfo; this.ifield= ifield; this.name= ifield.getElementName(); } }
private static IField getBundleNameField(IField[] fields) { for (int i= 0; i < fields.length; i++) { if ("BUNDLE_NAME".equals(fields[i].getElementName())) //$NON-NLS-1$ return fields[i]; } return null; }
private static IField getBundleNameField(IField[] fields) { for (int i= 0; i < fields.length; i++) { if ("BUNDLE_NAME".equals(fields[i].getElementName())) //$NON-NLS-1$ return fields[i]; } return null; }
private static IField getBundleNameField(IField[] fields) { for (int i= 0; i < fields.length; i++) { if ("BUNDLE_NAME".equals(fields[i].getElementName())) //$NON-NLS-1$ return fields[i]; } return null; }
private void initialize(IField field) { fField= field; if (fField != null) { setNewElementName(fField.getElementName()); } fUpdateReferences= true; fUpdateTextualMatches= false; fRenameGetter= false; fRenameSetter= false; }
private String getMappingErrorMessage() { return Messages.format( RefactoringCoreMessages.SelfEncapsulateField_cannot_analyze_selected_field, new String[] {fField.getElementName()}); }
protected String getKey(IField field, boolean forceOpen) throws JavaModelException { StringBuffer key = new StringBuffer(); // declaring class String declaringKey = getKey((IType) field.getParent(), forceOpen); key.append(declaringKey); // field name key.append('.'); key.append(field.getElementName()); return key.toString(); }
protected String getKey(IField field, boolean forceOpen) throws JavaModelException { StringBuffer key = new StringBuffer(); // declaring class String declaringKey = getKey((IType) field.getParent(), forceOpen); key.append(declaringKey); // field name key.append('.'); key.append(field.getElementName()); return key.toString(); }
private void checkArgName() { String fieldName = fField.getElementName(); boolean isStatic = true; try { isStatic = JdtFlags.isStatic(fField); } catch (JavaModelException e) { JavaLanguageServerPlugin.log(e); } if ((isStatic && fArgName.equals(fieldName) && fieldName.equals(fField.getDeclaringType().getElementName())) || JavaConventionsUtil.validateIdentifier(fArgName, fField).getSeverity() == IStatus.ERROR) { fArgName = "_" + fArgName; //$NON-NLS-1$ } }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
private FieldDeclaration convert(IField field, IType type) throws JavaModelException { TypeReference typeReference = createTypeReference(field.getTypeSignature()); if (typeReference == null) return null; FieldDeclaration fieldDeclaration = new FieldDeclaration(); fieldDeclaration.name = field.getElementName().toCharArray(); fieldDeclaration.type = typeReference; fieldDeclaration.modifiers = field.getFlags(); return fieldDeclaration; }
@JavaSelectionSubscriber(METHOD_BODY) public Status onFieldSelection(final IField var, final JavaSelectionEvent event, final Composite parent) throws JavaModelException { return handle(var, var.getElementName(), var.getTypeSignature(), event, parent); }
private static void checkFieldInType(IType destinationType, RefactoringStatus result, IField field) throws JavaModelException { IField destinationTypeField= destinationType.getField(field.getElementName()); if (! destinationTypeField.exists()) return; String message= Messages.format(RefactoringCoreMessages.MemberCheckUtil_field_exists, new String[]{field.getElementName(), JavaModelUtil.getFullyQualifiedName(destinationType)}); RefactoringStatusContext context= JavaStatusContext.create(destinationType.getCompilationUnit(), destinationTypeField.getSourceRange()); result.addError(message, context); }
public static String getSetterName(IField field, String[] excludedNames) throws JavaModelException { if (excludedNames == null) { excludedNames= EMPTY; } return getSetterName(field.getJavaProject(), field.getElementName(), field.getFlags(), JavaModelUtil.isBoolean(field), excludedNames); }
private static void checkFieldInType(IType destinationType, RefactoringStatus result, IField field) throws JavaModelException { IField destinationTypeField= destinationType.getField(field.getElementName()); if (! destinationTypeField.exists()) return; String message= Messages.format(RefactoringCoreMessages.MemberCheckUtil_field_exists, new String[]{ BasicElementLabels.getJavaElementName(field.getElementName()), getQualifiedLabel(destinationType)}); RefactoringStatusContext context= JavaStatusContext.create(destinationType.getCompilationUnit(), destinationTypeField.getSourceRange()); result.addError(message, context); }
private boolean processCompilerError(RefactoringStatus result, ASTNode node) { Message[] messages= ASTNodes.getMessages(node, ASTNodes.INCLUDE_ALL_PARENTS); if (messages.length == 0) return false; result.addFatalError(Messages.format( RefactoringCoreMessages.SelfEncapsulateField_compiler_errors_field, new String[] { BasicElementLabels.getJavaElementName(fField.getElementName()), messages[0].getMessage()})); return true; }
private boolean processCompilerError(RefactoringStatus result, ASTNode node) { Message[] messages = ASTNodes.getMessages(node, ASTNodes.INCLUDE_ALL_PARENTS); if (messages.length == 0) { return false; } result.addFatalError(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_compiler_errors_field, new String[] { BasicElementLabels.getJavaElementName(fField.getElementName()), messages[0].getMessage() })); return true; }
private boolean processCompilerError(RefactoringStatus result, ASTNode node) { Message[] messages= ASTNodes.getMessages(node, ASTNodes.INCLUDE_ALL_PARENTS); if (messages.length == 0) return false; result.addFatalError(Messages.format( RefactoringCoreMessages.SelfEncapsulateField_compiler_errors_field, new String[] { BasicElementLabels.getJavaElementName(fField.getElementName()), messages[0].getMessage()})); return true; }
private void initialize(IField field) throws JavaModelException { fGetterName= GetterSetterUtil.getGetterName(field, null); fSetterName= GetterSetterUtil.getSetterName(field, null); fArgName= NamingConventions.removePrefixAndSuffixForFieldName(field.getJavaProject(), field.getElementName(), field.getFlags()); checkArgName(); }