本文整理匯總了Java中org.eclipse.jdt.internal.ui.javaeditor.ToggleCommentAction類的典型用法代碼示例。如果您正苦於以下問題:Java ToggleCommentAction類的具體用法?Java ToggleCommentAction怎麽用?Java ToggleCommentAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ToggleCommentAction類屬於org.eclipse.jdt.internal.ui.javaeditor包,在下文中一共展示了ToggleCommentAction類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createActions
import org.eclipse.jdt.internal.ui.javaeditor.ToggleCommentAction; //導入依賴的package包/類
protected void createActions() {
super.createActions();
// Add content assist propsal action
ContentAssistAction action = new ContentAssistAction(Plugin
.getDefault().getResourceBundle(),
"VelocityEditor.ContentAssist", this);
action
.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
setAction("Velocity.ContentAssist", action);
action.setEnabled(true);
// add toggle comment action
ToggleCommentAction toggleCommentAction = new ToggleCommentAction(Plugin
.getDefault().getResourceBundle(),
"VelocityEditor.ToggleComment", this);
toggleCommentAction.configure(getSourceViewer(), getSourceViewerConfiguration());
setAction("Velocity.ToggleComment", toggleCommentAction );
toggleCommentAction.setEnabled(true);
}
示例2: createActions
import org.eclipse.jdt.internal.ui.javaeditor.ToggleCommentAction; //導入依賴的package包/類
@Override
protected void createActions() {
super.createActions();
IAction action= new ToggleCommentAction(PropertiesFileEditorMessages.getBundleForConstructedKeys(), "ToggleComment.", this); //$NON-NLS-1$
action.setActionDefinitionId(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT);
setAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT, action);
markAsStateDependentAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT, true);
PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.TOGGLE_COMMENT_ACTION);
configureToggleCommentAction();
fOpenAction= new OpenAction(this);
fOpenAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
setAction(JdtActionConstants.OPEN, fOpenAction);
}
示例3: configureToggleCommentAction
import org.eclipse.jdt.internal.ui.javaeditor.ToggleCommentAction; //導入依賴的package包/類
/**
* Configures the toggle comment action.
*
* @since 3.4
*/
private void configureToggleCommentAction() {
IAction action= getAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT);
if (action instanceof ToggleCommentAction) {
ISourceViewer sourceViewer= getSourceViewer();
SourceViewerConfiguration configuration= getSourceViewerConfiguration();
((ToggleCommentAction)action).configure(sourceViewer, configuration);
}
}