use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.
the class DBManagement method selectDBType.
/**
* 在库管理对话框左边的树上选择并展开指定类型的数据库
* @param dbType
* 数据库类型;
* @return 指定数据库类型的树节点;
*/
public SWTBotTreeItem selectDBType(DB dbType) {
SWTBotTreeItem treei = null;
assertTrue("库管理对话框为 null。", dialog != null);
switch(dbType) {
case INTERNAL:
{
treei = dialog.treiDBInternal().expand().select();
verifyInternalDBWidgets();
break;
}
case MYSQL:
{
treei = dialog.treiDBMySQL().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
case ORACLE:
{
treei = dialog.treiDBOracle().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
case POSTGRESQL:
{
treei = dialog.treiDBPostgreSQL().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
case MSSQL:
{
treei = dialog.treiDBMSSQL().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
default:
{
assertTrue("无此数据库类型" + dbType, false);
}
}
return treei;
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.
the class MemoryDBManagement method deleteConnection.
/**
* 完整步骤:根据从 Excel 中读取的数据删除已保存的连接信息
* @param from
* 功能入口,请使用 TSUIConstants 类的枚举;
*/
public void deleteConnection(Entry from) {
mode = MemoryDatabaseManagementDialog.MANAGEMENT;
openDBMgmgDialog(from);
getDataConnect(mode);
assertTrue("未在已保存的连接信息中找到该连接:" + connectionName, isConnectionSaved());
SWTBotTreeItem curDb = selectDBType();
int countBefore = curDb.getItems().length;
curDb.expandNode(connectionName).select();
dialog.btnRemoveConn().click();
int countRemove = curDb.getItems().length;
assertTrue("仍可在已保存的连接信息中找到该连接:" + connectionName, countBefore == countRemove + 1);
dialog.btnClose().click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.
the class MemoryDBManagement method selectDBType.
/**
* 在库管理对话框左边的树上选择并展开指定类型的数据库
* @param dbType
* 数据库类型;
* @return 指定数据库类型的树节点;
*/
public SWTBotTreeItem selectDBType(DB dbType) {
SWTBotTreeItem treei = null;
assertTrue("库管理对话框为 null。", dialog != null);
switch(dbType) {
case INTERNAL:
{
treei = dialog.treiDBInternal().expand().select();
verifyInternalDBWidgets();
break;
}
case MYSQL:
{
treei = dialog.treiDBMySQL().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
case ORACLE:
{
treei = dialog.treiDBOracle().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
case POSTGRESQL:
{
treei = dialog.treiDBPostgreSQL().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
case MSSQL:
{
treei = dialog.treiDBMSSQL().expand().select();
verifyExternalDBWidgets(dbType);
break;
}
default:
{
assertTrue("无此数据库类型" + dbType, false);
}
}
return treei;
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.
the class IsProjectExist method test.
/**
* (non-Javadoc)
* @see org.eclipse.swtbot.swt.finder.waits.ICondition#test()
*/
public boolean test() throws Exception {
boolean result = false;
SWTBotTreeItem[] items = ProjectTreeView.getTree().getAllItems();
for (SWTBotTreeItem item : items) {
if (projectName.equals(item.getText())) {
result = true;
break;
}
}
return result;
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project gfm_viewer by satyagraha.
the class ProjectBot method newFile.
public ProjectFileBot newFile(String fileName) {
projectTree.setFocus();
projectTree.contextMenu("New").menu("File").click();
SWTBotShell shell = bot.shell("New File");
shell.activate();
bot.textWithLabel("File name:").setText(fileName);
bot.button("Finish").click();
SWTUtils.sleep(2000);
SWTBotTreeItem treeItem = projectTree.getNode(fileName);
return new ProjectFileBot(treeItem);
}
Aggregations