View | Details | Raw Unified | Return to bug 373582 | Differences between
and this patch

Collapse All | Expand All

(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/MappingTools.java (+84 lines)
Lines 9-24 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.jpt.jpa.core.internal.context;
10
package org.eclipse.jpt.jpa.core.internal.context;
11
11
12
import java.util.ArrayList;
13
import java.util.Collection;
14
import java.util.List;
15
import java.util.Map;
16
import java.util.Set;
12
import org.eclipse.core.resources.IResource;
17
import org.eclipse.core.resources.IResource;
18
import org.eclipse.jdt.core.ICompilationUnit;
19
import org.eclipse.jdt.core.IJavaElement;
13
import org.eclipse.jdt.core.IJavaProject;
20
import org.eclipse.jdt.core.IJavaProject;
21
import org.eclipse.jdt.core.IPackageFragment;
22
import org.eclipse.jdt.core.IPackageFragmentRoot;
14
import org.eclipse.jdt.core.IType;
23
import org.eclipse.jdt.core.IType;
24
import org.eclipse.jdt.core.JavaModelException;
15
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
25
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
16
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
26
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
17
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
27
import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
18
import org.eclipse.jpt.common.utility.internal.ArrayTools;
28
import org.eclipse.jpt.common.utility.internal.ArrayTools;
19
import org.eclipse.jpt.common.utility.internal.ClassName;
29
import org.eclipse.jpt.common.utility.internal.ClassName;
30
import org.eclipse.jpt.common.utility.internal.CollectionTools;
20
import org.eclipse.jpt.common.utility.internal.ReflectionTools;
31
import org.eclipse.jpt.common.utility.internal.ReflectionTools;
21
import org.eclipse.jpt.common.utility.internal.Transformer;
32
import org.eclipse.jpt.common.utility.internal.Transformer;
33
import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
22
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
34
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
23
import org.eclipse.jpt.jpa.core.context.Column;
35
import org.eclipse.jpt.jpa.core.context.Column;
24
import org.eclipse.jpt.jpa.core.context.ColumnMapping;
36
import org.eclipse.jpt.jpa.core.context.ColumnMapping;
Lines 35-40 Link Here
35
import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
47
import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
36
import org.eclipse.jpt.jpa.core.context.TypeMapping;
48
import org.eclipse.jpt.jpa.core.context.TypeMapping;
37
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
49
import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
50
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
38
import org.eclipse.jpt.jpa.core.jpa2.context.AttributeMapping2_0;
51
import org.eclipse.jpt.jpa.core.jpa2.context.AttributeMapping2_0;
39
import org.eclipse.jpt.jpa.core.jpa2.context.CollectionMapping2_0;
52
import org.eclipse.jpt.jpa.core.jpa2.context.CollectionMapping2_0;
40
import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
53
import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
Lines 486-491 Link Here
486
				(resourceNode instanceof SourceNode);
499
				(resourceNode instanceof SourceNode);
487
	}
500
	}
488
501
502
	/**
503
	 * Returns sorted names of types of the given project
504
	 */
505
	public static Iterable<String> getSortedJavaTypeNames(IJavaProject javaProject) {
506
		return CollectionTools.sort(getJavaTypeNames(javaProject));
507
	}
508
	
509
	/**
510
	 * Returns the names of types of the given project
511
	 */
512
	public static Iterable<String> getJavaTypeNames(IJavaProject javaProject) {
513
		return new TransformationIterable<IType, String>(getJavaTypes(javaProject)) {
514
			@Override
515
			protected String transform(IType type) {
516
				return type.getFullyQualifiedName();
517
			}
518
		};
519
	}
520
	
521
	/**
522
	 * Returns all the types cross the given project
523
	 */
524
	public static Iterable<IType> getJavaTypes(IJavaProject javaProject) {
525
		List<IType> typesList = new ArrayList<IType>();
526
		try {
527
			IPackageFragmentRoot[] pkgRoots = javaProject.getAllPackageFragmentRoots();
528
			for (IPackageFragmentRoot root : pkgRoots) {
529
					IJavaElement[] jElements = root.getChildren();
530
					for (IJavaElement jElement : jElements) {
531
						if (jElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
532
							ICompilationUnit[] units = ((IPackageFragment) jElement).getCompilationUnits();
533
							for (ICompilationUnit unit : units) {
534
								CollectionTools.addAll(typesList, unit.getTypes());
535
							}
536
						}
537
					}
538
			}
539
		} catch (JavaModelException e) {
540
			JptJpaCorePlugin.instance().logError(e);
541
		}
542
		return typesList;
543
	}
544
	
545
	/**
546
	 * Returns the names of primitives
547
	 */
548
	public static Iterable<String> getPrimitiveClassNames() {
549
		List<String> names = new ArrayList<String>();
550
		names.add(boolean.class.getName());
551
		names.add(byte.class.getName());
552
		names.add(char.class.getName());
553
		names.add(double.class.getName());
554
		names.add(float.class.getName());
555
		names.add(int.class.getName());
556
		names.add(long.class.getName());
557
		names.add(short.class.getName());
558
		names.add(String.class.getSimpleName());
559
		return names;
560
	}
561
	
562
	/**
563
	 * Returns the names of collection types
564
	 */
565
	public static Iterable<String> getCollectionTypeNames() {
566
		List<String> names = new ArrayList<String>();
567
		names.add(Collection.class.getName());
568
		names.add(List.class.getName());
569
		names.add(Map.class.getName());
570
		names.add(Set.class.getName());
571
		return names;
572
	}
489
573
490
	// ********** constructor **********
574
	// ********** constructor **********
491
575
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java (-1 / +1 lines)
Lines 1217-1223 Link Here
1217
				return result;
1217
				return result;
1218
			}
1218
			}
1219
		}
1219
		}
1220
		return EmptyIterable.instance();
1220
		return null;
1221
	}
1221
	}
1222
1222
1223
	@Override
1223
	@Override
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java (+4 lines)
Lines 1994-1999 Link Here
1994
		if (result != null) {
1994
		if (result != null) {
1995
			return result;
1995
			return result;
1996
		}
1996
		}
1997
		result = this.idClassReference.getXmlCompletionProposals(pos);
1998
		if (result != null) {
1999
			return result;
2000
		}
1997
		return null;
2001
		return null;
1998
	}
2002
	}
1999
2003
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMappedSuperclass.java (+15 lines)
Lines 219-222 Link Here
219
	protected PrimaryKeyTextRangeResolver buildTextRangeResolver() {
219
	protected PrimaryKeyTextRangeResolver buildTextRangeResolver() {
220
		return new OrmMappedSuperclassTextRangeResolver(this);
220
		return new OrmMappedSuperclassTextRangeResolver(this);
221
	}
221
	}
222
223
	// ********** completion proposals **********
224
225
	@Override
226
	public Iterable<String> getXmlCompletionProposals(int pos) {
227
		Iterable<String> result = super.getXmlCompletionProposals(pos);
228
		if (result != null) {
229
			return result;
230
		}
231
		result = this.idClassReference.getXmlCompletionProposals(pos);
232
		if (result != null) {
233
			return result;
234
		}
235
		return null;
236
	}
222
}
237
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java (-1 / +16 lines)
Lines 867-872 Link Here
867
		return this.getTargetEntityNonTransientAttributeNames();
867
		return this.getTargetEntityNonTransientAttributeNames();
868
	}
868
	}
869
869
870
	@SuppressWarnings("unchecked")
871
	protected Iterable<String> getCandidateMapKeyClassNames() {
872
		return new CompositeIterable<String>(
873
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
874
				MappingTools.getPrimitiveClassNames()
875
				);
876
	}
870
877
871
	// ********** metamodel **********
878
	// ********** metamodel **********
872
879
Lines 1085-1090 Link Here
1085
		if (this.mapKeyNameTouches(pos)) {
1092
		if (this.mapKeyNameTouches(pos)) {
1086
			return this.getCandidateMapKeyNames();
1093
			return this.getCandidateMapKeyNames();
1087
		}
1094
		}
1095
		if (this.mapKeyClassTouches(pos)) {
1096
			return this.getCandidateMapKeyClassNames();
1097
		}
1088
		result = this.mapKeyColumn.getXmlCompletionProposals(pos);
1098
		result = this.mapKeyColumn.getXmlCompletionProposals(pos);
1089
		if (result != null) {
1099
		if (result != null) {
1090
			return result;
1100
			return result;
Lines 1107-1113 Link Here
1107
	}
1117
	}
