📄 compilationunitrootdirective.java
字号:
/**
* Copyright (c) 2003-2005 Craig Setera
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*/
package eclipseme.core.internal.preprocessor.directive;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.dom.Comment;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import eclipseme.core.internal.preprocessor.Directive;
import eclipseme.core.internal.preprocessor.ProcessingState;
import eclipseme.core.model.SymbolDefinitionSet;
/**
* A dummy directive that acts as a container for the
* entire class file content. This directive is always
* enabled and can act as a container for the rest of the
* directives.
* <p />
* Copyright (c) 2003-2005 Craig Setera<br>
* All Rights Reserved.<br>
* Licensed under the Eclipse Public License - v 1.0<p/>
* <br>
* $Revision: 1.2 $
* <br>
* $Date: 2006/11/12 01:11:01 $
* <br>
* @author Craig Setera
*/
public class CompilationUnitRootDirective extends AbstractStartDirective {
/**
* Construct a new instance.
*
* @param compilationUnit
* @param comment
* @param commentText
*/
public CompilationUnitRootDirective(
IResource resource,
Comment comment,
String commentText)
{
super(resource, comment, commentText);
}
/**
* @see eclipseme.core.internal.preprocessor.Directive#execute(ProcessingState, org.eclipse.core.runtime.IProgressMonitor)
*/
public void execute(ProcessingState processingState, IProgressMonitor monitor)
throws CoreException
{
Directive[] children = getChildren();
for (int i = 0; i < children.length; i++) {
children[i].execute(processingState, monitor);
}
}
/**
* @see eclipseme.core.internal.preprocessor.Directive#getRegion()
*/
public IRegion getRegion()
throws CoreException
{
// Cheating here because it should never be used.
return new Region(0, 0);
}
/**
* @see eclipseme.core.internal.preprocessor.Directive#getType()
*/
public int getType() {
// A dummy type value
return -1;
}
/**
* @see eclipseme.core.internal.preprocessor.Directive#isEnabled(eclipseme.core.model.SymbolDefinitionSet, org.eclipse.core.runtime.IProgressMonitor)
*/
public boolean isEnabled(SymbolDefinitionSet identifiers, IProgressMonitor monitor) {
// The root is always enabled
return true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -