Search in sources :

Example 1 with WorkbenchContentsFinder

use of org.eclipse.swtbot.eclipse.finder.finders.WorkbenchContentsFinder in project translationstudio8 by heartsome.

the class XlfEditor method getAllRowIds.

/**
	 * @return List<String> 当前文件中所有文本段的 RowID,合并、分割文本段后应重新获取 (每个 RowID 由 XLIFF 文件路径、源文件路径、trans-unit ID 组成)
	 */
public List<String> getAllRowIds() {
    WorkbenchContentsFinder finder = new WorkbenchContentsFinder();
    IEditorPart activateEditor = finder.activeWorkbenchWindow().getActivePage().getActiveEditor();
    IXliffEditor xliffEditor = (IXliffEditor) activateEditor;
    XLFHandler handler = xliffEditor.getXLFHandler();
    return handler.getAllRowIds();
}
Also used : IEditorPart(org.eclipse.ui.IEditorPart) IXliffEditor(net.heartsome.cat.ts.ui.editors.IXliffEditor) XLFHandler(net.heartsome.cat.ts.core.file.XLFHandler) WorkbenchContentsFinder(org.eclipse.swtbot.eclipse.finder.finders.WorkbenchContentsFinder)

Example 2 with WorkbenchContentsFinder

use of org.eclipse.swtbot.eclipse.finder.finders.WorkbenchContentsFinder in project translationstudio8 by heartsome.

the class XlfEditor method getRowIds.

/**
	 * @return List&lt;String&gt; 当前所有可见文本段的 RowID,合并、分割文本段后应重新获取
	 */
public ArrayList<String> getRowIds() {
    WorkbenchContentsFinder finder = new WorkbenchContentsFinder();
    IEditorPart activateEditor = finder.activeWorkbenchWindow().getActivePage().getActiveEditor();
    IXliffEditor xliffEditor = (IXliffEditor) activateEditor;
    XLFHandler handler = xliffEditor.getXLFHandler();
    return handler.getRowIds();
}
Also used : IEditorPart(org.eclipse.ui.IEditorPart) IXliffEditor(net.heartsome.cat.ts.ui.editors.IXliffEditor) XLFHandler(net.heartsome.cat.ts.core.file.XLFHandler) WorkbenchContentsFinder(org.eclipse.swtbot.eclipse.finder.finders.WorkbenchContentsFinder)

Aggregations

XLFHandler (net.heartsome.cat.ts.core.file.XLFHandler)2 IXliffEditor (net.heartsome.cat.ts.ui.editors.IXliffEditor)2 WorkbenchContentsFinder (org.eclipse.swtbot.eclipse.finder.finders.WorkbenchContentsFinder)2 IEditorPart (org.eclipse.ui.IEditorPart)2