1 20 package org.enhydra.barracuda.contrib.dbroggisch.examples.controller.handlers; 21 22 import java.io.IOException ; 23 import java.util.ArrayList ; 24 import java.util.List ; 25 import javax.servlet.ServletException ; 26 import org.enhydra.barracuda.core.comp.BLink; 27 import org.enhydra.barracuda.core.event.ControlEventContext; 28 import org.enhydra.barracuda.core.event.EventException; 29 import org.enhydra.barracuda.contrib.dbroggisch.page.Page; 30 import org.enhydra.barracuda.contrib.dbroggisch.page.PageEventListener; 31 32 import org.enhydra.barracuda.contrib.dbroggisch.examples.controller.events.*; 33 import org.enhydra.barracuda.contrib.dbroggisch.examples.view.pages.*; 34 35 36 public class NavigationBarHandler extends PageEventListener { 37 38 public void handleControlEvent(ControlEventContext context, Page p) 39 throws EventException, ServletException , IOException { 40 ExampleBasePage basePage = (ExampleBasePage)p; 41 List menupoints = new ArrayList (3); 42 BLink bl = null; 43 ExampleBasePage.State state = basePage.getState(); 44 45 if (state == ExampleBasePage.REPOPULATION) { 46 bl = new BLink("*Repopulation", new Repopulation()); 47 menupoints.add(bl); 48 bl = new BLink("FileUpload", new FileUpload()); 49 menupoints.add(bl); 50 bl = new BLink("PrefixMapping", new PrefixMapping()); 51 menupoints.add(bl); 52 53 } 54 if (state == ExampleBasePage.PREFIXMAPPING) { 55 bl = new BLink("Repopulation", new Repopulation()); 56 menupoints.add(bl); 57 bl = new BLink("FileUpload", new FileUpload()); 58 menupoints.add(bl); 59 bl = new BLink("*PrefixMapping", new PrefixMapping()); 60 menupoints.add(bl); 61 62 } 63 if (state == ExampleBasePage.FILEUPLOAD) { 64 bl = new BLink("Repopulation", new Repopulation()); 65 menupoints.add(bl); 66 bl = new BLink("*FileUpload", new FileUpload()); 67 menupoints.add(bl); 68 bl = new BLink("PrefixMapping", new PrefixMapping()); 69 menupoints.add(bl); 70 71 } 72 basePage.setMenuPoints(menupoints); 73 } 74 75 } 76 | Popular Tags |