1 23 24 package org.apache.slide.projector.processor.core; 25 26 import java.util.Map ; 27 28 import org.apache.slide.projector.Context; 29 import org.apache.slide.projector.Processor; 30 import org.apache.slide.projector.Result; 31 import org.apache.slide.projector.URI; 32 import org.apache.slide.projector.descriptor.ParameterDescriptor; 33 import org.apache.slide.projector.descriptor.ResultDescriptor; 34 import org.apache.slide.projector.descriptor.StateDescriptor; 35 import org.apache.slide.projector.descriptor.URIValueDescriptor; 36 import org.apache.slide.projector.i18n.ParameterMessage; 37 38 42 public class Bookmark implements Processor { 43 public final static String BOOKMARK = "bookmark"; 44 45 private final static ParameterDescriptor[] parameterDescriptors = new ParameterDescriptor[] { 46 new ParameterDescriptor(BOOKMARK, new ParameterMessage("bookmark/parameter/bookmark"), new URIValueDescriptor()) 47 }; 48 private final static ResultDescriptor resultDescriptor = new ResultDescriptor(new StateDescriptor[] { StateDescriptor.OK_DESCRIPTOR }); 49 50 public Result process(Map parameter, Context context) throws Exception { 51 URI bookmarkUri = (URI)parameter.get(BOOKMARK); 52 context.setBookmark(bookmarkUri); 53 return Result.OK; 54 } 55 56 public ParameterDescriptor[] getParameterDescriptors() { 57 return parameterDescriptors; 58 } 59 60 public ResultDescriptor getResultDescriptor() { 61 return resultDescriptor; 62 } 63 } 64 | Popular Tags |