1 11 package org.eclipse.pde.internal.ui.editor.schema; 12 13 import org.eclipse.pde.internal.core.ischema.*; 14 import org.eclipse.pde.internal.core.schema.SchemaElementReference; 15 import org.eclipse.pde.internal.ui.PDEUIMessages; 16 17 public class ReferencePropertySource extends GrammarPropertySource { 18 19 public ReferencePropertySource(SchemaElementReference obj) { 20 super(obj); 21 } 22 23 protected String isMinOccursValid(int ivalue) { 24 String status = super.isMinOccursValid(ivalue); 25 if (status==null && isInAll()) { 26 if (ivalue!=0 && ivalue!=1) { 27 return PDEUIMessages.ReferencePropertySource_minOccurs_value; } 29 } 30 return status; 31 } 32 33 protected String isMaxOccursValid(int ivalue) { 34 String status = super.isMaxOccursValid(ivalue); 35 if (status==null && isInAll()) { 36 if (ivalue!=1) { 37 return PDEUIMessages.ReferencePropertySource_maxOccurs_value; } 39 } 40 return status; 41 } 42 43 private boolean isInAll() { 44 ISchemaCompositor compositor = getReference().getCompositor(); 45 return (compositor!=null && compositor.getKind()==ISchemaCompositor.ALL); 46 } 47 48 protected SchemaElementReference getReference() { 49 return (SchemaElementReference)getSourceObject(); 50 } 51 } 52 | Popular Tags |