KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > navigation > NavigationParams


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.navigation;
17
18 import org.outerj.daisy.repository.VariantKey;
19
20 public class NavigationParams {
21     private final VariantKey navigationDoc;
22     private final NavigationVersionMode versionMode;
23     private final String JavaDoc activePath;
24     private final boolean contextualized;
25
26     /**
27      * @param navigationDoc key of the repository document containing the navigation description
28      * @param versionMode indicates whether the live or last versions of documents should be used
29      * (applies to both the navigation tree documents themselves, as to the document
30      * nodes and query results).
31      * @param activePath a path in the form "<id>/<id>/<id>" leading to the active
32      * node. This attribute is optional and can be null. This can be used to make
33      * sure the expected (i.e. clicked) node is marked as selected when the activeDocument
34      * occurs at more then one location in the tree, or to highlight a non-document node.
35      * The implementation must be able to handle the case where the activePath does not exist,
36      * in which case the activeDocument parameter will be used to highlight the first occurence
37      * of that document in the tree (if activeDocument != -1).
38      * @param contextualized indicates whether to produce a limited navigation tree only showing
39      * the nodes leading to the activePath, or a full navigation tree
40      * including all nodes
41      */

42     public NavigationParams(VariantKey navigationDoc, NavigationVersionMode versionMode, String JavaDoc activePath, boolean contextualized) {
43         this.navigationDoc = navigationDoc;
44         this.versionMode = versionMode;
45         this.activePath = activePath;
46         this.contextualized = contextualized;
47     }
48
49     public NavigationParams(VariantKey navigationDoc, String JavaDoc activePath, boolean contextualized) {
50         this(navigationDoc, NavigationVersionMode.LIVE, activePath, contextualized);
51     }
52
53     public VariantKey getNavigationDoc() {
54         return navigationDoc;
55     }
56
57     public NavigationVersionMode getVersionMode() {
58         return versionMode;
59     }
60
61     public String JavaDoc getActivePath() {
62         return activePath;
63     }
64
65     public boolean getContextualized() {
66         return contextualized;
67     }
68 }
69
Popular Tags