Search in sources :

Example 21 with IViewPart

use of org.eclipse.ui.IViewPart in project translationstudio8 by heartsome.

the class AcceptTerm5 method execute.

/** (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.heartsome.cat.ts.ui.term.view.termView");
    if (viewPart != null && viewPart instanceof ITermViewPart) {
        ITermViewPart matchView = (ITermViewPart) viewPart;
        matchView.acceptTermByIndex(4);
    }
    return null;
}
Also used : IViewPart(org.eclipse.ui.IViewPart) ITermViewPart(net.heartsome.cat.ts.ui.view.ITermViewPart)

Example 22 with IViewPart

use of org.eclipse.ui.IViewPart in project translationstudio8 by heartsome.

the class AcceptTerm7 method execute.

/** (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.heartsome.cat.ts.ui.term.view.termView");
    if (viewPart != null && viewPart instanceof ITermViewPart) {
        ITermViewPart matchView = (ITermViewPart) viewPart;
        matchView.acceptTermByIndex(6);
    }
    return null;
}
Also used : IViewPart(org.eclipse.ui.IViewPart) ITermViewPart(net.heartsome.cat.ts.ui.view.ITermViewPart)

Example 23 with IViewPart

use of org.eclipse.ui.IViewPart in project translationstudio8 by heartsome.

the class AcceptTerm8 method execute.

/** (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.heartsome.cat.ts.ui.term.view.termView");
    if (viewPart != null && viewPart instanceof ITermViewPart) {
        ITermViewPart matchView = (ITermViewPart) viewPart;
        matchView.acceptTermByIndex(7);
    }
    return null;
}
Also used : IViewPart(org.eclipse.ui.IViewPart) ITermViewPart(net.heartsome.cat.ts.ui.view.ITermViewPart)

Example 24 with IViewPart

use of org.eclipse.ui.IViewPart in project translationstudio8 by heartsome.

the class AcceptTerm9 method execute.

/** (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
public Object execute(ExecutionEvent event) throws ExecutionException {
    IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("net.heartsome.cat.ts.ui.term.view.termView");
    if (viewPart != null && viewPart instanceof ITermViewPart) {
        ITermViewPart matchView = (ITermViewPart) viewPart;
        matchView.acceptTermByIndex(8);
    }
    return null;
}
Also used : IViewPart(org.eclipse.ui.IViewPart) ITermViewPart(net.heartsome.cat.ts.ui.view.ITermViewPart)

Example 25 with IViewPart

use of org.eclipse.ui.IViewPart 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

IViewPart (org.eclipse.ui.IViewPart)95 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)52 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)38 IEditorPart (org.eclipse.ui.IEditorPart)31 PartInitException (org.eclipse.ui.PartInitException)25 IViewReference (org.eclipse.ui.IViewReference)23 IFile (org.eclipse.core.resources.IFile)15 ArrayList (java.util.ArrayList)14 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)14 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)14 IEditorInput (org.eclipse.ui.IEditorInput)11 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)10 IXliffEditor (net.heartsome.cat.ts.ui.editors.IXliffEditor)10 ITermViewPart (net.heartsome.cat.ts.ui.view.ITermViewPart)10 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)10 Shell (org.eclipse.swt.widgets.Shell)9 IEditorReference (org.eclipse.ui.IEditorReference)9 XLFHandler (net.heartsome.cat.ts.core.file.XLFHandler)8 XLIFFEditorImplWithNatTable (net.heartsome.cat.ts.ui.xliffeditor.nattable.editor.XLIFFEditorImplWithNatTable)8 IProject (org.eclipse.core.resources.IProject)8