1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Removed use of a deprecated class.

This commit is contained in:
Sergey Prigogin 2010-09-11 22:47:19 +00:00
parent fec2b53d77
commit b54140929c
2 changed files with 13 additions and 23 deletions

View file

@ -68,8 +68,7 @@ public class CNavigatorEditActionGroup extends ActionGroup {
@Override @Override
public void fillContextMenu(IMenuManager menu) { public void fillContextMenu(IMenuManager menu) {
IStructuredSelection selection = (IStructuredSelection) getContext() IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
.getSelection();
boolean anyResourceSelected = !selection.isEmpty() boolean anyResourceSelected = !selection.isEmpty()
&& ResourceSelectionUtil.allResourcesAreOfType(selection, && ResourceSelectionUtil.allResourcesAreOfType(selection,
@ -100,12 +99,9 @@ public class CNavigatorEditActionGroup extends ActionGroup {
updateActionBars(); updateActionBars();
// textActionHandler.updateActionBars(); // textActionHandler.updateActionBars();
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
copyAction); actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
pasteAction);
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
deleteAction);
} }
protected void makeActions() { protected void makeActions() {
@ -114,31 +110,25 @@ public class CNavigatorEditActionGroup extends ActionGroup {
pasteAction = new PasteAction(shell, clipboard); pasteAction = new PasteAction(shell, clipboard);
ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
pasteAction.setDisabledImageDescriptor(images pasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED)); pasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
pasteAction.setImageDescriptor(images
.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
pasteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE); pasteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
copyAction = new CopyAction(shell, clipboard, pasteAction); copyAction = new CopyAction(shell, clipboard, pasteAction);
copyAction.setDisabledImageDescriptor(images copyAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); copyAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
copyAction.setImageDescriptor(images
.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
copyAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY); copyAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
deleteAction = new DeleteResourceAction(shellProvider); deleteAction = new DeleteResourceAction(shellProvider);
deleteAction.setDisabledImageDescriptor(images deleteAction.setDisabledImageDescriptor(
.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
deleteAction.setImageDescriptor(images deleteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
deleteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE); deleteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
} }
@Override @Override
public void updateActionBars() { public void updateActionBars() {
IStructuredSelection selection = (IStructuredSelection) getContext() IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
.getSelection();
copyAction.selectionChanged(selection); copyAction.selectionChanged(selection);
pasteAction.selectionChanged(selection); pasteAction.selectionChanged(selection);