- Timestamp:
- 07/07/08 22:42:02 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/Rapla/src/org/rapla/gui/internal/action/RaplaObjectAction.java
r1091 r1295 190 190 */ 191 191 public DynamicType guessType() throws RaplaException { 192 DynamicType[] types = guessTypes(); 193 if ( types.length > 0) 194 { 195 return types[0]; 196 } 197 else 198 { 199 return null; 200 } 201 } 202 203 public DynamicType[] guessTypes() throws RaplaException { 192 204 DynamicType dynamicType = null; 193 205 getLogger().debug("Guessing DynamicType from " + object); … … 199 211 dynamicType = classification.getType(); 200 212 } 213 if (dynamicType != null) 214 { 215 return new DynamicType[] {dynamicType}; 216 } 201 217 String classificationType = null; 202 218 if ( Reservation.TYPE.is( raplaType )) { 203 classificationType = DynamicTypeAnnotations.VALUE_RESERVATION_CLASSIFICATION;204 } else if ( Allocatable.TYPE.is( raplaType )) {205 if ( isPerson ) {206 classificationType = DynamicTypeAnnotations.VALUE_PERSON_CLASSIFICATION;207 } else {208 classificationType = DynamicTypeAnnotations.VALUE_RESOURCE_CLASSIFICATION;209 }219 classificationType = DynamicTypeAnnotations.VALUE_RESERVATION_CLASSIFICATION; 220 } else if ( Allocatable.TYPE.is( raplaType )) { 221 if ( isPerson ) { 222 classificationType = DynamicTypeAnnotations.VALUE_PERSON_CLASSIFICATION; 223 } else { 224 classificationType = DynamicTypeAnnotations.VALUE_RESOURCE_CLASSIFICATION; 225 } 210 226 } 211 227 DynamicType[] dynamicTypes = getQuery().getDynamicTypes( classificationType ); 212 if ( dynamicType != null ) 213 { 214 for (int i=0; i < dynamicTypes.length ; i++) 215 { 216 if (dynamicTypes[i].equals(dynamicType)) 217 return dynamicType; 218 } 219 } 220 return dynamicTypes[0]; 228 return dynamicTypes; 229 221 230 } 222 231
![(please configure the [header_logo] section in trac.ini)](/chrome/site/rapla.jpg)