1108
1118
1109
	protected boolean mapKeyNameTouches(int pos) {
1119
	protected boolean mapKeyNameTouches(int pos) {
1110
		return this.xmlAttributeMapping.mapKeyNameTouches(pos);
1120
		return this.getXmlMapKey() == null? false : this.getXmlMapKey().mapKeyNameTouches(pos);
1121
	}
1122
1123
	protected boolean mapKeyClassTouches(int pos) {
1124
		return this.xmlAttributeMapping.getMapKeyClass() == null ? false : 
1125
					this.xmlAttributeMapping.getMapKeyClass().classNameTouches(pos);
1111
	}
1126
	}
1112
1127
1113
	// ********** abstract owner **********
1128
	// ********** abstract owner **********
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmRelationshipMapping.java (+12 lines)
Lines 32-37 Link Here
32
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
32
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
33
import org.eclipse.jpt.jpa.core.context.orm.OrmRelationshipMapping;
33
import org.eclipse.jpt.jpa.core.context.orm.OrmRelationshipMapping;
34
import org.eclipse.jpt.jpa.core.internal.context.AttributeMappingTools;
34
import org.eclipse.jpt.jpa.core.internal.context.AttributeMappingTools;
35
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
35
import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmCascade;
36
import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmCascade;
36
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
37
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
37
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
38
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
Lines 455-460 Link Here
455
		if (result != null) {
456
		if (result != null) {
456
			return result;
457
			return result;
457
		}
458
		}
459
		if (this.targetEntityTouches(pos)) {
460
			return this.getCandidateTargetEntityClassNames();
461
		}
458
		return null;
462
		return null;
459
	}
463
	}
464
465
	protected boolean targetEntityTouches(int pos) {
466
		return this.xmlAttributeMapping.targetEntityTouches(pos);
467
	}
468
	
469
	protected Iterable<String> getCandidateTargetEntityClassNames() {
470
		return MappingTools.getSortedJavaTypeNames(getJavaProject());
471
	}
460
}
472
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java (-35 / +4 lines)
Lines 39-44 Link Here
39
import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
39
import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
40
import org.eclipse.jpt.jpa.core.internal.context.AttributeMappingTools;
40
import org.eclipse.jpt.jpa.core.internal.context.AttributeMappingTools;
41
import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
41
import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
42
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
42
import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
43
import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
43
import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTools;
44
import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTools;
44
import org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericTypeMappingValidator;
45
import org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericTypeMappingValidator;
Lines 619-661 Link Here
619
		return null;
620
		return null;
620
	}
621
	}
621
622
622
	private Iterable<String> getCandidateClassNames() {
623
	protected Iterable<String> getCandidateClassNames() {
623
		final String packageName = this.getEntityMappings().getPackage();
624
		return MappingTools.getSortedJavaTypeNames(this.getJavaProject());
624
		if (!StringTools.stringIsEmpty(packageName)) {
625
			return new TransformationIterable<String, String>(this.getFilteredCandidateClassNames(packageName)) {
626
				@Override
627
				protected String transform(String className) {
628
					return className.substring(packageName.length()+1);
629
				}
630
			};
631
		}
632
		return this.getCandidateFullyQualifiedClassNames();
633
	}
634
	
635
	private Iterable<String> getFilteredCandidateClassNames(final String packageName) {
636
			return new FilteringIterable<String>(this.getCandidateFullyQualifiedClassNames()) {
637
				@Override
638
				protected boolean accept(String className) {
639
					return className.startsWith(packageName);
640
				}
641
			};
642
	}
625
	}
643
626
644
	/**
627
	protected boolean classNameTouches(int pos) {
645
	 * @return names of the classes specified by class refs and jar files
646
	 */
647
	// should return names of all the classes defined in the project?
648
	private Iterable<String> getCandidateFullyQualifiedClassNames() {
649
		return new TransformationIterable<PersistentType, String>(
650
				this.getPersistenceUnit().getJavaPersistentTypes()) {
651
			@Override
652
			protected String transform(PersistentType pType) {
653
				return pType.getName();
654
			}
655
		};
656
	}
657
658
	private boolean classNameTouches(int pos) {
659
		return this.getXmlTypeMapping().classNameTouches(pos);
628
		return this.getXmlTypeMapping().classNameTouches(pos);
660
	}
629
	}
661
}
630
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/GenericOrmIdClassReference.java (+23 lines)
Lines 27-32 Link Here
27
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
27
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
28
import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
28
import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
29
import org.eclipse.jpt.jpa.core.internal.context.AbstractXmlContextNode;
29
import org.eclipse.jpt.jpa.core.internal.context.AbstractXmlContextNode;
30
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
30
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
31
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
31
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
32
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
32
import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
33
import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
Lines 444-447 Link Here
444
		XmlClassReference xmlIdClassRef = this.getXmlIdClassRef();
445
		XmlClassReference xmlIdClassRef = this.getXmlIdClassRef();
445
		return (xmlIdClassRef == null) ? null : xmlIdClassRef.getClassNameTextRange();
446
		return (xmlIdClassRef == null) ? null : xmlIdClassRef.getClassNameTextRange();
446
	}
447
	}
448
449
	// ********** completion proposals **********
450
451
	@Override
452
	public Iterable<String> getXmlCompletionProposals(int pos) {
453
		Iterable<String> result = super.getXmlCompletionProposals(pos);
454
		if (result != null) {
455
			return result;
456
		}
457
		if (this.idCLassNameTouches(pos)) {
458
			return this.getCandidateIdClassNames();
459
		}
460
		return null;
461
	}
462
	
463
	protected Iterable<String> getCandidateIdClassNames() {
464
		return MappingTools.getSortedJavaTypeNames(this.getJavaProject());
465
	}
466
467
	protected boolean idCLassNameTouches(int pos) {
468
		return this.getXmlIdClassRef() == null ? false : this.getXmlIdClassRef().classNameTouches(pos);
469
	}
447
}
470
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java (-2 / +25 lines)
Lines 1775-1780 Link Here
1775
		if (result != null) {
1775
		if (result != null) {
1776
			return result;
1776
			return result;
1777
		}
1777
		}
1778
		if (this.targetClassTouches(pos)) {
1779
			return this.getCandidateClassNames();
1780
		}
1781
		if (this.mapKeyClassTouches(pos)) {
1782
			return this.getCandidateClassNames();
1783
		}
1778
		if (this.mapKeyNameTouches(pos)) {
1784
		if (this.mapKeyNameTouches(pos)) {
1779
			return this.getCandidateMapKeyNames();
1785
			return this.getCandidateMapKeyNames();
1780
		}
1786
		}
Lines 1798-1806 Link Here
1798
		}
1804
		}
1799
		return null;
1805
		return null;
1800
	}
1806
	}
1801
	
1807
1808
	@SuppressWarnings("unchecked")
1809
	protected Iterable<String> getCandidateClassNames() {
1810
		return new CompositeIterable<String>(
1811
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
1812
				MappingTools.getPrimitiveClassNames()
1813
				);
1814
	}
1815
1816
	protected boolean targetClassTouches(int pos) {
1817
		return this.xmlAttributeMapping.targetClassTouches(pos);
1818
	}
1819
1820
	protected boolean mapKeyClassTouches(int pos) {
1821
		return this.xmlAttributeMapping.getMapKeyClass() == null ? false :
1822
			this.xmlAttributeMapping.getMapKeyClass().classNameTouches(pos);
1823
	}
1824
1802
	protected boolean mapKeyNameTouches(int pos) {
1825
	protected boolean mapKeyNameTouches(int pos) {
1803
		return this.xmlAttributeMapping.mapKeyNameTouches(pos);
1826
		return  this.getXmlMapKey() == null ? false : this.getXmlMapKey().mapKeyNameTouches(pos);
1804
	}
1827
	}
1805
1828
1806
	// ********** abstract owner **********
1829
	// ********** abstract owner **********
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/AbstractXmlMultiRelationshipMapping.java (-9 lines)
Lines 1130-1146 Link Here
1130
		return getAttributeCodeAssistTextRange(JPA.MAPPED_BY);
1130
		return getAttributeCodeAssistTextRange(JPA.MAPPED_BY);
1131
	}
1131
	}
1132
	
1132
	
1133
	public TextRange getMapKeyNameCodeAssistTextRange() {
1134
		return getAttributeCodeAssistTextRange(JPA.MAP_KEY);
1135
	}
1136
	
