Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 434269 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java (-17 / +17 lines)
Lines 620-647 Link Here
620
			String name= member.getElementName();
620
			String name= member.getElementName();
621
			boolean isGetter= name.startsWith("get"); //$NON-NLS-1$
621
			boolean isGetter= name.startsWith("get"); //$NON-NLS-1$
622
			boolean isSetter= name.startsWith("set"); //$NON-NLS-1$
622
			boolean isSetter= name.startsWith("set"); //$NON-NLS-1$
623
			boolean isProperty= name.endsWith("Property"); //$NON-NLS-1$
623
			
624
			if (isGetter || isSetter || isProperty) {
624
			if( isGetter || isSetter ) {
625
				String propertyName= null;
625
				String propertyName= firstToLower(name.substring(3));
626
				if (isGetter || isSetter) {
626
				IType type= member.getDeclaringType();
627
					propertyName= firstToLower(name.substring(3));
627
				String content = getHTMLContentFromSource(type.getMethod(propertyName+"Property",new String[0])); //$NON-NLS-1$
628
				} else {
628
				
629
					propertyName= name.substring(0, name.length() - 8);
629
				if (content != null) {
630
					if (isGetter) {
631
						content= Messages.format(JavaDocMessages.JavadocContentAccess2_getproperty_message, new Object[] { propertyName, content });
632
					} else {
633
						content= Messages.format(JavaDocMessages.JavadocContentAccess2_setproperty_message, new Object[] { propertyName, content });
634
					}
630
				}
635
				}
636
				return content;
637
			} else if( name.endsWith("Property") ) { //$NON-NLS-1$
638
				String propertyName= name.substring(0, name.length() - 8);
631
639
632
				IType type= member.getDeclaringType();
640
				IType type= member.getDeclaringType();
633
				IField field= type.getField(propertyName);
641
				IField field= type.getField(propertyName);
634
				if (field.exists()) {
642
				if (field.exists()) {
635
					String content= getHTMLContentFromSource(field);
643
					return getHTMLContentFromSource(field);
636
					if (content != null) {
644
				}	 
637
						if (isGetter) {
638
							content= Messages.format(JavaDocMessages.JavadocContentAccess2_getproperty_message, new Object[] { propertyName, content });
639
						} else if (isSetter) {
640
							content= Messages.format(JavaDocMessages.JavadocContentAccess2_setproperty_message, new Object[] { propertyName, content });
641
						}
642
					}
643
					return content;
644
				}
645
			}
645
			}
646
		}
646
		}
647
		return null;
647
		return null;

Return to bug 434269