KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > gui > dialog > DialogLink


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2005 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.gui.dialog;
14
15 import info.magnolia.cms.beans.config.ContentRepository;
16 import info.magnolia.cms.core.Content;
17 import info.magnolia.cms.i18n.MessagesManager;
18
19 import javax.jcr.RepositoryException;
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21 import javax.servlet.http.HttpServletResponse JavaDoc;
22
23
24 /**
25  * @author Vinzenz Wyser
26  * @version 2.0
27  */

28 public class DialogLink extends DialogEditWithButton {
29
30     /**
31      * Empty constructor should only be used by DialogFactory.
32      */

33     protected DialogLink() {
34     }
35
36     /**
37      * @see info.magnolia.cms.gui.dialog.DialogInterface#init(HttpServletRequest, HttpServletResponse, Content, Content)
38      */

39     public void init(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, Content websiteNode, Content configNode)
40         throws RepositoryException {
41         super.init(request, response, websiteNode, configNode);
42         String JavaDoc extension = this.getConfigValue("extension"); //$NON-NLS-1$
43
String JavaDoc label = MessagesManager.get(this.getRequest(), "dialog.link.internal"); //$NON-NLS-1$
44
this.getButton().setLabel(label);
45         this.getButton().setSaveInfo(false);
46         String JavaDoc repository = this.getConfigValue("repository", ContentRepository.WEBSITE); //$NON-NLS-1$
47
this.getButton().setOnclick(
48             "mgnlDialogLinkOpenBrowser('" + this.getName() + "','" + repository + "','" + extension + "');"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
49
}
50
51 }
52
Popular Tags