1137
	public boolean mappedByTouches(int pos) {
1133
	public boolean mappedByTouches(int pos) {
1138
		TextRange textRange = this.getMappedByCodeAssistTextRange();
1134
		TextRange textRange = this.getMappedByCodeAssistTextRange();
1139
		return (textRange!= null) && textRange.touches(pos);
1135
		return (textRange!= null) && textRange.touches(pos);
1140
	}
1141
	
1142
	public boolean mapKeyNameTouches(int pos) {
1143
		TextRange textRange = this.getMapKeyNameCodeAssistTextRange();
1144
		return (textRange != null) && textRange.touches(pos);
1145
	}
1136
	}
1146
}
1137
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/AbstractXmlRelationshipMapping.java (+10 lines)
Lines 406-409 Link Here
406
		return new ReplaceEdit(offset, packageLength, newPackageName);
406
		return new ReplaceEdit(offset, packageLength, newPackageName);
407
	}
407
	}
408
408
409
	// *********** content assist ************
410
	
411
	public TextRange getTargetEntityCodeAssistTextRange() {
412
		return getAttributeCodeAssistTextRange(JPA.TARGET_ENTITY);
413
	}
414
415
	public boolean targetEntityTouches(int pos) {
416
		TextRange textRange = this.getTargetEntityCodeAssistTextRange();
417
		return (textRange != null) && (textRange.touches(pos));
418
	}
409
} // RelationshipMapping
419
} // RelationshipMapping
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/MapKey.java (+11 lines)
Lines 14-19 Link Here
14
import org.eclipse.emf.ecore.EStructuralFeature;
14
import org.eclipse.emf.ecore.EStructuralFeature;
15
import org.eclipse.emf.ecore.impl.ENotificationImpl;
15
import org.eclipse.emf.ecore.impl.ENotificationImpl;
16
import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
16
import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
17
import org.eclipse.jpt.common.core.utility.TextRange;
17
import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
18
import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
18
import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
19
import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
19
import org.eclipse.wst.common.internal.emf.resource.Translator;
20
import org.eclipse.wst.common.internal.emf.resource.Translator;
Lines 218-221 Link Here
218
		return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getMapKey_Name(), Translator.DOM_ATTRIBUTE);
219
		return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getMapKey_Name(), Translator.DOM_ATTRIBUTE);
219
	}
220
	}
220
221
222
	// ********** content assist ***************
223
	
224
	public TextRange getMapKeyNameCodeAssistTextRange() {
225
		return getAttributeCodeAssistTextRange(JPA.NAME);
226
	}
227
	
228
	public boolean mapKeyNameTouches(int pos) {
229
		TextRange textRange = this.getMapKeyNameCodeAssistTextRange();
230
		return (textRange != null) && textRange.touches(pos);
231
	}
221
} // MapKey
232
} // MapKey
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlClassReference.java (+11 lines)
Lines 252-255 Link Here
252
		return new ReplaceEdit(offset, packageLength, newPackageName);
252
		return new ReplaceEdit(offset, packageLength, newPackageName);
253
	}
253
	}
254
254
255
	// ********** content assist ***************
256
	
257
	public TextRange getClassNameCodeAssistTextRange() {
258
		return getAttributeCodeAssistTextRange(JPA.CLASS);
259
	}
260
	
261
	public boolean classNameTouches(int pos) {
262
		TextRange textRange = this.getClassNameCodeAssistTextRange();
263
		return (textRange != null) && textRange.touches(pos);
264
	}
265
255
}
266
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlElementCollection.java (-6 / +5 lines)
Lines 1695-1707 Link Here
1695
1695
1696
	// ********** content assist ***************
1696
	// ********** content assist ***************
1697
	
1697
	
1698
	public TextRange getMapKeyNameCodeAssistTextRange() {
1698
	public TextRange getTargetClassCodeAssistTextRange() {
1699
		return getAttributeCodeAssistTextRange(JPA.MAP_KEY);
1699
		return getAttributeCodeAssistTextRange(JPA2_0.TARGET_CLASS);
1700
	}
1700
	}
1701
	
1701
	
1702
	public boolean mapKeyNameTouches(int pos) {
1702
	public boolean targetClassTouches(int pos) {
1703
		TextRange textRange = this.getMapKeyNameCodeAssistTextRange();
1703
		TextRange textRange = this.getTargetClassCodeAssistTextRange();
1704
		return (textRange != null) && textRange.touches(pos);
1704
		return (textRange != null) && (textRange.touches(pos));
1705
	}
1705
	}
1706
1707
}
1706
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java (+15 lines)
Lines 704-707 Link Here
704
		super.validate(messages, reporter);
704
		super.validate(messages, reporter);
705
		this.converterContainer.validate(messages, reporter);
705
		this.converterContainer.validate(messages, reporter);
706
	}
706
	}
707
708
	// ********** completion proposals **********
709
710
	@Override
711
	public Iterable<String> getXmlCompletionProposals(int pos) {
712
		Iterable<String> result = super.getXmlCompletionProposals(pos);
713
		if (result != null) {
714
			return result;
715
		}
716
		result = this.converterContainer.getXmlCompletionProposals(pos);
717
		if (result != null) {
718
			return result;
719
		}
720
		return null;
721
	}
707
}
722
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java (+34 lines)
Lines 14-29 Link Here
14
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.IType;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
16
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.core.utility.TextRange;
17
import org.eclipse.jpt.common.utility.internal.CollectionTools;
17
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
20
import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
20
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
21
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
22
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
21
import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0;
23
import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0;
22
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
24
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
23
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
25
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
24
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
26
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
25
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
27
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
26
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
28
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
29
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
27
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
30
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
28
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaPlatformFactory;
31
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaPlatformFactory;
29
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
32
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
Lines 200-203 Link Here
200
	protected TextRange getAttributeTypeTextRange() {
203
	protected TextRange getAttributeTypeTextRange() {
201
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
204
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
202
	}
205
	}
206
207
	// ********** completion proposals **********
208
209
	@Override
210
	public Iterable<String> getXmlCompletionProposals(int pos) {
211
		Iterable<String> result = super.getXmlCompletionProposals(pos);
212
		if (result != null) {
213
			return result;
214
		}
215
		if (this.attributeTypeTouches(pos)) {
216
			return this.getCandidateAttributeTypeNames();
217
		}
218
		return null;
219
	}
220
221
	protected boolean attributeTypeTouches(int pos) {
222
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
223
	}
224
	
225
	protected Iterable<String> getCandidateAttributeTypeNames() {
226
		return MappingTools.getCollectionTypeNames();
227
	}
228
	
229
	@Override
230
	@SuppressWarnings("unchecked")
231
	protected Iterable<String> getCandidateClassNames() {
232
		return new CompositeIterable<String>(
233
				super.getCandidateClassNames(),
234
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
235
				);
236
	}
203
}
237
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java (+30 lines)
Lines 12-17 Link Here
12
import java.util.List;
12
import java.util.List;
13
import org.eclipse.jdt.core.IPackageFragment;
13
import org.eclipse.jdt.core.IPackageFragment;
14
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.IType;
15
import org.eclipse.jpt.common.utility.internal.CollectionTools;
15
import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
16
import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
16
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
17
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
17
import org.eclipse.jpt.jpa.core.context.Converter;
18
import org.eclipse.jpt.jpa.core.context.Converter;
Lines 27-32 Link Here
27
import org.eclipse.jpt.jpa.core.context.orm.OrmTemporalConverter;
28
import org.eclipse.jpt.jpa.core.context.orm.OrmTemporalConverter;
28
import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
29
import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
29
import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
30
import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
31
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
30
import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
32
import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
31
import org.eclipse.jpt.jpa.core.internal.context.TableColumnTextRangeResolver;
33
import org.eclipse.jpt.jpa.core.internal.context.TableColumnTextRangeResolver;
32
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
34
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
Lines 41-46 Link Here
41
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
43
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
42
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
44
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
43
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
45
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
46
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
44
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray;
47
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray;
45
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3;
48
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3;
46
import org.eclipse.text.edits.ReplaceEdit;
49
import org.eclipse.text.edits.ReplaceEdit;
Lines 364-369 Link Here
364
		if (result != null) {
367
		if (result != null) {
365
			return result;
368
			return result;
366
		}
369
		}
370
		if (this.targetClassTouches(pos)) {
371
			return this.getCandidateTargetClassNames();
372
		}
373
		if (this.attributeTypeTouches(pos)) {
374
			return this.getcandidateAttributeTypeNames();
375
		}
367
		return null;
376
		return null;
368
	}
377
	}
378
	
379
	protected boolean attributeTypeTouches(int pos) {
380
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
381
	}
382
383
	protected boolean targetClassTouches(int pos) {
384
		return this.xmlAttributeMapping.targetClassTouches(pos);
385
	}
