KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > processor > core > Bookmark


1 /*
2  * $Header: /home/cvs/jakarta-slide/projector/src/java/org/apache/slide/projector/processor/core/Bookmark.java,v 1.3 2004/07/28 09:48:15 ib Exp $
3  * $Revision: 1.3 $
4  * $Date: 2004/07/28 09:48:15 $
5  *
6  * ====================================================================
7  *
8  * Copyright 2004 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.projector.processor.core;
25
26 import java.util.Map JavaDoc;
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 /**
39  * The Event class
40  *
41  */

42 public class Bookmark implements Processor {
43     public final static String JavaDoc 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 JavaDoc parameter, Context context) throws Exception JavaDoc {
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