Search in sources :

Example 1 with BrowserViewPart

use of net.heartsome.cat.ts.websearch.ui.view.BrowserViewPart in project translationstudio8 by heartsome.

the class WebSearchHandler method execute.

/** (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    IEditorPart editor = HandlerUtil.getActiveEditor(event);
    String selectPureText = "";
    if (editor instanceof IXliffEditor) {
        IXliffEditor xliffEditor = (IXliffEditor) editor;
        selectPureText = xliffEditor.getSelectPureText();
    }
    try {
        IViewPart showView = getActivePage().showView(BrowserViewPart.ID);
        if (showView instanceof BrowserViewPart) {
            BrowserViewPart browserViewPart = (BrowserViewPart) showView;
            browserViewPart.setKeyWord(selectPureText, true);
        }
    } catch (PartInitException e) {
        e.printStackTrace();
        logger.error("", e);
    }
    return null;
}
Also used : IViewPart(org.eclipse.ui.IViewPart) BrowserViewPart(net.heartsome.cat.ts.websearch.ui.view.BrowserViewPart) IEditorPart(org.eclipse.ui.IEditorPart) PartInitException(org.eclipse.ui.PartInitException) IXliffEditor(net.heartsome.cat.ts.ui.editors.IXliffEditor)

Aggregations

IXliffEditor (net.heartsome.cat.ts.ui.editors.IXliffEditor)1 BrowserViewPart (net.heartsome.cat.ts.websearch.ui.view.BrowserViewPart)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IViewPart (org.eclipse.ui.IViewPart)1 PartInitException (org.eclipse.ui.PartInitException)1