386
	
387
	@SuppressWarnings("unchecked")
388
	protected Iterable<String> getCandidateTargetClassNames() {
389
		return new CompositeIterable<String>(
390
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
391
				MappingTools.getPrimitiveClassNames(),
392
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
393
				);
394
	}
395
	
396
	protected Iterable<String> getcandidateAttributeTypeNames() {
397
		return MappingTools.getCollectionTypeNames();
398
	}
369
}
399
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java (+22 lines)
Lines 198-201 Link Here
198
	protected TextRange getAttributeTypeTextRange() {
198
	protected TextRange getAttributeTypeTextRange() {
199
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
199
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
200
	}
200
	}
201
	
202
	// ********** completion proposals **********
203
204
	@Override
205
	public Iterable<String> getXmlCompletionProposals(int pos) {
206
		Iterable<String> result = super.getXmlCompletionProposals(pos);
207
		if (result != null) {
208
			return result;
209
		}
210
		if (this.attributeTypeTouches(pos)) {
211
			return this.getCandidateAttributeTypeNames();
212
		}
213
		return null;
214
	}
215
	
216
	protected boolean attributeTypeTouches(int pos) {
217
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
218
	}
219
	
220
	protected Iterable<String> getCandidateAttributeTypeNames() {
221
		return MappingTools.getPrimitiveClassNames();
222
	}
201
}
223
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java (+23 lines)
Lines 621-624 Link Here
621
	public XmlContextNode getParent() {
621
	public XmlContextNode getParent() {
622
		return (XmlContextNode) super.getParent();
622
		return (XmlContextNode) super.getParent();
623
	}
623
	}
624
625
	// ********** completion proposals **********
626
627
	@Override
628
	public Iterable<String> getXmlCompletionProposals(int pos) {
629
		Iterable<String> result = super.getXmlCompletionProposals(pos);
630
		if (result != null) {
631
			return result;
632
		}
633
		for (OrmEclipseLinkCustomConverter converter : this.customConverterContainer.getContextElements()) {
634
			result = converter.getXmlCompletionProposals(pos);
635
			if (result != null) {
636
				return result;
637
			}
638
		}
639
		for (OrmEclipseLinkStructConverter converter : this.structConverterContainer.getContextElements()) {
640
			result = converter.getXmlCompletionProposals(pos);
641
			if (result != null) {
642
				return result;
643
			}
644
		}
645
		return null;
646
	}
624
}
647
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java (+23 lines)
Lines 12-17 Link Here
12
import org.eclipse.jdt.core.IType;
12
import org.eclipse.jdt.core.IType;
13
import org.eclipse.jpt.common.core.utility.TextRange;
13
import org.eclipse.jpt.common.core.utility.TextRange;
14
import org.eclipse.jpt.jpa.core.context.XmlContextNode;
14
import org.eclipse.jpt.jpa.core.context.XmlContextNode;
15
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
15
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
16
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
17
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
17
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
18
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
Lines 83-86 Link Here
83
		super.convertFrom(javaConverter);
84
		super.convertFrom(javaConverter);
84
		this.setConverterClass(javaConverter.getFullyQualifiedConverterClass());
85
		this.setConverterClass(javaConverter.getFullyQualifiedConverterClass());
85
	}
86
	}
87
88
	// ********** completion proposals **********
89
90
	@Override
91
	public Iterable<String> getXmlCompletionProposals(int pos) {
92
		Iterable<String> result = super.getXmlCompletionProposals(pos);
93
		if (result != null) {
94
			return result;
95
		}
96
		if (this.converterClassNameTouches(pos)) {
97
			return this.getCandidateClassNames();
98
		}
99
		return null;
100
	}
101
102
	protected Iterable<String> getCandidateClassNames() {
103
		return MappingTools.getSortedJavaTypeNames(this.getJavaProject());
104
	}
105
106
	protected boolean converterClassNameTouches(int pos) {
107
		return this.xmlConverter.converterClassTouches(pos);
108
	}
86
}
109
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java (+23 lines)
Lines 19-24 Link Here
19
import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
20
import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
20
import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
21
import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
21
import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
22
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
22
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
23
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
23
import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
24
import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
24
import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
25
import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
Lines 316-319 Link Here
316
		XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
317
		XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
317
		return (xmlClassRef == null) ? null : xmlClassRef.getClassNameTextRange();
318
		return (xmlClassRef == null) ? null : xmlClassRef.getClassNameTextRange();
318
	}
319
	}
320
321
	// ********** completion proposals **********
322
323
	@Override
324
	public Iterable<String> getXmlCompletionProposals(int pos) {
325
		Iterable<String> result = super.getXmlCompletionProposals(pos);
326
		if (result != null) {
327
			return result;
328
		}
329
		if (this.customizerClassTouches(pos)) {
330
			return this.getCandidateClassNames();
331
		}
332
		return null;
333
	}
334
335
	protected Iterable<String> getCandidateClassNames() {
336
		return MappingTools.getSortedJavaTypeNames(this.getJavaProject());
337
	}
338
339
	protected boolean customizerClassTouches(int pos) {
340
		return this.getXmlCustomizerClassRef()== null? false : this.getXmlCustomizerClassRef().classNameTouches(pos);
341
	}
319
}
342
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java (-1 / +33 lines)
Lines 14-19 Link Here
14
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.IType;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
16
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.core.utility.TextRange;
17
import org.eclipse.jpt.common.utility.internal.CollectionTools;
17
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
18
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
20
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
Lines 26-34 Link Here
26
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
27
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
27
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
28
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
28
import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
29
import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
30
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
29
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
31
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
30
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
32
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
31
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
33
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
32
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
34
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
33
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
35
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
34
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
36
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
Lines 285-288 Link Here
285
	protected TextRange getParentClassTextRange() {
287
	protected TextRange getParentClassTextRange() {
286
		return this.getValidationTextRange(this.xmlTypeMapping.getParentClassTextRange());
288
		return this.getValidationTextRange(this.xmlTypeMapping.getParentClassTextRange());
287
	}
289
	}
290
291
	// ********** completion proposals **********
292
293
	@Override
294
	public Iterable<String> getXmlCompletionProposals(int pos) {
295
		Iterable<String> result = super.getXmlCompletionProposals(pos);
296
		if (result != null) {
297
			return result;
298
		}
299
		result = this.customizer.getXmlCompletionProposals(pos);
300
		if (result != null) {
301
			return result;
302
		}
303
		result = this.converterContainer.getXmlCompletionProposals(pos);
304
		if (result != null) {
305
			return result;
306
		}
307
		if (this.xmlTypeMapping.parentClassTouches(pos)) {
308
			return this.getCandidateParentClassNames();
309
		}
310
		return null;
311
	}
312
	
313
	@SuppressWarnings("unchecked")
314
	protected Iterable<String> getCandidateParentClassNames() {
315
		return new CompositeIterable<String>(
316
				this.getCandidateClassNames(),
317
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
318
				);
319
	}
288
}
320
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java (+30 lines)
Lines 13-22 Link Here
13
import org.eclipse.jdt.core.IType;
13
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
14
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.utility.TextRange;
15
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.utility.internal.CollectionTools;
16
import org.eclipse.jpt.common.utility.internal.StringTools;
17
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
17
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
19
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
20
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
18
import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedIdMapping;
21
import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedIdMapping;
19
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
22
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
23
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
20
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
24
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
21
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
25
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
22
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId;
26
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId;
Lines 90-93 Link Here
90
	protected TextRange getAttributeTypeTextRange() {
94
	protected TextRange getAttributeTypeTextRange() {
91
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
95
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
92
	}
96
	}
97
98
	// ********** completion proposals **********
99
100
	@Override
101
	public Iterable<String> getXmlCompletionProposals(int pos) {
102
		Iterable<String> result = super.getXmlCompletionProposals(pos);
103
		if (result != null) {
104
			return result;
105
		}
106
		if (this.attributeTypeTouches(pos)) {
107
			return this.getCandidateAttributeTypeNames();
108
		}
109
		return null;
110
	}
111
	
112
	protected boolean attributeTypeTouches(int pos) {
113
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
114
	}
115
	
116
	@SuppressWarnings("unchecked")
117
	protected Iterable<String> getCandidateAttributeTypeNames() {
118
		return new CompositeIterable<String>(
119
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
120
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
121
				);
122
	}
