本文整理汇总了Java中org.eclipse.jdt.internal.ui.refactoring.reorg.DeleteAction类的典型用法代码示例。如果您正苦于以下问题:Java DeleteAction类的具体用法?Java DeleteAction怎么用?Java DeleteAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DeleteAction类属于org.eclipse.jdt.internal.ui.refactoring.reorg包,在下文中一共展示了DeleteAction类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.jdt.internal.ui.refactoring.reorg.DeleteAction; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchPart part = HandlerUtil.getActivePart(event);
if(part instanceof CommonNavigator){
DeleteAction action=new DeleteAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite());
action.run();
}
else if (part instanceof ELTGraphicalEditor) {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
((ELTGraphicalEditor) editor).deleteSelection();
((ELTGraphicalEditor) editor).hideToolTip();
}
return null;
}
示例2: CCPActionGroup
import org.eclipse.jdt.internal.ui.refactoring.reorg.DeleteAction; //导入依赖的package包/类
/**
* Creates a new <code>CCPActionGroup</code>. The group requires that the selection provided by
* the given selection provider is of type {@link IStructuredSelection}.
*
* @param site the site that will own the action group.
* @param specialSelectionProvider the selection provider used instead of the sites selection
* provider.
* @param includeOnlyCopyActions <code>true</code> if the group only included the copy actions,
* <code>false</code> otherwise
* @since 3.7
*/
private CCPActionGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider, boolean includeOnlyCopyActions) {
fSelectionProvider= specialSelectionProvider == null ? site.getSelectionProvider() : specialSelectionProvider;
fCopyAction= new CopyToClipboardAction(site);
fCopyAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
fCopyQualifiedNameAction= new CopyQualifiedNameAction(site);
fCopyQualifiedNameAction.setActionDefinitionId(CopyQualifiedNameAction.ACTION_DEFINITION_ID);
if (!includeOnlyCopyActions) {
fPasteAction= new PasteAction(site);
fPasteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
fDeleteAction= new DeleteAction(site);
fDeleteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
fCutAction= new CutAction(site);
fCutAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_CUT);
fActions= new SelectionDispatchAction[] { fCutAction, fCopyAction, fCopyQualifiedNameAction, fPasteAction, fDeleteAction };
} else {
fPasteAction= null;
fDeleteAction= null;
fCutAction= null;
fActions= new SelectionDispatchAction[] { fCopyAction, fCopyQualifiedNameAction };
}
if (specialSelectionProvider != null) {
for (int i= 0; i < fActions.length; i++) {
fActions[i].setSpecialSelectionProvider(specialSelectionProvider);
}
}
registerActionsAsSelectionChangeListeners();
}