本文整理汇总了Java中org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor类的典型用法代码示例。如果您正苦于以下问题:Java SWTBotEditor类的具体用法?Java SWTBotEditor怎么用?Java SWTBotEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SWTBotEditor类属于org.eclipse.swtbot.eclipse.finder.widgets包,在下文中一共展示了SWTBotEditor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: textEditor
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
private SWTBotEclipseEditor textEditor(String fullyQualifiedType) throws JavaModelException, PartInitException {
IType type = javaProject.findType(fullyQualifiedType);
IEditorPart editorPart = UIThreadRunnable.syncExec(new Result<IEditorPart>() {
public IEditorPart run() {
try {
return JavaUI.openInEditor(type, true, true);
} catch (PartInitException | JavaModelException e) {
throw new RuntimeException(e);
}
}
});
// IEditorPart editorPart = JavaUI.openInEditor(type, true, true);
SWTBotEditor editor = bot.editorById(editorPart.getEditorSite().getId());
return editor.toTextEditor();
}
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:20,代码来源:JavaEditorBookmarkPropertiesProviderTest.java
示例2: producePDFInNonUIThread
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
@Test @Ignore("not ready yet")
public void producePDFInNonUIThread() throws InterruptedException {
// Open specA
SWTBotMenu fileMenu = bot.menu("File");
SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
addNewSpecMenu.click();
bot.textWithLabel("Root-module file:").setText(specA);
bot.button("Finish").click();
// generate PDF
SWTBotMenu pdfMenu = fileMenu.menu("Produce PDF Version");
pdfMenu.click();
// wait for the browser to show up with the generated PDF
SWTBotEditor swtBotEditor = bot.editorById(OpenSpecHandler.TLA_EDITOR);
Assert.assertNotNull(swtBotEditor);
assertNoBackendCodeInUIThread();
}
开发者ID:tlaplus,项目名称:tlaplus,代码行数:23,代码来源:PDFHandlerThreadingTest.java
示例3: hasEditor
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* Checks if a {@link SWTBotEditor} with the given title exists.
*
* @param editorTitle
* the title of the editor
* @return {@code true} if the editor was found open, {@code false} otherwise
*/
public boolean hasEditor(final String editorTitle) {
for (SWTBotEditor editor : editors()) {
if (editor.getTitle().equals(editorTitle)) {
return true;
}
}
return false;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:16,代码来源:SwtWorkbenchBot.java
示例4: hasActiveEditor
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* Checks if an active {@link SWTBotEditor} is available.
*
* @return {@code true} if an active editor was found, {@code false} otherwise
*/
public boolean hasActiveEditor() {
for (SWTBotEditor editor : editors()) {
if (editor.isActive()) {
return true;
}
}
return false;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:14,代码来源:SwtWorkbenchBot.java
示例5: saveAllEditors
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* Save all editors.
*
* @return the fixed default workbench
*/
FixedDefaultWorkbench saveAllEditors() {
List<? extends SWTBotEditor> editors = bot.editors();
for (SWTBotEditor editor : editors) {
editor.save();
}
return this;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:13,代码来源:FixedDefaultWorkbench.java
示例6: closeAllEditors
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* Close all editors.
*
* @return the fixed default workbench
*/
FixedDefaultWorkbench closeAllEditors() {
List<? extends SWTBotEditor> editors = bot.editors();
for (SWTBotEditor editor : editors) {
editor.close();
}
return this;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:13,代码来源:FixedDefaultWorkbench.java
示例7: beforeAllTests
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
@Override
protected void beforeAllTests() {
super.beforeAllTests();
initializeSWTBot();
getBot().closeWelcomePage();
getBot().resetActivePerspective();
IEditorPart editor = openEditor(getTestSource().getUri(), true);
SWTBotEditor swtBotEditor = getBot().editorByTitle(editor.getTitle());
getTestInformation().putTestObject(SWTBotEclipseEditor.class, new AcfSwtBotEclipseEditor(swtBotEditor.getReference(), getBot()));
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:11,代码来源:AbstractXtextUiTest.java
示例8: isEditorOpen
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* @param editorId
* the editor id
* @return true if the editor being tested is open, false otherwise
*/
protected boolean isEditorOpen(final String editorId) {
for (SWTBotEditor e : getBot().editors()) {
if (e.getReference().getId().equals(editorId)) {
return true;
}
}
return false;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:14,代码来源:AbstractUiTest.java
示例9: setUp
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
super.setUp();
// create a dummy spec "ToBeRenamedSpec"
SWTBotMenu fileMenu = bot.menu("File");
SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
addNewSpecMenu.click();
String path = System.getProperty("java.io.tmpdir") + File.separator + "RSHTest"
+ System.currentTimeMillis();
path += File.separator + TEST_SPEC + TLA_SUFFIX;
bot.textWithLabel("Root-module file:").setText(path);
bot.button("Finish").click();
final String specName = getSpecName(new File(path));
bot.waitUntil(Conditions.waitForMenu(bot.activeShell(), WithText.<MenuItem> withText(specName)));
// create a new dummy model
final SWTBotMenu modelMenu = bot.menu("TLC Model Checker");
final SWTBotMenu newModelMenu = modelMenu.menu("New Model...");
newModelMenu.click();
bot.button("OK").click();
bot.waitUntil(new ModelEditorOpenCondition(TEST_MODEL));
// save and close model editor
SWTBotEditor activeEditor = bot.activeEditor();
activeEditor.saveAndClose();
checkSpecAndModelExistenceAPI(TEST_SPEC);
}
开发者ID:tlaplus,项目名称:tlaplus,代码行数:34,代码来源:CloneModelTest.java
示例10: ctxMenuOpenProjectFiles
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 合并打开当前项目中的所有 XLIFF
*/
public void ctxMenuOpenProjectFiles() {
ptn.select();
SWTBotMenu openProjectFiles = ptv.ctxMenuOpenProjectFiles();
openProjectFiles.isEnabled(); // 确认右键菜单中的打开项目功能可用
openProjectFiles.click(); // 点击该菜单项
// 确认文件被成功打开
SWTBotEditor editor = HSBot.bot().editorByTitle(prjName);
HSBot.bot().waitUntil(new IsEditorOpened(editor));
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:13,代码来源:ProjectTreeItem.java
示例11: ctxMenuOpenFile
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 打开当前项目中的一个 XLIFF 文件
* @param xlfFileName
* 要打开的 XLIFF 文件名称
*/
public void ctxMenuOpenFile(final String xlfFileName) {
selectFile("XLIFF", xlfFileName);
SWTBotMenu openFiles = ptv.ctxMenuOpenFile();
openFiles.isEnabled();
openFiles.click();
SWTBotEditor editor = HSBot.bot().editorByTitle(xlfFileName);
HSBot.bot().waitUntil(new IsEditorOpened(editor));
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:15,代码来源:ProjectTreeItem.java
示例12: openFile
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 在打开文件对话框中输入指定文件名称或路径
* @param filePath
* 要打开的文件名称或路径
* @param isValid
* 是否为有效文件名称或路径
* @param isFile
* true 表示输入的是文件名称,false 表示文件路径
*/
public static void openFile(String filePath, boolean isValid, boolean isFile) {
OsUtil.typePath(filePath); // typePath 方法处理了多种操作系统的情况
String fileName = new Path(filePath).lastSegment(); // 从路径中取出文件名
if (isValid) {
// 确认编辑器成功打开
HsSWTWorkbenchBot bot = HSBot.bot();
final SWTBotEditor editor = bot.editorByTitle(fileName);
bot.waitUntil(new IsEditorOpened(editor));
} else {
if (isFile) {
// 弹出信息对话框
InfoFileNotFound fnf = new InfoFileNotFound(filePath);
fnf.msgFileNotFound().isVisible(); // 文件未找到
fnf.btnOK().click();
} else {
try {
OsUtil.typeEnter(); // 在系统对话框的信息提示框上点确认
OsUtil.typeEsc(); // 按 Esc 取消打开文件
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:36,代码来源:OpenFileDialog.java
示例13: setCurrentFile
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 激活或打开编辑器,仅限合并打开的指定项目中的 XLIFF 文件
*
* @param prjName
* 要打开的项目名称
*/
public void setCurrentFile(String prjName) {
SWTBotEditor editor = bot.editorByTitle(prjName);
if (editor != null) {
editor.show();
} else {
ProjectTreeItem.getInstance(prjName).ctxMenuOpenProjectFiles();
}
// TODO: 需要完善对同名编辑器的判断和处理
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:16,代码来源:TS.java
示例14: openDashBoard
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* @param bot
* @return
*/
public static boolean openDashBoard(SWTWorkbenchBot bot) {
bot.menu(Properties.MENU_ITEM_DEVELOPER_STUDIO)
.menu(Properties.MENU_ITEM_OPEN_DASHBOARD).click();
bot.cTabItem(Properties.CTAB_ITEM_DEVELOPER_STUDIO_DASHBOARD)
.activate();
SWTBotEditor dashBoardEditor = bot.activeEditor();
dashBoardEditor.setFocus();
if (dashBoardEditor.getTitle().contentEquals(Properties.VIEW_DASHBOARD)) {
return true;
}
return false;
}
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:19,代码来源:DashBoardCreation.java
示例15: testDuplicateClassError
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
@Test
public void testDuplicateClassError() throws CoreException {
createProjectAndAssertNoErrorMarker("SmallJava Project", TEST_PROJECT);
SWTBotEditor editor = bot.editorByTitle("example.smalljava");
editor.toTextEditor().setText(
"package smalljava.lang;\nclass Object {}"
);
editor.save();
waitForAutoBuild();
assertErrorsInProject(1);
}
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:12,代码来源:SmallJavaProjectWizardTests.java
示例16: XlfEditor
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 按指定的编辑器对象创建
* @param editor
*/
public XlfEditor(SWTBotEditor editor) {
super(editor.getReference(), bot);
getNatTable();
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:9,代码来源:XlfEditor.java
示例17: setEditorContents
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
protected SWTBotEditor setEditorContents(CharSequence text) {
testEditor().toTextEditor().setText(text.toString());
testEditor().save();
return testEditor();
}
开发者ID:eclipse,项目名称:xsemantics,代码行数:6,代码来源:XsemanticsWorkbenchBase.java
示例18: testEditor
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
protected SWTBotEditor testEditor() {
return bot.editorByTitle(TEST_FILE);
}
开发者ID:eclipse,项目名称:xsemantics,代码行数:4,代码来源:XsemanticsWorkbenchBase.java
示例19: doubleClickXlfFile
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 双击打开 XLIFF 文件
* @param prjName
* XLIFF 文件所在的项目名称
* @param xlfFileName
* 要打开的 XLIFF 文件名称
*/
public static void doubleClickXlfFile(String prjName, final String xlfFileName) {
getTree().expandNode(prjName).expandNode("XLIFF").expandNode(xlfFileName).doubleClick();
// 确认文件被打开
SWTBotEditor editor = HSBot.bot().editorByTitle(xlfFileName);
HSBot.bot().waitUntil(new IsEditorOpened(editor));
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:14,代码来源:ProjectTreeView.java
示例20: getXlfEditor
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; //导入依赖的package包/类
/**
* 得到指定文件名所在的编辑器
*
* @param fileName
* 指定的文件名
* @return XlfEditor 得到的编辑器
*/
public XlfEditor getXlfEditor(String fileName) {
SWTBotEditor editor = bot.editorByTitle(fileName);
editor.show();
return new XlfEditor(editor);
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:13,代码来源:TS.java
注:本文中的org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论