93
}
123
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java (+30 lines)
Lines 13-22 Link Here
13
import org.eclipse.jdt.core.IType;
13
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
14
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.utility.TextRange;
15
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.utility.internal.CollectionTools;
16
import org.eclipse.jpt.common.utility.internal.StringTools;
17
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
17
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
19
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
20
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
18
import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedMapping;
21
import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedMapping;
19
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
22
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
23
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
20
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
24
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
21
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
25
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
22
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded;
26
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded;
Lines 89-92 Link Here
89
	protected TextRange getAttributeTypeTextRange() {
93
	protected TextRange getAttributeTypeTextRange() {
90
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
94
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
91
	}
95
	}
96
97
	// ********** completion proposals **********
98
99
	@Override
100
	public Iterable<String> getXmlCompletionProposals(int pos) {
101
		Iterable<String> result = super.getXmlCompletionProposals(pos);
102
		if (result != null) {
103
			return result;
104
		}
105
		if (this.attributeTypeTouches(pos)) {
106
			return this.getCandidateAttributeTypeNames();
107
		}
108
		return null;
109
	}
110
	
111
	protected boolean attributeTypeTouches(int pos) {
112
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
113
	}
114
	
115
	@SuppressWarnings("unchecked")
116
	protected Iterable<String> getCandidateAttributeTypeNames() {
117
		return new CompositeIterable<String>(
118
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
119
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
120
				);
121
	}
92
}
122
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java (-2 / +29 lines)
Lines 16-21 Link Here
16
import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
16
import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
17
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
17
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
18
import org.eclipse.jpt.common.core.utility.TextRange;
18
import org.eclipse.jpt.common.core.utility.TextRange;
19
import org.eclipse.jpt.common.utility.internal.CollectionTools;
19
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
20
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
20
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
21
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
21
import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
22
import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
Lines 40-53 Link Here
40
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
41
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
41
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
42
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
42
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
43
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
44
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
43
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
45
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
44
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaPlatformFactory;
46
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaPlatformFactory;
45
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
46
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkJpaPlatformVersion;
47
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkJpaPlatformVersion;
48
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
47
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
49
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
48
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkEntityPrimaryKeyValidator;
50
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkEntityPrimaryKeyValidator;
49
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
51
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
50
import org.eclipse.jpt.jpa.eclipselink.core.internal.plugin.JptJpaEclipseLinkCorePlugin;
51
import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
52
import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
52
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
53
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
53
import org.eclipse.text.edits.ReplaceEdit;
54
import org.eclipse.text.edits.ReplaceEdit;
Lines 467-472 Link Here
467
468
468
	// ********** completion proposals **********
469
	// ********** completion proposals **********
469
470
471
470
	@Override
472
	@Override
471
	public Iterable<String> getXmlCompletionProposals(int pos) {
473
	public Iterable<String> getXmlCompletionProposals(int pos) {
472
		Iterable<String> result = super.getXmlCompletionProposals(pos);
474
		Iterable<String> result = super.getXmlCompletionProposals(pos);
Lines 477-483 Link Here
477
		if (result != null) {
479
		if (result != null) {
478
			return result;
480
			return result;
479
		}
481
		}
482
		result = this.customizer.getXmlCompletionProposals(pos);
483
		if (result != null) {
484
			return result;
485
		}
486
		result = this.converterContainer.getXmlCompletionProposals(pos);
487
		if (result != null) {
488
			return result;
489
		}
490
		if (this.xmlTypeMapping.parentClassTouches(pos)) {
491
			return this.getCandidateParentClassNames();
492
		}
493
		if (this.classExtractorTouches(pos)) {
494
			return this.getCandidateClassNames();
495
		}
480
		return null;
496
		return null;
481
	}
497
	}
482
498
499
	@SuppressWarnings("unchecked")
500
	protected Iterable<String> getCandidateParentClassNames() {
501
		return new CompositeIterable<String>(
502
				super.getCandidateClassNames(),
503
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
504
				);
505
	}
506
	
507
	protected boolean classExtractorTouches(int pos) {
508
		return this.getXmlClassExtractor() == null? false : this.getXmlClassExtractor().classNameTouches(pos);
509
	}
483
}
510
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java (+22 lines)
Lines 195-198 Link Here
195
	protected TextRange getAttributeTypeTextRange() {
195
	protected TextRange getAttributeTypeTextRange() {
196
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
196
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
197
	}
197
	}
198
	
199
	// ********** completion proposals **********
200
201
	@Override
202
	public Iterable<String> getXmlCompletionProposals(int pos) {
203
		Iterable<String> result = super.getXmlCompletionProposals(pos);
204
		if (result != null) {
205
			return result;
206
		}
207
		if (this.attributeTypeTouches(pos)) {
208
			return this.getCandidateAttributeTypeNames();
209
		}
210
		return null;
211
	}
212
	
213
	protected boolean attributeTypeTouches(int pos) {
214
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
215
	}
216
	
217
	protected Iterable<String> getCandidateAttributeTypeNames() {
218
		return MappingTools.getPrimitiveClassNames();
219
	}
198
}
220
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java (+43 lines)
Lines 14-28 Link Here
14
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.IType;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
16
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.core.utility.TextRange;
17
import org.eclipse.jpt.common.utility.internal.CollectionTools;
17
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
20
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
21
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
20
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToManyMapping;
22
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToManyMapping;
21
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
23
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
22
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
24
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
23
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping;
25
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping;
24
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
26
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
25
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
27
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
28
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
26
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
29
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
27
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
30
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
28
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
31
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
Lines 179-182 Link Here
179
	protected TextRange getAttributeTypeTextRange() {
182
	protected TextRange getAttributeTypeTextRange() {
180
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
183
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
181
	}
184
	}
185
186
	// ********** completion proposals **********
187
188
	@Override
189
	public Iterable<String> getXmlCompletionProposals(int pos) {
190
		Iterable<String> result = super.getXmlCompletionProposals(pos);
191
		if (result != null) {
192
			return result;
193
		}
194
		if (this.attributeTypeTouches(pos)) {
195
			return this.getCandidateAttributeTypeNames();
196
		}
197
		return null;
198
	}
199
200
	protected boolean attributeTypeTouches(int pos) {
201
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
202
	}
203
	
204
	protected Iterable<String> getCandidateAttributeTypeNames() {
205
		return MappingTools.getCollectionTypeNames();
206
	}
207
	
208
	@Override
209
	@SuppressWarnings("unchecked")
210
	protected Iterable<String> getCandidateTargetEntityClassNames() {
211
		return new CompositeIterable<String>(
212
				super.getCandidateTargetEntityClassNames(),
213
				((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames()
214
				);
215
	}
216
	
217
	@Override
218
	@SuppressWarnings("unchecked")
219
	protected Iterable<String> getCandidateMapKeyClassNames() {
220
		return new CompositeIterable<String>(
221
				super.getCandidateMapKeyClassNames(),
222
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
223
				);
224
	}
182
}
225
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java (+14 lines)
Lines 10-19 Link Here
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
11
11
12
import java.util.List;
12
import java.util.List;
13
import org.eclipse.jpt.common.utility.internal.CollectionTools;
14
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
13
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
15
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
14
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToOneMapping;
16
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToOneMapping;
15
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
17
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
18
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
19
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
17
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
20
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
18
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
21
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
19
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
22
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
Lines 60-63 Link Here
60
		super.validate(messages, reporter);
63
		super.validate(messages, reporter);
61
		// TODO - join fetch validation
64
		// TODO - join fetch validation
62
	}
65
	}
66
67
	// ********** completion proposals **********
68
69
	@Override
70
	@SuppressWarnings("unchecked")
71
	protected Iterable<String> getCandidateTargetEntityClassNames() {
72
		return new CompositeIterable<String>(
73
				super.getCandidateTargetEntityClassNames(),
74
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
75
				);
76
	}
63
}
77
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java (-3 / +23 lines)
Lines 14-19 Link Here
14
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.IType;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
16
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.core.utility.TextRange;
17
import org.eclipse.jpt.common.utility.internal.CollectionTools;
17
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
18
import org.eclipse.jpt.common.utility.internal.NotNullFilter;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
20
import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
Lines 31-49 Link Here
31
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
32
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
32
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
33
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
33
import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
34
import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
35
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
34
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
36
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
35
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
37
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
36
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
38
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
37
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
39
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
38
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
40
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
39
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
41
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
40
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaPlatformFactory;
42
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaPlatformFactory;
41
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
42
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkJpaPlatformVersion;
43
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkJpaPlatformVersion;
44
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
43
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
45
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
44
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
46
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
45
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassValidator;
47
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassValidator;
46
import org.eclipse.jpt.jpa.eclipselink.core.internal.plugin.JptJpaEclipseLinkCorePlugin;
47
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
48
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
48
import org.eclipse.text.edits.ReplaceEdit;
49
import org.eclipse.text.edits.ReplaceEdit;
49
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
50
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
Lines 425-430 Link Here
425
		if (result != null) {
426
		if (result != null) {
426
			return result;
427
			return result;
427
		}
428
		}
