User: ko5tik Date: 02/04/07 06:49:14 Added: src/java/xdocletgui/swing/editor CommentaryEditorPanel.java Log: first editor panel alive and kicking! Revision Changes Path 1.1 xdocletgui/src/java/xdocletgui/swing/editor/CommentaryEditorPanel.java Index: CommentaryEditorPanel.java =================================================================== /* * Copyright (c) 2001, Aslak Hellesøy, BEKK Consulting * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of BEKK Consulting nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ /* * Change log * */ package xdocletgui.swing.editor; import javax.swing.*; import java.awt.*; import xjavadoc.XDoc; import xdocletgui.swing.DocTreeNode; /** * comment editor panel. * * @author kostik * @created April 7, 2002 */ public class CommentaryEditorPanel extends JPanel { /** * text area for text editing */ JTextArea _docText; /** * label for program element description */ JLabel _description; /** * Get static reference to Log4J Logger */ private static org.apache.log4j.Category _log = org.apache.log4j.Category.getInstance(CommentaryEditorPanel.class.getName()); /** * Describe what the CommentaryEditorPanel constructor does * * @todo-javadoc Write javadocs for constructor */ public CommentaryEditorPanel() { super(new BorderLayout()); setBorder(BorderFactory.createTitledBorder("Program element description")); _description = new JLabel(); add(_description, BorderLayout.NORTH); _docText = new JTextArea(); JScrollPane _scp = new JScrollPane(_docText); add(_scp, BorderLayout.CENTER); } /** * Sets the Doc attribute of the CommentaryEditorPanel object * * @param node The new Doc value */ public void setDoc(DocTreeNode node) { XDoc xdoc = node.getXDoc(); _log.debug("set text: " + xdoc.commentText()); _docText.setText(xdoc.commentText()); // get parent _description.setText("Description for " + node.getParent().toString()); } }
_______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel