/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
/**
* Action that encloses the editor's current selection with Java block comment terminators (<code>/*</code> and
* <code>*/</code>).
- *
+ *
* @since 3.0
- */
+ */
public class AddBlockCommentAction extends BlockCommentAction {
/**
* Creates a new instance.
- *
+ *
* @param bundle
* the resource bundle
* @param prefix
/**
* Handle the first partition of the selected text.
- *
+ *
* @param partition
* @param edits
* @param factory
/**
* Handles the end of the given partition and the start of the next partition, which is returned.
- *
+ *
* @param partition
* @param edits
* @param factory
if (wasJavadoc) {
// if previous was javadoc, and the current one is not, then add block comment start
- if (partType == IDocument.DEFAULT_CONTENT_TYPE ||
+ if (partType == IDocument.DEFAULT_CONTENT_TYPE ||
partType == PHPDocumentPartitioner.PHP_SCRIPT_CODE ||
isSpecialPartition(partType)) {
edits.add(factory.createEdit(partition.getOffset(), 0, getCommentStart()));
/**
* Handles the end of the last partition.
- *
+ *
* @param partition
* @param edits
* @param factory
/**
* Returns whether <code>partType</code> is special, i.e. a Java <code>String</code>,<code>Character</code>, or
* <code>Line End Comment</code> partition.
- *
+ *
* @param partType
* the partition type to check
* @return <code>true</code> if <code>partType</code> is special, <code>false</code> otherwise
*/
private boolean isSpecialPartition(String partType) {
// return partType == IJavaPartitions.JAVA_CHARACTER
- return partType == IPHPPartitions.PHP_STRING_DQ || partType == IPHPPartitions.PHP_STRING_SQ
+ return partType == IPHPPartitions.PHP_STRING_DQ || partType == IPHPPartitions.PHP_STRING_SQ || partType == IPHPPartitions.PHP_STRING_HEREDOC
|| partType == IPHPPartitions.PHP_SINGLELINE_COMMENT;
}