429
		result = this.customizer.getXmlCompletionProposals(pos);
430
		if (result != null) {
431
			return result;
432
		}
433
		result = this.converterContainer.getXmlCompletionProposals(pos);
434
		if (result != null) {
435
			return result;
436
		}
437
		if (this.xmlTypeMapping.parentClassTouches(pos)) {
438
			return this.getCandidateParentClassNames();
439
		}
428
		return null;
440
		return null;
429
	}
441
	}
442
	
443
	@SuppressWarnings("unchecked")
444
	protected Iterable<String> getCandidateParentClassNames() {
445
		return new CompositeIterable<String>(
446
				this.getCandidateClassNames(),
447
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
448
				);
449
	}
430
}
450
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java (+43 lines)
Lines 14-22 Link Here
14
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.IType;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
15
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
16
import org.eclipse.jpt.common.core.utility.TextRange;
16
import org.eclipse.jpt.common.core.utility.TextRange;
17
import org.eclipse.jpt.common.utility.internal.CollectionTools;
17
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.StringTools;
18
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
19
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
20
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
21
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
20
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToManyMapping;
22
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToManyMapping;
21
import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
23
import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
22
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
24
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
Lines 26-31 Link Here
26
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
28
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
27
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0;
29
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0;
28
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
30
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
31
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
29
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
32
import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
30
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
33
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
31
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
34
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
Lines 210-213 Link Here
210
	protected TextRange getAttributeTypeTextRange() {
213
	protected TextRange getAttributeTypeTextRange() {
211
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
214
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
212
	}
215
	}
216
217
	// ********** completion proposals **********
218
219
	@Override
220
	public Iterable<String> getXmlCompletionProposals(int pos) {
221
		Iterable<String> result = super.getXmlCompletionProposals(pos);
222
		if (result != null) {
223
			return result;
224
		}
225
		if (this.attributeTypeTouches(pos)) {
226
			return this.getCandidateAttributeTypeNames();
227
		}
228
		return null;
229
	}
230
231
	protected boolean attributeTypeTouches(int pos) {
232
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
233
	}
234
	
235
	protected Iterable<String> getCandidateAttributeTypeNames() {
236
		return MappingTools.getCollectionTypeNames();
237
	}
238
	
239
	@Override
240
	@SuppressWarnings("unchecked")
241
	protected Iterable<String> getCandidateTargetEntityClassNames() {
242
		return new CompositeIterable<String>(
243
				super.getCandidateTargetEntityClassNames(),
244
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
245
				);
246
	}
247
	
248
	@Override
249
	@SuppressWarnings("unchecked")
250
	protected Iterable<String> getCandidateMapKeyClassNames() {
251
		return new CompositeIterable<String>(
252
				super.getCandidateMapKeyClassNames(),
253
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
254
				);
255
	}
213
}
256
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java (+14 lines)
Lines 10-20 Link Here
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
11
11
12
import java.util.List;
12
import java.util.List;
13
import org.eclipse.jpt.common.utility.internal.CollectionTools;
14
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
13
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
15
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
14
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToOneMapping;
16
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToOneMapping;
15
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
17
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
18
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
17
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
19
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
20
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
18
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
21
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
19
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
22
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
20
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
23
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
Lines 73-76 Link Here
73
		super.validate(messages, reporter);
76
		super.validate(messages, reporter);
74
		// TODO - private owned, join fetch validation
77
		// TODO - private owned, join fetch validation
75
	}
78
	}
79
80
	// ********** completion proposals **********
81
82
	@Override
83
	@SuppressWarnings("unchecked")
84
	protected Iterable<String> getCandidateTargetEntityClassNames() {
85
		return new CompositeIterable<String>(
86
				super.getCandidateTargetEntityClassNames(),
87
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
88
				);
89
	}
76
}
90
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java (+23 lines)
Lines 12-17 Link Here
12
import org.eclipse.jdt.core.IType;
12
import org.eclipse.jdt.core.IType;
13
import org.eclipse.jpt.common.core.utility.TextRange;
13
import org.eclipse.jpt.common.core.utility.TextRange;
14
import org.eclipse.jpt.jpa.core.context.XmlContextNode;
14
import org.eclipse.jpt.jpa.core.context.XmlContextNode;
15
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
15
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
16
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
17
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
17
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
18
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
Lines 83-86 Link Here
83
		super.convertFrom(javaConverter);
84
		super.convertFrom(javaConverter);
84
		this.setConverterClass(javaConverter.getConverterClass());
85
		this.setConverterClass(javaConverter.getConverterClass());
85
	}
86
	}
87
88
	// ********** completion proposals **********
89
90
	@Override
91
	public Iterable<String> getXmlCompletionProposals(int pos) {
92
		Iterable<String> result = super.getXmlCompletionProposals(pos);
93
		if (result != null) {
94
			return result;
95
		}
96
		if (this.converterClassNameTouches(pos)) {
97
			return this.getCandidateClassNames();
98
		}
99
		return null;
100
	}
101
102
	protected Iterable<String> getCandidateClassNames() {
103
		return MappingTools.getSortedJavaTypeNames(this.getJavaProject());
104
	}
105
106
	protected boolean converterClassNameTouches(int pos) {
107
		return this.xmlConverter.converterClassTouches(pos);
108
	}
86
}
109
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java (+30 lines)
Lines 9-19 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
11
11
12
import org.eclipse.jpt.common.utility.internal.CollectionTools;
13
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
12
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
14
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
13
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
15
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
16
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
14
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
17
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
15
import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
18
import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
19
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
20
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
17
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
21
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
18
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure;
22
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure;
19
23
Lines 60-63 Link Here
60
	public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
64
	public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
61
		((Attributes) xmlAttributes).getStructures().remove(this.xmlAttributeMapping);
65
		((Attributes) xmlAttributes).getStructures().remove(this.xmlAttributeMapping);
62
	}
66
	}
67
68
	// ********** completion proposals **********
69
70
	@Override
71
	public Iterable<String> getXmlCompletionProposals(int pos) {
72
		Iterable<String> result = super.getXmlCompletionProposals(pos);
73
		if (result != null) {
74
			return result;
75
		}
76
		if (this.attributeTypeTouches(pos)) {
77
			return this.getCandidateAttributeTypeNames();
78
		}
79
		return null;
80
	}
81
82
	protected boolean attributeTypeTouches(int pos) {
83
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
84
	}
85
	
86
	@SuppressWarnings("unchecked")
87
	protected Iterable<String> getCandidateAttributeTypeNames() {
88
		return new CompositeIterable<String>(
89
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
90
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
91
				);
92
	}
63
}
93
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java (+32 lines)
Lines 9-19 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
11
11
12
import org.eclipse.jpt.common.utility.internal.CollectionTools;
13
import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
12
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
14
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
13
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
15
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
16
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
14
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
17
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
15
import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
18
import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
19
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
20
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
17
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
21
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
18
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
22
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
19
23
Lines 60-63 Link Here
60
	public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
64
	public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
61
		((Attributes) xmlAttributes).getTransformations().remove(this.xmlAttributeMapping);
65
		((Attributes) xmlAttributes).getTransformations().remove(this.xmlAttributeMapping);
62
	}
66
	}
67
68
	// ********** completion proposals **********
69
70
	@Override
71
	public Iterable<String> getXmlCompletionProposals(int pos) {
72
		Iterable<String> result = super.getXmlCompletionProposals(pos);
73
		if (result != null) {
74
			return result;
75
		}
76
		if (this.attributeTypeTouches(pos)) {
77
			return this.getCandidateAttributeTypeNames();
78
		}
79
		return null;
80
	}
81
82
	protected boolean attributeTypeTouches(int pos) {
83
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
84
	}
85
	
86
	@SuppressWarnings("unchecked")
87
	protected Iterable<String> getCandidateAttributeTypeNames() {
88
		return new CompositeIterable<String>(
89
				MappingTools.getSortedJavaTypeNames(getJavaProject()),
90
				MappingTools.getPrimitiveClassNames(),
91
				MappingTools.getCollectionTypeNames(),
92
				CollectionTools.sort(((EclipseLinkPersistenceUnit) this.getPersistenceUnit()).getEclipseLinkDynamicPersistentTypeNames())
93
				);
94
	}
