From: <man...@us...> - 2009-12-08 13:09:30
|
Revision: 1335 http://j-trac.svn.sourceforge.net/j-trac/?rev=1335&view=rev Author: manfredwolff Date: 2009-12-08 13:09:21 +0000 (Tue, 08 Dec 2009) Log Message: ----------- Commit for future use (individual head panel). Added Paths: ----------- trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java Added: trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html (rev 0) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.html 2009-12-08 13:09:21 UTC (rev 1335) @@ -0,0 +1,8 @@ +<wicket:panel> + <table width="100%" class="jtrac alt" padding="4"> + <tr> + <td width="2%" align="left"><img height="55px" wicket:id="icon"/></td> + <td align="left"><b><div wicket:id="message">[text goes here]</div></b></td> + </tr> + </table> +</wicket:panel> \ No newline at end of file Added: trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java (rev 0) +++ trunk/jtrac/src/main/java/info/jtrac/wicket/IndividualHeadPanel.java 2009-12-08 13:09:21 UTC (rev 1335) @@ -0,0 +1,65 @@ +/* + * Copyright 2002-2005 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package info.jtrac.wicket; + +import java.util.Map; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.image.Image; +import org.apache.wicket.model.AbstractReadOnlyModel; + + +/** + * header navigation + */ +public class IndividualHeadPanel extends BasePanel { + + /** + * Default serialVersionID. + */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + */ + public IndividualHeadPanel() { + super("individuel"); + + final Map<String, String> configMap = getJtrac().loadAllConfig(); + Image img= new Image( "icon"); + img.add(new AttributeModifier("src", true, new AbstractReadOnlyModel() { + private static final long serialVersionUID = 1L; + public final Object getObject() { + // based on some condition return the image source + String url = configMap.get("jtrac.header.picture"); + if ((url == null) ||("".equals(url))) + return "../resources/jtrac-logo.gif"; + else + return url; + } + })); + add(img); + String message = configMap.get("jtrac.header.text"); + if ((message == null) ||("".equals(message))) + add(new Label("message", "JTrac - Open Source Issue Tracking System")); + else if ((message != null) && ("no".equals(message))) + add(new Label("message", "")); + else + add(new Label("message", message)); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |