本文整理汇总了Java中org.eclipse.jface.action.Action.setActionDefinitionId方法的典型用法代码示例。如果您正苦于以下问题:Java Action.setActionDefinitionId方法的具体用法?Java Action.setActionDefinitionId怎么用?Java Action.setActionDefinitionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.action.Action
的用法示例。
在下文中一共展示了Action.setActionDefinitionId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContentAssistActionHandler
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private ActionHandler createContentAssistActionHandler(
final ITextOperationTarget textOperationTarget) {
Action proposalAction = new Action() {
@Override
public void run() {
if (textOperationTarget
.canDoOperation(ISourceViewer.CONTENTASSIST_PROPOSALS)
&& getTextWidget().isFocusControl())
textOperationTarget
.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
}
};
proposalAction
.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
return new ActionHandler(proposalAction);
}
示例2: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
protected void createActions()
{
super.createActions();
setAction(FilterThroughCommandAction.COMMAND_ID, FilterThroughCommandAction.create(this));
this.fThemeableEditorFindBarExtension.createFindBarActions();
// Code formatter setup
Action action = new TextOperationAction(Messages.getBundleForConstructedKeys(),
"Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
action.setActionDefinitionId(ICommonConstants.FORMATTER_ACTION_DEFINITION_ID);
setAction(ICommonConstants.FORMATTER_ACTION_ID, action);
markAsStateDependentAction(ICommonConstants.FORMATTER_ACTION_ID, true);
markAsSelectionDependentAction(ICommonConstants.FORMATTER_ACTION_ID, true);
// Folding setup
foldingActionsGroup = new FoldingActionsGroup(this);
}
示例3: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
cutAction = new Action() {
@Override
public void run() {
WorkingFolderDataTable.this.cutSelectionToClipboard();
}
};
cutAction.setText(Messages.getString("WorkingFolderDataTable.CutActionText")); //$NON-NLS-1$
cutAction.setActionDefinitionId(CommandIDs.CUT);
copyAction = new Action() {
@Override
public void run() {
WorkingFolderDataTable.this.copySelectionToClipboard();
}
};
copyAction.setText(Messages.getString("WorkingFolderDataTable.CopyActionText")); //$NON-NLS-1$
copyAction.setActionDefinitionId("org.eclipse.ui.edit.copy"); //$NON-NLS-1$
pasteAction = new Action() {
@Override
public void run() {
WorkingFolderDataTable.this.pasteFromClipboard();
}
};
pasteAction.setText(Messages.getString("WorkingFolderDataTable.PasteActionText")); //$NON-NLS-1$
pasteAction.setActionDefinitionId(CommandIDs.PASTE);
deleteAction = new Action() {
@Override
public void run() {
WorkingFolderDataTable.this.removeSelectedWorkingFolders();
}
};
deleteAction.setText(Messages.getString("WorkingFolderDataTable.DeleteActionText")); //$NON-NLS-1$
deleteAction.setAccelerator(SWT.DEL);
deleteAction.setActionDefinitionId(CommandIDs.DELETE);
selectAllAction = new Action() {
@Override
public void run() {
WorkingFolderDataTable.this.selectAll();
}
};
selectAllAction.setText(Messages.getString("WorkingFolderDataTable.SelectAllActionText")); //$NON-NLS-1$
selectAllAction.setActionDefinitionId(CommandIDs.SELECT_ALL);
new ActionValidatorBinding(new IAction[] {
cutAction,
copyAction,
deleteAction
}).bind(getSelectionValidator());
/*
* IMPORTANT: this keybinding support is only appropriate for
* dialogs/wizards. If this control is ever hosted in a view or editor
* (or standalone in a SWT/JFace application outside the workbench) then
* this support will need to be made optional instead of hardcoded.
*/
actionCommandSupport = ActionKeyBindingSupportFactory.newInstance(getShell());
actionCommandSupport.addAction(cutAction);
actionCommandSupport.addAction(copyAction);
actionCommandSupport.addAction(pasteAction);
actionCommandSupport.addAction(selectAllAction);
}
示例4: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
copyAction = new Action() {
@Override
public void run() {
ShelvesetsTable.this.copySelectionToClipboard();
}
};
copyAction.setText(Messages.getString("ShelvesetsTable.Copy")); //$NON-NLS-1$
copyAction.setActionDefinitionId("org.eclipse.ui.edit.copy"); //$NON-NLS-1$
selectAllAction = new Action() {
@Override
public void run() {
ShelvesetsTable.this.selectAll();
}
};
selectAllAction.setText(Messages.getString("ShelvesetsTable.SelectAll")); //$NON-NLS-1$
selectAllAction.setActionDefinitionId(CommandIDs.SELECT_ALL);
/*
* IMPORTANT: this keybinding support is only appropriate for
* dialogs/wizards. If this control is ever hosted in a view or editor
* (or standalone in a SWT/JFace application outside the workbench) then
* this support will need to be made optional instead of hardcoded.
*/
actionCommandSupport = ActionKeyBindingSupportFactory.newInstance(getShell());
actionCommandSupport.addAction(copyAction);
actionCommandSupport.addAction(selectAllAction);
}
示例5: createQuickFixActionHandler
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private ActionHandler createQuickFixActionHandler(
final ITextOperationTarget textOperationTarget) {
Action quickFixAction = new Action() {
@Override
public void run() {
textOperationTarget.doOperation(ISourceViewer.QUICK_ASSIST);
}
};
quickFixAction
.setActionDefinitionId(ITextEditorActionDefinitionIds.QUICK_ASSIST);
return new ActionHandler(quickFixAction);
}
示例6: createActions
import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
@Override
protected void createActions() {
super.createActions();
Action action = new GotoMatchingBracketAction(this);
action.setActionDefinitionId(ITypeScriptEditorActionDefinitionIds.GOTO_MATCHING_BRACKET);
setAction(GotoMatchingBracketAction.GOTO_MATCHING_BRACKET, action);
/*
* action= new
* AddBlockCommentAction(TypeScriptEditorMessages.getResourceBundle(),
* "AddBlockComment.", this); //$NON-NLS-1$
* action.setActionDefinitionId(IJavaEditorActionDefinitionIds.
* ADD_BLOCK_COMMENT); setAction("AddBlockComment", action);
* //$NON-NLS-1$ markAsStateDependentAction("AddBlockComment", true);
* //$NON-NLS-1$ markAsSelectionDependentAction("AddBlockComment",
* true); //$NON-NLS-1$
* PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
* IJavaHelpContextIds.ADD_BLOCK_COMMENT_ACTION);
*
* action= new
* RemoveBlockCommentAction(TypeScriptEditorMessages.getResourceBundle()
* , "RemoveBlockComment.", this); //$NON-NLS-1$
* action.setActionDefinitionId(IJavaEditorActionDefinitionIds.
* REMOVE_BLOCK_COMMENT); setAction("RemoveBlockComment", action);
* //$NON-NLS-1$ markAsStateDependentAction("RemoveBlockComment", true);
* //$NON-NLS-1$ markAsSelectionDependentAction("RemoveBlockComment",
* true); //$NON-NLS-1$
* PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
* IJavaHelpContextIds.REMOVE_BLOCK_COMMENT_ACTION);
*/
}