63
}
95
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java (+23 lines)
Lines 11-16 Link Here
11
11
12
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
12
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
13
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
13
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
14
import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
14
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
15
import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
15
import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
16
import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
16
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
17
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
Lines 44-47 Link Here
44
	public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
45
	public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
45
		((Attributes) xmlAttributes).getVariableOneToOnes().remove(this.xmlAttributeMapping);
46
		((Attributes) xmlAttributes).getVariableOneToOnes().remove(this.xmlAttributeMapping);
46
	}
47
	}
48
49
	// ********** completion proposals **********
50
51
	@Override
52
	public Iterable<String> getXmlCompletionProposals(int pos) {
53
		Iterable<String> result = super.getXmlCompletionProposals(pos);
54
		if (result != null) {
55
			return result;
56
		}
57
		if (this.targetInterfaceTouches(pos)) {
58
			return this.getCandidateTargetInterfaceNames();
59
		}
60
		return null;
61
	}
62
63
	protected boolean targetInterfaceTouches(int pos) {
64
		return this.xmlAttributeMapping.targetInterfaceTouches(pos);
65
	}
66
	
67
	protected Iterable<String> getCandidateTargetInterfaceNames() {
68
		return MappingTools.getSortedJavaTypeNames(getJavaProject());
69
	}
47
}
70
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java (-1 / +32 lines)
Lines 9-16 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
10
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
11
11
12
import java.sql.Timestamp;
13
import java.util.ArrayList;
12
import java.util.List;
14
import java.util.List;
13
14
import org.eclipse.jdt.core.IPackageFragment;
15
import org.eclipse.jdt.core.IPackageFragment;
15
import org.eclipse.jdt.core.IType;
16
import org.eclipse.jdt.core.IType;
16
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
17
import org.eclipse.jpt.common.core.internal.utility.JDTTools;
Lines 206-209 Link Here
206
	protected TextRange getAttributeTypeTextRange() {
207
	protected TextRange getAttributeTypeTextRange() {
207
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
208
		return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
208
	}
209
	}
210
211
	// ********** completion proposals **********
212
213
	@Override
214
	public Iterable<String> getXmlCompletionProposals(int pos) {
215
		Iterable<String> result = super.getXmlCompletionProposals(pos);
216
		if (result != null) {
217
			return result;
218
		}
219
		if (this.attributeTypeTouches(pos)) {
220
			return this.getCandidateAttributeTypeNames();
221
		}
222
		return null;
223
	}
224
225
	protected boolean attributeTypeTouches(int pos) {
226
		return this.xmlAttributeMapping.attributeTypeTouches(pos);
227
	}
228
	
229
	protected Iterable<String> getCandidateAttributeTypeNames() {
230
		List<String> names = new ArrayList<String>();
231
		names.add(int.class.getName());
232
		names.add(Integer.class.getSimpleName());
233
		names.add(short.class.getName());
234
		names.add(Short.class.getSimpleName());
235
		names.add(long.class.getName());
236
		names.add(Long.class.getSimpleName());
237
		names.add(Timestamp.class.getName());
238
		return names;
239
	}
209
}
240
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java (+18 lines)
Lines 1301-1306 Link Here
1301
		return (textRange != null) && (textRange.touches(pos));
1301
		return (textRange != null) && (textRange.touches(pos));
1302
	}
1302
	}
1303
	
1303
	
1304
	protected TextRange getAttributeTypeCodeAssistTextRange() {
1305
		return getAttributeCodeAssistTextRange(EclipseLink2_3.ARRAY__ATTRIBUTE_TYPE);
1306
	}
1307
1308
	public boolean attributeTypeTouches(int pos) {
1309
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
1310
		return (textRange != null) && (textRange.touches(pos));
1311
	}
1312
1313
	public TextRange getTargetClassCodeAssistTextRange() {
1314
		return getAttributeCodeAssistTextRange(EclipseLink2_3.ARRAY__TARGET_CLASS);
1315
	}
1316
	
1317
	public boolean targetClassTouches(int pos) {
1318
		TextRange textRange = this.getTargetClassCodeAssistTextRange();
1319
		return (textRange != null) && (textRange.touches(pos));
1320
	}
1321
1304
	// ******** virtual attribute ************
1322
	// ******** virtual attribute ************
1305
	
1323
	
1306
	public void setVirtualAttributeTypes(String attributeType, String targetClass) {
1324
	public void setVirtualAttributeTypes(String attributeType, String targetClass) {
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java (+9 lines)
Lines 1755-1760 Link Here
1755
		return (textRange != null) && (textRange.touches(pos));
1755
		return (textRange != null) && (textRange.touches(pos));
1756
	}
1756
	}
1757
	
1757
	
1758
	protected TextRange getAttributeTypeCodeAssistTextRange() {
1759
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
1760
	}
1761
	
1762
	public boolean attributeTypeTouches(int pos) {
1763
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
1764
		return (textRange != null) && (textRange.touches(pos));
1765
	}
1766
	
1758
	// ******** virtual attribute ************
1767
	// ******** virtual attribute ************
1759
	
1768
	
1760
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
1769
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java (+11 lines)
Lines 529-532 Link Here
529
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
529
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
530
		this.setAttributeType(attributeType);
530
		this.setAttributeType(attributeType);
531
	}
531
	}
532
533
	// *********** content assist ************
534
	
535
	protected TextRange getAttributeTypeCodeAssistTextRange() {
536
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
537
	}
538
	
539
	public boolean attributeTypeTouches(int pos) {
540
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
541
		return (textRange != null) && (textRange.touches(pos));
542
	}
532
}
543
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java (+11 lines)
Lines 529-532 Link Here
529
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
529
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
530
		this.setAttributeType(attributeType);
530
		this.setAttributeType(attributeType);
531
	}
531
	}
532
533
	// *********** content assist ************
534
	
535
	protected TextRange getAttributeTypeCodeAssistTextRange() {
536
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
537
	}
538
	
539
	public boolean attributeTypeTouches(int pos) {
540
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
541
		return (textRange != null) && (textRange.touches(pos));
542
	}
532
}
543
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java (+10 lines)
Lines 253-256 Link Here
253
		return new ReplaceEdit(offset, packageLength, newPackageName);
253
		return new ReplaceEdit(offset, packageLength, newPackageName);
254
	}
254
	}
255
255
256
	// ********** content assist ***************
257
	
258
	public TextRange getConverterClassCodeAssistTextRange() {
259
		return getAttributeCodeAssistTextRange(EclipseLink.CONVERTER__CLASS);
260
	}
261
	
262
	public boolean converterClassTouches(int pos) {
263
		TextRange textRange = this.getConverterClassCodeAssistTextRange();
264
		return (textRange != null) && textRange.touches(pos);
265
	}
256
} // XmlConverter
266
} // XmlConverter
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java (+9 lines)
Lines 2405-2410 Link Here
2405
		return (textRange != null) && (textRange.touches(pos));
2405
		return (textRange != null) && (textRange.touches(pos));
2406
	}
2406
	}
2407
	
2407
	
2408
	protected TextRange getAttributeTypeCodeAssistTextRange() {
2409
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
2410
	}
2411
	
2412
	public boolean attributeTypeTouches(int pos) {
2413
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
2414
		return (textRange != null) && (textRange.touches(pos));
2415
	}
2416
2408
	// ******** virtual attribute ************
2417
	// ******** virtual attribute ************
2409
	
2418
	
2410
	public void setVirtualAttributeTypes(String attributeType, String targetClass) {
2419
	public void setVirtualAttributeTypes(String attributeType, String targetClass) {
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java (+10 lines)
Lines 1715-1718 Link Here
1715
		return XmlNoSql.buildTranslator(EclipseLink2_4.NO_SQL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlEmbeddable_2_4_NoSql());
1715
		return XmlNoSql.buildTranslator(EclipseLink2_4.NO_SQL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlEmbeddable_2_4_NoSql());
1716
	}
1716
	}
1717
1717
1718
	// *********** content assist ************
1719
	
1720
	public TextRange getParentClassCodeAssistTextRange() {
1721
		return getAttributeCodeAssistTextRange(EclipseLink2_1.PARENT_CLASS);
1722
	}
1723
	
1724
	public boolean parentClassTouches(int pos) {
1725
		TextRange textRange = this.getParentClassCodeAssistTextRange();
1726
		return (textRange != null) && (textRange.touches(pos));
1727
	}
1718
}
1728
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java (+11 lines)
Lines 569-572 Link Here
569
		this.setAttributeType(attributeType);
