Source Code Cross Referenced for StandardDisplayNameGenerator.java in  » Workflow-Engines » JaWE » org » enhydra » jawe » base » display » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » JaWE » org.enhydra.jawe.base.display 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.enhydra.jawe.base.display;
002:
003:        import java.lang.reflect.Method;
004:        import java.util.Iterator;
005:        import java.util.List;
006:        import java.util.Map;
007:
008:        import org.enhydra.jawe.JaWEComponent;
009:        import org.enhydra.jawe.JaWEManager;
010:        import org.enhydra.jawe.Settings;
011:        import org.enhydra.jawe.base.label.LabelGenerator;
012:        import org.enhydra.jawe.base.xpdlhandler.XPDLHandler;
013:        import org.enhydra.shark.utilities.SequencedHashMap;
014:        import org.enhydra.shark.xpdl.XMLAttribute;
015:        import org.enhydra.shark.xpdl.XMLBaseForCollectionAndComplex;
016:        import org.enhydra.shark.xpdl.XMLCollection;
017:        import org.enhydra.shark.xpdl.XMLCollectionElement;
018:        import org.enhydra.shark.xpdl.XMLComplexChoice;
019:        import org.enhydra.shark.xpdl.XMLComplexElement;
020:        import org.enhydra.shark.xpdl.XMLElement;
021:        import org.enhydra.shark.xpdl.XMLEmptyChoiceElement;
022:        import org.enhydra.shark.xpdl.XMLSimpleElement;
023:        import org.enhydra.shark.xpdl.XMLUtil;
024:        import org.enhydra.shark.xpdl.elements.*;
025:        import org.enhydra.shark.xpdl.elements.Package;
026:
027:        /**
028:         *  Used to generate strings for graphical representation of all XPDL entities.
029:         *
030:         *  @author Sasa Bojanic
031:         */
032:        public class StandardDisplayNameGenerator implements 
033:                DisplayNameGenerator {
034:
035:            protected DisplayNameGeneratorSettings settings;
036:
037:            public StandardDisplayNameGenerator() {
038:                settings = new DisplayNameGeneratorSettings();
039:                settings.init((JaWEComponent) null);
040:            }
041:
042:            public StandardDisplayNameGenerator(
043:                    DisplayNameGeneratorSettings settings) {
044:                this .settings = settings;
045:                this .settings.init((JaWEComponent) null);
046:            }
047:
048:            public String getDisplayName(Activities el) {
049:                return generateStandardDisplayName(el);
050:            }
051:
052:            public String getDisplayName(Activity el) {
053:                return generateStandardDisplayName(el);
054:            }
055:
056:            public String getDisplayName(ActivitySet el) {
057:                return generateStandardDisplayName(el);
058:            }
059:
060:            public String getDisplayName(ActivitySets el) {
061:                return generateStandardDisplayName(el);
062:            }
063:
064:            public String getDisplayName(ActivityTypes el) {
065:                return generateStandardDisplayName(el);
066:            }
067:
068:            public String getDisplayName(ActualParameter el) {
069:                WorkflowProcess wp = XMLUtil.getWorkflowProcess(el);
070:                Map vars = XMLUtil.getPossibleVariables(wp);
071:                String vId = el.toValue();
072:                if (!vId.equals("")) {
073:                    XMLCollectionElement dfOrFp = (XMLCollectionElement) vars
074:                            .get(vId);
075:                    if (dfOrFp != null) {
076:                        return getDisplayName(dfOrFp);
077:                    }
078:                }
079:                return vId;
080:            }
081:
082:            public String getDisplayName(ActualParameters el) {
083:                return generateStandardDisplayName(el);
084:            }
085:
086:            public String getDisplayName(Application el) {
087:                return generateStandardDisplayName(el);
088:            }
089:
090:            public String getDisplayName(Applications el) {
091:                return generateStandardDisplayName(el);
092:            }
093:
094:            public String getDisplayName(ApplicationTypes el) {
095:                return generateStandardDisplayName(el);
096:            }
097:
098:            public String getDisplayName(ArrayType el) {
099:                return generateStandardDisplayName(el);
100:            }
101:
102:            public String getDisplayName(Author el) {
103:                return generateStandardDisplayName(el);
104:            }
105:
106:            public String getDisplayName(Automatic el) {
107:                return generateStandardDisplayName(el);
108:            }
109:
110:            public String getDisplayName(BasicType el) {
111:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
112:                        el);
113:            }
114:
115:            public String getDisplayName(BlockActivity el) {
116:                return generateStandardDisplayName(el);
117:            }
118:
119:            public String getDisplayName(Codepage el) {
120:                return generateStandardDisplayName(el);
121:            }
122:
123:            public String getDisplayName(Condition el) {
124:                return el.toValue();
125:            }
126:
127:            public String getDisplayName(ConformanceClass el) {
128:                return generateStandardDisplayName(el);
129:            }
130:
131:            public String getDisplayName(Cost el) {
132:                return generateStandardDisplayName(el);
133:            }
134:
135:            public String getDisplayName(CostUnit el) {
136:                return generateStandardDisplayName(el);
137:            }
138:
139:            public String getDisplayName(Countrykey el) {
140:                return generateStandardDisplayName(el);
141:            }
142:
143:            public String getDisplayName(Created el) {
144:                return generateStandardDisplayName(el);
145:            }
146:
147:            public String getDisplayName(DataField el) {
148:                return generateStandardDisplayName(el);
149:            }
150:
151:            public String getDisplayName(DataFields el) {
152:                return generateStandardDisplayName(el);
153:            }
154:
155:            public String getDisplayName(DataType el) {
156:                return getDisplayName(el.getDataTypes());
157:            }
158:
159:            public String getDisplayName(DataTypes el) {
160:                //return generateStandardDisplayName(el);
161:                XMLBaseForCollectionAndComplex ch = (XMLBaseForCollectionAndComplex) el
162:                        .getChoosen();
163:                LabelGenerator lg = JaWEManager.getInstance()
164:                        .getLabelGenerator();
165:                String disp = lg.getLabel(ch);
166:                if (ch instanceof  BasicType) {
167:                    disp += " -> "
168:                            + settings
169:                                    .getLanguageDependentString(((BasicType) ch)
170:                                            .getType()
171:                                            + "Key");
172:                } else if (ch instanceof  DeclaredType) {
173:                    String tdId = ((DeclaredType) ch).getId();
174:                    TypeDeclaration td = null;
175:                    if (el.getParent() instanceof  TypeDeclaration) {
176:                        td = ((TypeDeclarations) el.getParent().getParent())
177:                                .getTypeDeclaration(tdId);
178:                    } else {
179:                        td = XMLUtil.getPackage(el).getTypeDeclaration(tdId);
180:                    }
181:                    disp += " -> " + getDisplayName(td);
182:                }
183:                return disp;
184:            }
185:
186:            public String getDisplayName(Deadline el) {
187:                return el.getDeadlineCondition();
188:            }
189:
190:            public String getDisplayName(DeadlineCondition el) {
191:                return generateStandardDisplayName(el);
192:            }
193:
194:            public String getDisplayName(Deadlines el) {
195:                return generateStandardDisplayName(el);
196:            }
197:
198:            public String getDisplayName(DeclaredType el) {
199:                LabelGenerator lg = JaWEManager.getInstance()
200:                        .getLabelGenerator();
201:                return lg.getLabel(el);
202:                //return generateStandardDisplayName(el);
203:            }
204:
205:            public String getDisplayName(Description el) {
206:                return generateStandardDisplayName(el);
207:            }
208:
209:            public String getDisplayName(Documentation el) {
210:                return generateStandardDisplayName(el);
211:            }
212:
213:            public String getDisplayName(Duration el) {
214:                return generateStandardDisplayName(el);
215:            }
216:
217:            public String getDisplayName(EnumerationType el) {
218:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
219:                        el);
220:            }
221:
222:            public String getDisplayName(EnumerationValue el) {
223:                return generateStandardDisplayName(el);
224:            }
225:
226:            public String getDisplayName(ExceptionName el) {
227:                return generateStandardDisplayName(el);
228:            }
229:
230:            public String getDisplayName(ExtendedAttribute el) {
231:                return generateStandardDisplayName(el);
232:            }
233:
234:            public String getDisplayName(ExtendedAttributes el) {
235:                return generateStandardDisplayName(el);
236:            }
237:
238:            public String getDisplayName(ExternalPackage el) {
239:                //return generateStandardDisplayName(el);
240:                return el.getHref();
241:            }
242:
243:            public String getDisplayName(ExternalPackages el) {
244:                return generateStandardDisplayName(el);
245:            }
246:
247:            public String getDisplayName(ExternalReference el) {
248:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
249:                        el);
250:            }
251:
252:            public String getDisplayName(FinishMode el) {
253:                return generateStandardDisplayName(el.getStartFinishModes());
254:            }
255:
256:            public String getDisplayName(FormalParameter el) {
257:                return generateStandardDisplayName(el);
258:            }
259:
260:            public String getDisplayName(FormalParameters el) {
261:                if (el.getParent() instanceof  XMLComplexChoice) {
262:                    return JaWEManager.getInstance().getLabelGenerator()
263:                            .getLabel(el);
264:                }
265:                return String.valueOf(el.size());
266:            }
267:
268:            public String getDisplayName(Icon el) {
269:                return generateStandardDisplayName(el);
270:            }
271:
272:            public String getDisplayName(Implementation el) {
273:                return generateStandardDisplayName(el);
274:            }
275:
276:            public String getDisplayName(ImplementationTypes el) {
277:                return generateStandardDisplayName(el);
278:            }
279:
280:            public String getDisplayName(InitialValue el) {
281:                return generateStandardDisplayName(el);
282:            }
283:
284:            public String getDisplayName(Join el) {
285:                return generateStandardDisplayName(el.getTypeAttribute());
286:            }
287:
288:            public String getDisplayName(Length el) {
289:                return generateStandardDisplayName(el);
290:            }
291:
292:            public String getDisplayName(Limit el) {
293:                return generateStandardDisplayName(el);
294:            }
295:
296:            public String getDisplayName(ListType el) {
297:                return generateStandardDisplayName(el);
298:            }
299:
300:            public String getDisplayName(Manual el) {
301:                return generateStandardDisplayName(el);
302:            }
303:
304:            public String getDisplayName(Member el) {
305:                return getDisplayName(el.getDataTypes());
306:            }
307:
308:            public String getDisplayName(Namespace el) {
309:                return generateStandardDisplayName(el);
310:            }
311:
312:            public String getDisplayName(Namespaces el) {
313:                return generateStandardDisplayName(el);
314:            }
315:
316:            public String getDisplayName(No el) {
317:                return generateStandardDisplayName(el);
318:            }
319:
320:            public String getDisplayName(
321:                    org.enhydra.shark.xpdl.elements.Package el) {
322:                return generateStandardDisplayName(el);
323:            }
324:
325:            public String getDisplayName(PackageHeader el) {
326:                return generateStandardDisplayName(el);
327:            }
328:
329:            public String getDisplayName(Participant el) {
330:                return generateStandardDisplayName(el);
331:            }
332:
333:            public String getDisplayName(Participants el) {
334:                return generateStandardDisplayName(el);
335:            }
336:
337:            public String getDisplayName(ParticipantType el) {
338:                return generateStandardDisplayName(el.getTypeAttribute());
339:            }
340:
341:            public String getDisplayName(Performer el) {
342:                return generateStandardDisplayName(el);
343:            }
344:
345:            public String getDisplayName(Priority el) {
346:                return generateStandardDisplayName(el);
347:            }
348:
349:            public String getDisplayName(PriorityUnit el) {
350:                return generateStandardDisplayName(el);
351:            }
352:
353:            public String getDisplayName(ProcessHeader el) {
354:                return generateStandardDisplayName(el);
355:            }
356:
357:            public String getDisplayName(RecordType el) {
358:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
359:                        el);
360:            }
361:
362:            public String getDisplayName(RedefinableHeader el) {
363:                return generateStandardDisplayName(el);
364:            }
365:
366:            public String getDisplayName(Responsible el) {
367:                WorkflowProcess wp = XMLUtil.getWorkflowProcess(el);
368:                Package pkg = XMLUtil.getPackage(el);
369:                XPDLHandler xpdlh = JaWEManager.getInstance().getXPDLHandler();
370:                Map ps = null;
371:                if (wp != null) {
372:                    ps = XMLUtil.getPossibleParticipants(wp, xpdlh);
373:                } else if (pkg != null) {
374:                    ps = XMLUtil.getPossibleParticipants(pkg, xpdlh);
375:                }
376:                String pId = el.toValue();
377:                if (ps != null && !pId.equals("")) {
378:                    Participant p = (Participant) ps.get(pId);
379:                    if (p != null) {
380:                        return getDisplayName(p);
381:                    }
382:                }
383:                return pId;
384:            }
385:
386:            public String getDisplayName(Responsibles el) {
387:                return generateStandardDisplayName(el);
388:            }
389:
390:            public String getDisplayName(Route el) {
391:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
392:                        el);
393:            }
394:
395:            public String getDisplayName(SchemaType el) {
396:                return generateStandardDisplayName(el);
397:            }
398:
399:            public String getDisplayName(Script el) {
400:                return generateStandardDisplayName(el);
401:            }
402:
403:            public String getDisplayName(SimulationInformation el) {
404:                return generateStandardDisplayName(el);
405:            }
406:
407:            public String getDisplayName(Split el) {
408:                return generateStandardDisplayName(el.getTypeAttribute());
409:            }
410:
411:            public String getDisplayName(StartFinishModes el) {
412:                return generateStandardDisplayName(el.getChoosen());
413:            }
414:
415:            public String getDisplayName(StartMode el) {
416:                return generateStandardDisplayName(el.getStartFinishModes());
417:            }
418:
419:            public String getDisplayName(SubFlow el) {
420:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
421:                        el);
422:            }
423:
424:            public String getDisplayName(TimeEstimation el) {
425:                return generateStandardDisplayName(el);
426:            }
427:
428:            public String getDisplayName(Tool el) {
429:                return generateStandardDisplayName(el);
430:            }
431:
432:            public String getDisplayName(Tools el) {
433:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
434:                        el);
435:            }
436:
437:            public String getDisplayName(Transition el) {
438:                return generateStandardDisplayName(el);
439:            }
440:
441:            public String getDisplayName(TransitionRef el) {
442:                return getDisplayName(el.get("Id"));
443:            }
444:
445:            public String getDisplayName(TransitionRefs el) {
446:                return generateStandardDisplayName(el);
447:            }
448:
449:            public String getDisplayName(TransitionRestriction el) {
450:                return generateStandardDisplayName(el);
451:            }
452:
453:            public String getDisplayName(TransitionRestrictions el) {
454:                return generateStandardDisplayName(el);
455:            }
456:
457:            public String getDisplayName(Transitions el) {
458:                return generateStandardDisplayName(el);
459:            }
460:
461:            public String getDisplayName(TypeDeclaration el) {
462:                return generateStandardDisplayName(el);
463:            }
464:
465:            public String getDisplayName(TypeDeclarations el) {
466:                return generateStandardDisplayName(el);
467:            }
468:
469:            public String getDisplayName(UnionType el) {
470:                return JaWEManager.getInstance().getLabelGenerator().getLabel(
471:                        el);
472:            }
473:
474:            public String getDisplayName(ValidFrom el) {
475:                return generateStandardDisplayName(el);
476:            }
477:
478:            public String getDisplayName(ValidTo el) {
479:                return generateStandardDisplayName(el);
480:            }
481:
482:            public String getDisplayName(Vendor el) {
483:                return generateStandardDisplayName(el);
484:            }
485:
486:            public String getDisplayName(Version el) {
487:                return generateStandardDisplayName(el);
488:            }
489:
490:            public String getDisplayName(WaitingTime el) {
491:                return generateStandardDisplayName(el);
492:            }
493:
494:            public String getDisplayName(WorkflowProcess el) {
495:                return generateStandardDisplayName(el);
496:            }
497:
498:            public String getDisplayName(WorkflowProcesses el) {
499:                return generateStandardDisplayName(el);
500:            }
501:
502:            public String getDisplayName(WorkingTime el) {
503:                return generateStandardDisplayName(el);
504:            }
505:
506:            public String getDisplayName(XPDLVersion el) {
507:                return generateStandardDisplayName(el);
508:            }
509:
510:            public String getDisplayName(XMLAttribute el) {
511:                if (el.getParent() instanceof  Transition
512:                        && (el.toName().equals("From") || el.toName().equals(
513:                                "To"))) {
514:                    XMLCollectionElement wpOrAs = XMLUtil.getActivitySet(el);
515:                    if (wpOrAs == null) {
516:                        wpOrAs = XMLUtil.getWorkflowProcess(el);
517:                    }
518:                    SequencedHashMap pas = getPossibleActivities(wpOrAs);
519:                    Activity act = (Activity) pas.get(el.toValue());
520:                    if (act != null) {
521:                        return generateStandardDisplayName(act);
522:                    }
523:                } else if (el.getParent() instanceof  TransitionRef) {
524:                    XMLCollectionElement wpOrAs = XMLUtil.getActivitySet(el);
525:                    if (wpOrAs == null) {
526:                        wpOrAs = XMLUtil.getWorkflowProcess(el);
527:                    }
528:                    Transitions tras = (Transitions) wpOrAs.get("Transitions");
529:                    Transition tra = tras.getTransition(el.toValue());
530:                    if (tra != null) {
531:                        SequencedHashMap pas = getPossibleActivities(wpOrAs);
532:                        Activity act = (Activity) pas.get(tra.getTo());
533:                        if (act != null) {
534:                            return generateStandardDisplayName(act);
535:                        }
536:                    }
537:                }
538:                return generateStandardDisplayName(el);
539:            }
540:
541:            public String getDisplayName(XMLEmptyChoiceElement el) {
542:                String v = el.toValue();
543:                //      try {
544:                //         v=settings.getLanguageDependentString(v+"Key");
545:                //         System.out.println("LDS for "+el.toValue()+"Key is "+v);
546:                //         if (v==null) {
547:                //            v=el.toValue();
548:                //         }
549:                //      } catch (Exception ex) {
550:                //         System.out.println("Failed getting LDS for "+el.toValue()+"Key");
551:                //         v=el.toValue();
552:                //      }
553:                return v;
554:            }
555:
556:            public String getDisplayName(XMLComplexChoice el) {
557:                return generateStandardDisplayName(el);
558:            }
559:
560:            public String getDisplayName(XMLCollection el) {
561:                return generateStandardDisplayName(el);
562:            }
563:
564:            public String getDisplayName(XMLCollectionElement el) {
565:                return generateStandardDisplayName(el);
566:            }
567:
568:            public String getDisplayName(XMLComplexElement el) {
569:                return generateStandardDisplayName(el);
570:            }
571:
572:            public String getDisplayName(XMLSimpleElement el) {
573:                return generateStandardDisplayName(el);
574:            }
575:
576:            public String getDisplayName(XMLElement el) {
577:                try {
578:                    Class cl = el.getClass();
579:                    Method m = null;
580:                    try {
581:                        m = this .getClass().getMethod("getDisplayName",
582:                                new Class[] { cl });
583:                    } catch (Exception ex) {
584:                        if (!(cl == XMLSimpleElement.class
585:                                || cl == XMLAttribute.class
586:                                || cl == XMLComplexChoice.class
587:                                || cl == XMLComplexElement.class
588:                                || cl == XMLCollectionElement.class || cl == XMLCollection.class)) {
589:                            if (XMLComplexChoice.class.isAssignableFrom(cl)) {
590:                                cl = XMLComplexChoice.class;
591:                            } else if (XMLAttribute.class.isAssignableFrom(cl)) {
592:                                cl = XMLAttribute.class;
593:                            } else if (XMLSimpleElement.class
594:                                    .isAssignableFrom(cl)) {
595:                                cl = XMLSimpleElement.class;
596:                            } else if (XMLComplexElement.class
597:                                    .isAssignableFrom(cl)) {
598:                                cl = XMLComplexElement.class;
599:                            } else if (XMLCollection.class.isAssignableFrom(cl)) {
600:                                cl = XMLCollection.class;
601:                            }
602:                        }
603:                    }
604:                    m = this .getClass().getMethod("getDisplayName",
605:                            new Class[] { cl });
606:                    //          System.err.println("calling "+m.toString());
607:                    return (String) m.invoke(this , new Object[] { el });
608:                } catch (Throwable e) {
609:                    e.printStackTrace();
610:                }
611:
612:                return generateStandardDisplayName(el);
613:            }
614:
615:            public String generateStandardDisplayName(XMLElement el) {
616:                String disp = "";
617:                if (el instanceof  XMLCollection) {
618:                    disp = String.valueOf(((XMLCollection) el).size());
619:                } else if (el instanceof  XMLComplexElement) {
620:                    XMLElement nme = ((XMLComplexElement) el).get("Name");
621:                    if (nme != null) {
622:                        disp = nme.toValue();
623:                    }
624:                    if (disp.equals("")) {
625:                        XMLElement id = ((XMLComplexElement) el).get("Id");
626:                        if (id != null) {
627:                            disp = id.toValue();
628:                        }
629:                    }
630:                    if (disp.equals("")) {
631:                        disp = JaWEManager.getInstance().getLabelGenerator()
632:                                .getLabel(el);
633:                    }
634:                } else if (el instanceof  XMLComplexChoice) {
635:                    disp = getDisplayName(((XMLComplexChoice) el).getChoosen());
636:                } else if (el instanceof  XMLAttribute
637:                        && ((XMLAttribute) el).getChoices() != null) {
638:                    disp = settings.getLanguageDependentString(el.toValue()
639:                            + "Key");
640:                    if (disp == null || disp.equals("")) {
641:                        disp = el.toValue();
642:                    }
643:                } else {
644:                    disp = el.toValue();
645:                }
646:                return disp;
647:            }
648:
649:            public DisplayNameGeneratorSettings getSetting() {
650:                return settings;
651:            }
652:
653:            public Settings getSettings() {
654:                return settings;
655:            }
656:
657:            public SequencedHashMap getPossibleActivities(
658:                    XMLCollectionElement wpOrAs) {
659:                SequencedHashMap toRet = new SequencedHashMap();
660:                List acts = ((Activities) wpOrAs.get("Activities"))
661:                        .toElements();
662:                Iterator it = acts.iterator();
663:                while (it.hasNext()) {
664:                    Activity act = (Activity) it.next();
665:                    toRet.put(act.getId(), act);
666:                }
667:                return toRet;
668:            }
669:
670:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.