Java 类org.eclipse.ui.texteditor.FindReplaceAction 实例源码

项目:logan    文件:FindReplaceHandler.java   
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
  try {
    InputStream in = null;
    String resource = "plugin.properties"; //$NON-NLS-1$
    ClassLoader loader = this.getClass().getClassLoader();
    if (loader != null) {
      in = loader.getResourceAsStream(resource);
    }
    else {
      in = ClassLoader.getSystemResourceAsStream(resource);
    }

    IWorkbenchPart part = HandlerUtil.getActivePart(event);
    FindReplaceAction findReplaceAction = new FindReplaceAction(new PropertyResourceBundle(in), null, part);
    ActionHandler actionHandler = new ActionHandler(findReplaceAction);

    return actionHandler.execute(event);
  } catch (Exception e) {
    throw new ExecutionException("Could not execute command!", e); //$NON-NLS-1$
  }
}
项目:eclipse-rbe    文件:I18nPageEditor.java   
@Override
public void createPartControl( Composite parent ) {
    _i18nPage = new I18nPage(parent, SWT.NONE, _resourceMediator);

    _findReplaceAction = new FindReplaceAction(RBEPlugin.getDefault().getResourceBundle(), null, _i18nPage.getShell(), _i18nPage.getReplaceTarget()) {
        @Override
        public void run() {
            _i18nPage.findActionStart();
            super.run();
        }
    };

    _findNextAction = new FindNextAction(RBEPlugin.getDefault().getResourceBundle(), null, this, true){
        @Override
        public void run() {
            _i18nPage.findActionStart();
            super.run();
        }
    };
    _findNextAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_NEXT);

    _findPreviousAction = new FindNextAction(RBEPlugin.getDefault().getResourceBundle(), null, this, false){
        @Override
        public void run() {
            _i18nPage.findActionStart();
            super.run();
        }
    };
    _findPreviousAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_PREVIOUS);
}