569
		this.setAttributeType(attributeType);
570
	}
570
	}
571
571
572
	// *********** content assist ************
573
	
574
	protected TextRange getAttributeTypeCodeAssistTextRange() {
575
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
576
	}
577
	
578
	public boolean attributeTypeTouches(int pos) {
579
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
580
		return (textRange != null) && (textRange.touches(pos));
581
	}
582
572
}
583
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java (+11 lines)
Lines 462-465 Link Here
462
		this.setAttributeType(attributeType);
462
		this.setAttributeType(attributeType);
463
	}
463
	}
464
464
465
	// *********** content assist ************
466
	
467
	protected TextRange getAttributeTypeCodeAssistTextRange() {
468
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
469
	}
470
	
471
	public boolean attributeTypeTouches(int pos) {
472
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
473
		return (textRange != null) && (textRange.touches(pos));
474
	}
475
465
}
476
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java (+11 lines)
Lines 3985-3988 Link Here
3985
	protected static Translator buildNoSqlTranslator() {
3985
	protected static Translator buildNoSqlTranslator() {
3986
		return XmlNoSql.buildTranslator(EclipseLink2_4.NO_SQL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlEntity_2_4_NoSql());
3986
		return XmlNoSql.buildTranslator(EclipseLink2_4.NO_SQL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlEntity_2_4_NoSql());
3987
	}
3987
	}
3988
	
3989
	// *********** content assist ************
3990
	
3991
	public TextRange getParentClassCodeAssistTextRange() {
3992
		return getAttributeCodeAssistTextRange(EclipseLink2_1.PARENT_CLASS);
3993
	}
3994
	
3995
	public boolean parentClassTouches(int pos) {
3996
		TextRange textRange = this.getParentClassCodeAssistTextRange();
3997
		return (textRange != null) && (textRange.touches(pos));
3998
	}
3988
}
3999
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java (+11 lines)
Lines 1309-1312 Link Here
1309
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
1309
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
1310
		this.setAttributeType(attributeType);
1310
		this.setAttributeType(attributeType);
1311
	}
1311
	}
1312
1313
	// *********** content assist ************
1314
	
1315
	protected TextRange getAttributeTypeCodeAssistTextRange() {
1316
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
1317
	}
1318
	
1319
	public boolean attributeTypeTouches(int pos) {
1320
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
1321
		return (textRange != null) && (textRange.touches(pos));
1322
	}
1312
}
1323
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java (+11 lines)
Lines 2115-2118 Link Here
2115
		this.setAttributeType(attributeType);
2115
		this.setAttributeType(attributeType);
2116
		this.setTargetEntity(targetEntity);
2116
		this.setTargetEntity(targetEntity);
2117
	}
2117
	}
2118
2119
	// *********** content assist ************
2120
	
2121
	protected TextRange getAttributeTypeCodeAssistTextRange() {
2122
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
2123
	}
2124
	
2125
	public boolean attributeTypeTouches(int pos) {
2126
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
2127
		return (textRange != null) && (textRange.touches(pos));
2128
	}
2118
}
2129
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java (+11 lines)
Lines 4122-4125 Link Here
4122
	protected static Translator buildUuidGeneratorTranslator() {
4122
	protected static Translator buildUuidGeneratorTranslator() {
4123
		return XmlUuidGenerator.buildTranslator(EclipseLink2_4.UUID_GENERATOR, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlGeneratorContainer2_4_UuidGenerator());
4123
		return XmlUuidGenerator.buildTranslator(EclipseLink2_4.UUID_GENERATOR, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlGeneratorContainer2_4_UuidGenerator());
4124
	}
4124
	}
4125
	
4126
	// *********** content assist ************
4127
	
4128
	public TextRange getParentClassCodeAssistTextRange() {
4129
		return getAttributeCodeAssistTextRange(EclipseLink2_1.PARENT_CLASS);
4130
	}
4131
	
4132
	public boolean parentClassTouches(int pos) {
4133
		TextRange textRange = this.getParentClassCodeAssistTextRange();
4134
		return (textRange != null) && (textRange.touches(pos));
4135
	}
4125
}
4136
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java (+11 lines)
Lines 2278-2281 Link Here
2278
		this.setAttributeType(attributeType);
2278
		this.setAttributeType(attributeType);
2279
		this.setTargetEntity(targetEntity);
2279
		this.setTargetEntity(targetEntity);
2280
	}
2280
	}
2281
2282
	// *********** content assist ************
2283
	
2284
	protected TextRange getAttributeTypeCodeAssistTextRange() {
2285
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
2286
	}
2287
	
2288
	public boolean attributeTypeTouches(int pos) {
2289
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
2290
		return (textRange != null) && (textRange.touches(pos));
2291
	}
2281
}
2292
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java (+11 lines)
Lines 257-260 Link Here
257
		int offset = getAttributeNode(EclipseLink.STRUCT_CONVERTER__CONVERTER).getValueRegionStartOffset() + 1; // +1 = opening double quote
257
		int offset = getAttributeNode(EclipseLink.STRUCT_CONVERTER__CONVERTER).getValueRegionStartOffset() + 1; // +1 = opening double quote
258
		return new ReplaceEdit(offset, packageLength, newPackageName);
258
		return new ReplaceEdit(offset, packageLength, newPackageName);
259
	}
259
	}
260
261
	// ********** content assist ***************
262
	
263
	public TextRange getConverterClassCodeAssistTextRange() {
264
		return getAttributeCodeAssistTextRange(EclipseLink.STRUCT_CONVERTER__CONVERTER);
265
	}
266
	
267
	public boolean converterClassTouches(int pos) {
268
		TextRange textRange = this.getConverterClassCodeAssistTextRange();
269
		return (textRange != null) && textRange.touches(pos);
270
	}
260
} // XmlStructConverter
271
} // XmlStructConverter
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java (+11 lines)
Lines 471-474 Link Here
471
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
471
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
472
		this.setAttributeType(attributeType);
472
		this.setAttributeType(attributeType);
473
	}
473
	}
474
475
	// *********** content assist ************
476
	
477
	protected TextRange getAttributeTypeCodeAssistTextRange() {
478
		return getAttributeCodeAssistTextRange(EclipseLink2_3.STRUCTURE__ATTRIBUTE_TYPE);
479
	}
480
	
481
	public boolean attributeTypeTouches(int pos) {
482
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
483
		return (textRange != null) && (textRange.touches(pos));
484
	}
474
} // XmlStructure
485
} // XmlStructure
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java (+11 lines)
Lines 466-469 Link Here
466
		this.setAttributeType(attributeType);
466
		this.setAttributeType(attributeType);
467
	}
467
	}
468
468
469
	// *********** content assist ************
470
	
471
	protected TextRange getAttributeTypeCodeAssistTextRange() {
472
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
473
	}
474
	
475
	public boolean attributeTypeTouches(int pos) {
476
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
477
		return (textRange != null) && (textRange.touches(pos));
478
	}
479
469
}
480
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java (+11 lines)
Lines 1379-1382 Link Here
1379
		this.setTargetInterface(targetInterface);
1379
		this.setTargetInterface(targetInterface);
1380
	}
1380
	}
1381
1381
1382
	// *********** content assist ************
1383
	
1384
	protected TextRange getTargetInterfaceCodeAssistTextRange() {
1385
		return getAttributeCodeAssistTextRange(EclipseLink.VARIABLE_ONE_TO_ONE__TARGET_INTERFACE);
1386
	}
1387
	
1388
	public boolean targetInterfaceTouches(int pos) {
1389
		TextRange textRange = this.getTargetInterfaceCodeAssistTextRange();
1390
		return (textRange != null) && (textRange.touches(pos));
1391
	}
1392
1382
}
1393
}
(-)a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java (+9 lines)
Lines 987-992 Link Here
987
		return (textRange != null) && (textRange.touches(pos));
987
		return (textRange != null) && (textRange.touches(pos));
988
	}
988
	}
989
	
989
	
990
	protected TextRange getAttributeTypeCodeAssistTextRange() {
991
		return getAttributeCodeAssistTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
992
	}
993
	
994
	public boolean attributeTypeTouches(int pos) {
995
		TextRange textRange = this.getAttributeTypeCodeAssistTextRange();
996
		return (textRange != null) && (textRange.touches(pos));
997
	}
998
	
990
	// ******** virtual attribute ************
999
	// ******** virtual attribute ************
991
	
1000
	
992
	public void setVirtualAttributeTypes(String attributeType, String targetType) {
1001
	public void setVirtualAttributeTypes(String attributeType, String targetType) {

Return to bug 373582