KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > comment > JavaDocLine


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.jdt.internal.ui.text.comment;
13
14 /**
15  * Javadoc comment line in a comment region.
16  *
17  * @since 3.0
18  */

19 public class JavaDocLine extends MultiCommentLine {
20
21     /** Line prefix of javadoc start lines */
22     public static final String JavaDoc JAVADOC_START_PREFIX= "/**"; //$NON-NLS-1$
23

24     /**
25      * Creates a new javadoc line.
26      *
27      * @param region
28      * Comment region to create the line for
29      */

30     protected JavaDocLine(final CommentRegion region) {
31         super(region);
32     }
33
34     /**
35      * @inheritDoc
36      */

37     protected void formatUpperBorder(final CommentRange range, final String JavaDoc indentation, final int length) {
38
39         final CommentRegion parent= getParent();
40
41         if (parent.isSingleLine() && parent.getSize() == 1) {
42             parent.logEdit(getStartingPrefix() + CommentRegion.COMMENT_RANGE_DELIMITER, 0, range.getOffset());
43         } else
44             super.formatUpperBorder(range, indentation, length);
45     }
46
47     /**
48      * @inheritDoc
49      */

50     protected String JavaDoc getStartingPrefix() {
51         return JAVADOC_START_PREFIX;
52     }
53 }
54
Popular Tags