| 1 |
// |
|---|
| 2 |
// =========================================================================== |
|---|
| 3 |
// |
|---|
| 4 |
// Title: Header.java |
|---|
| 5 |
// Description: Somehwat similar to javadoc |
|---|
| 6 |
// Author: Raphal Szwarc <zoe (underscore) info (at) mac (dot) com> |
|---|
| 7 |
// Creation Date: Thu Dec 09 2004 |
|---|
| 8 |
// Legal: Copyright (C) 2004 Raphal Szwarc |
|---|
| 9 |
// |
|---|
| 10 |
// This software is provided 'as-is', without any express or implied warranty. |
|---|
| 11 |
// In no event will the author be held liable for any damages arising from |
|---|
| 12 |
// the use of this software. |
|---|
| 13 |
// |
|---|
| 14 |
// Permission is granted to anyone to use this software for any purpose, |
|---|
| 15 |
// including commercial applications, and to alter it and |
|---|
| 16 |
// redistribute it freely, subject to the following restrictions: |
|---|
| 17 |
// |
|---|
| 18 |
// 1. The origin of this software must not be misrepresented; |
|---|
| 19 |
// you must not claim that you wrote the original software. |
|---|
| 20 |
// If you use this software in a product, an acknowledgment |
|---|
| 21 |
// in the product documentation would be appreciated but is not required. |
|---|
| 22 |
// |
|---|
| 23 |
// 2. Altered source versions must be plainly marked as such, |
|---|
| 24 |
// and must not be misrepresented as being the original software. |
|---|
| 25 |
// |
|---|
| 26 |
// 3. This notice may not be removed or altered from any source distribution. |
|---|
| 27 |
// |
|---|
| 28 |
// --------------------------------------------------------------------------- |
|---|
| 29 |
// |
|---|
| 30 |
|
|---|
| 31 |
package alt.dev.dydoc; |
|---|
| 32 |
|
|---|
| 33 |
import java.util.Map; |
|---|
| 34 |
import java.util.HashMap; |
|---|
| 35 |
|
|---|
| 36 |
import alt.dev.szapp.SZComponent; |
|---|
| 37 |
import alt.dev.szapp.SZContext; |
|---|
| 38 |
import alt.dev.szapp.SZTemplate; |
|---|
| 39 |
|
|---|
| 40 |
import alt.dev.szfoundation.SZLog; |
|---|
| 41 |
|
|---|
| 42 |
public class Header extends Component |
|---|
| 43 |
{ |
|---|
| 44 |
|
|---|
| 45 |
// =========================================================================== |
|---|
| 46 |
// Constant(s) |
|---|
| 47 |
// --------------------------------------------------------------------------- |
|---|
| 48 |
|
|---|
| 49 |
// =========================================================================== |
|---|
| 50 |
// Class variable(s) |
|---|
| 51 |
// --------------------------------------------------------------------------- |
|---|
| 52 |
|
|---|
| 53 |
// =========================================================================== |
|---|
| 54 |
// Instance variable(s) |
|---|
| 55 |
// --------------------------------------------------------------------------- |
|---|
| 56 |
|
|---|
| 57 |
// =========================================================================== |
|---|
| 58 |
// Constructor method(s) |
|---|
| 59 |
// --------------------------------------------------------------------------- |
|---|
| 60 |
|
|---|
| 61 |
protected Header(final SZContext aContext, final SZComponent aParent, final Map someBindings) |
|---|
| 62 |
{ |
|---|
| 63 |
super( aContext, aParent, someBindings ); |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
// =========================================================================== |
|---|
| 67 |
// Class method(s) |
|---|
| 68 |
// --------------------------------------------------------------------------- |
|---|
| 69 |
|
|---|
| 70 |
// =========================================================================== |
|---|
| 71 |
// Instance method(s) |
|---|
| 72 |
// --------------------------------------------------------------------------- |
|---|
| 73 |
|
|---|
| 74 |
// =========================================================================== |
|---|
| 75 |
// Display method(s) |
|---|
| 76 |
// --------------------------------------------------------------------------- |
|---|
| 77 |
|
|---|
| 78 |
protected SZComponent path() |
|---|
| 79 |
{ |
|---|
| 80 |
Map someBindings = new HashMap(); |
|---|
| 81 |
|
|---|
| 82 |
someBindings.put( "values", this.valueForBinding( "pathComponents" ) ); |
|---|
| 83 |
|
|---|
| 84 |
return new Path( this.context(), this, someBindings ); |
|---|
| 85 |
} |
|---|
| 86 |
|
|---|
| 87 |
public String toString() |
|---|
| 88 |
{ |
|---|
| 89 |
SZTemplate aTemplate = this.template(); |
|---|
| 90 |
|
|---|
| 91 |
aTemplate.set( "path", this.path() ); |
|---|
| 92 |
aTemplate.set( "navigation", this.valueForBinding( "navigation" ) ); |
|---|
| 93 |
|
|---|
| 94 |
return aTemplate.toString(); |
|---|
| 95 |
} |
|---|
| 96 |
|
|---|
| 97 |
} |
|---|