public Object execute(ExecutionEvent event) throws ExecutionException { ResourceBundle bundle = LogViewerPlugin.getDefault().getResourceBundle(); if (action == null) action = new FindReplaceAction(bundle,"dialog.findreplace.",(LogViewer)HandlerUtil.getActivePart(event)); action.run(); return null; }
/** * Creates a new find/replace action for the given workbench window. * The action configures its visual representation from the given * resource bundle. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys * (described in <code>ResourceAction</code> constructor), or * <code>null</code> if none * @param workbenchWindow the workbench window * @see ResourceAction#ResourceAction(ResourceBundle, String) * * @deprecated use FindReplaceAction(ResourceBundle, String, IWorkbenchPart) instead */ public FindReplaceAction(ResourceBundle bundle, String prefix, IWorkbenchWindow workbenchWindow) { super(bundle, prefix); fWorkbenchWindow= workbenchWindow; update(); }
private void contributeFindAction(MergeSourceViewer viewer) { IAction action; IWorkbenchPart wp = getCompareConfiguration().getContainer().getWorkbenchPart(); if (wp != null) action = new FindReplaceAction(getResourceBundle(), "Editor.FindReplace.", wp); //$NON-NLS-1$ else action = new FindReplaceAction(getResourceBundle(), "Editor.FindReplace.", viewer.getControl().getShell(), getFindReplaceTarget()); //$NON-NLS-1$ action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_REPLACE); viewer.addAction(MergeSourceViewer.FIND_ID, action); }
FindReplaceAction findReplaceAction = new FindReplaceAction(bundle, "find_replace_action_", this); //$NON-NLS-1$ findReplaceAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_REPLACE); setGlobalAction(ActionFactory.FIND.getId(), findReplaceAction);
public void update() { if(fShell == null){ if (fWorkbenchPart == null && fWorkbenchWindow != null) fWorkbenchPart= fWorkbenchWindow.getPartService().getActivePart(); if (fWorkbenchPart != null) fTarget= (IFindReplaceTarget) fWorkbenchPart.getAdapter(IFindReplaceTarget.class); else fTarget= null; } setEnabled(fTarget != null && fTarget.canPerformFind()); } }
private void contributeFindAction(MergeSourceViewer viewer) { IAction action; IWorkbenchPart wp = getCompareConfiguration().getContainer().getWorkbenchPart(); if (wp != null) action = new FindReplaceAction(getResourceBundle(), "Editor.FindReplace.", wp); //$NON-NLS-1$ else action = new FindReplaceAction(getResourceBundle(), "Editor.FindReplace.", viewer.getSourceViewer().getControl().getShell(), getFindReplaceTarget()); //$NON-NLS-1$ action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE); viewer.addAction(MergeSourceViewer.FIND_ID, action); }
@Override public void update() { if(fShell == null){ if (fWorkbenchPart == null && fWorkbenchWindow != null) fWorkbenchPart= fWorkbenchWindow.getPartService().getActivePart(); if (fWorkbenchPart != null) fTarget= fWorkbenchPart.getAdapter(IFindReplaceTarget.class); else fTarget= null; } setEnabled(fTarget != null && fTarget.canPerformFind()); } }
FindReplaceAction fraction = new FindReplaceAction(bundle, "find_replace_action_", fConsoleView); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(fraction, IConsoleHelpContextIds.CONSOLE_FIND_REPLACE_ACTION); setGlobalAction(actionBars, ActionFactory.FIND.getId(), fraction);
/** * Creates a new find/replace action for the given workbench window. * The action configures its visual representation from the given * resource bundle. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys * (described in <code>ResourceAction</code> constructor), or * <code>null</code> if none * @param workbenchWindow the workbench window * @see ResourceAction#ResourceAction(ResourceBundle, String) * * @deprecated use FindReplaceAction(ResourceBundle, String, IWorkbenchPart) instead */ @Deprecated public FindReplaceAction(ResourceBundle bundle, String prefix, IWorkbenchWindow workbenchWindow) { super(bundle, prefix); fWorkbenchWindow= workbenchWindow; update(); }
@Override public void update() { if(fShell == null){ if (fWorkbenchPart == null && fWorkbenchWindow != null) fWorkbenchPart= fWorkbenchWindow.getPartService().getActivePart(); if (fWorkbenchPart != null) fTarget= fWorkbenchPart.getAdapter(IFindReplaceTarget.class); else fTarget= null; } setEnabled(fTarget != null && fTarget.canPerformFind()); } }
FindReplaceAction fraction = new FindReplaceAction(bundle, "find_replace_action_", fConsoleView); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(fraction, IConsoleHelpContextIds.CONSOLE_FIND_REPLACE_ACTION); setGlobalAction(actionBars, ActionFactory.FIND.getId(), fraction);
/** * Creates a new find/replace action for the given workbench window. * The action configures its visual representation from the given * resource bundle. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys * (described in <code>ResourceAction</code> constructor), or * <code>null</code> if none * @param workbenchWindow the workbench window * @see ResourceAction#ResourceAction(ResourceBundle, String) * * @deprecated use FindReplaceAction(ResourceBundle, String, IWorkbenchPart) instead */ @Deprecated public FindReplaceAction(ResourceBundle bundle, String prefix, IWorkbenchWindow workbenchWindow) { super(bundle, prefix); fWorkbenchWindow= workbenchWindow; update(); }
IAction action = new FindReplaceAction(bundle, "find_replace_action_", getWorkbenchPartSite().getShell(), new FindReplaceTargetWrapper(fSourceViewer.getFindReplaceTarget())); //$NON-NLS-1$ action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE); PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IDebugHelpContextIds.DETAIL_PANE_FIND_REPLACE_ACTION);
/** * Creates a new find/replace action for the given workbench part. * <p> * The action configures its visual representation from the given * resource bundle.</p> * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys * (described in <code>ResourceAction</code> constructor), or * <code>null</code> if none * @param workbenchPart the workbench part * @see ResourceAction#ResourceAction(ResourceBundle, String) */ public FindReplaceAction(ResourceBundle bundle, String prefix, IWorkbenchPart workbenchPart) { super(bundle, prefix); Assert.isLegal(workbenchPart != null); fWorkbenchPart= workbenchPart; update(); }
setAction(ITextEditorActionConstants.PRINT, action); action= new FindReplaceAction(EditorMessages.getBundleForConstructedKeys(), "Editor.FindReplace.", this); //$NON-NLS-1$ action.setHelpContextId(IAbstractTextEditorHelpContextIds.FIND_ACTION); action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
/** * Creates a new find/replace action for the given workbench part. * <p> * The action configures its visual representation from the given * resource bundle.</p> * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys * (described in <code>ResourceAction</code> constructor), or * <code>null</code> if none * @param workbenchPart the workbench part * @see ResourceAction#ResourceAction(ResourceBundle, String) */ public FindReplaceAction(ResourceBundle bundle, String prefix, IWorkbenchPart workbenchPart) { super(bundle, prefix); Assert.isLegal(workbenchPart != null); fWorkbenchPart= workbenchPart; update(); }
setAction(ITextEditorActionConstants.PRINT, action); action= new FindReplaceAction(EditorMessages.getBundleForConstructedKeys(), "Editor.FindReplace.", this); //$NON-NLS-1$ action.setHelpContextId(IAbstractTextEditorHelpContextIds.FIND_ACTION); action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
/** * update all actions independent of their type * */ public void updateActions() { Iterator e= fActions.values().iterator(); while (e.hasNext()) { Object next = e.next(); if (next instanceof MergeViewerAction) { MergeViewerAction action = (MergeViewerAction) next; action.update(); } if (next instanceof FindReplaceAction) { FindReplaceAction action = (FindReplaceAction) next; action.update(); } } }
setAction(ITextEditorActionConstants.PRINT, action); action= new FindReplaceAction(EditorMessages.getBundleForConstructedKeys(), "Editor.FindReplace.", this); //$NON-NLS-1$ action.setHelpContextId(IAbstractTextEditorHelpContextIds.FIND_ACTION); action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_REPLACE);
/** * Creates a new find/replace action for the given workbench part. * <p> * The action configures its visual representation from the given * resource bundle.</p> * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys * (described in <code>ResourceAction</code> constructor), or * <code>null</code> if none * @param workbenchPart the workbench part * @see ResourceAction#ResourceAction(ResourceBundle, String) */ public FindReplaceAction(ResourceBundle bundle, String prefix, IWorkbenchPart workbenchPart) { super(bundle, prefix); Assert.isLegal(workbenchPart != null); fWorkbenchPart= workbenchPart; update(); }