本文整理汇总了Java中org.eclipse.jface.dialogs.ErrorDialog.AUTOMATED_MODE属性的典型用法代码示例。如果您正苦于以下问题:Java ErrorDialog.AUTOMATED_MODE属性的具体用法?Java ErrorDialog.AUTOMATED_MODE怎么用?Java ErrorDialog.AUTOMATED_MODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jface.dialogs.ErrorDialog
的用法示例。
在下文中一共展示了ErrorDialog.AUTOMATED_MODE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateOffLineFromFile
public static List<IFile> generateOffLineFromFile(IWorkbenchWindow ww, TestResourceGeneration dcp,
BuildPolicy[] generators, int timeout, IProgressMonitor monitor)
throws IOException, CoreException, InterruptedException {
IFile graphModel = dcp.getGraphIFile();
String startElement = getStartElement(dcp.getGraphFile());
List<IFile> ret = new ArrayList<IFile>();
try {
for (BuildPolicy policy : generators) {
OfflineContext oc = new OfflineContext(policy);
dcp.addOfflineContext(oc);
File shellFile = ProcessFacade.buildOfflineShellFile(dcp.getJavaProject(), graphModel, policy.getPathGenerator(), startElement);
ProcessFacade.execute(shellFile, (long) timeout).forEach(oc::addMethodName);
}
} catch (Exception e) {
ResourceManager.logException(e);
if (!ErrorDialog.AUTOMATED_MODE) { // Avoid displaying a window while running automated mode
DialogManager.asyncDisplayErrorMessage(MessageUtil.getString("error"),
MessageUtil.getString("an_error_occured_while_running_offline_tool"), e);
}
}
dcp.updateWithOfflines();
generateFromFile(ww, dcp, monitor);
return ret;
}
示例2: open
@Override
public int open() {
// patch for swtbot test
boolean mode = ErrorDialog.AUTOMATED_MODE;
ErrorDialog.AUTOMATED_MODE = false;
int code = super.open();
ErrorDialog.AUTOMATED_MODE = mode;
return code;
}
示例3: testOfflineStandAloneModeWithTimeout
@Test
public void testOfflineStandAloneModeWithTimeout() throws Exception {
boolean[] result = new boolean [] {false};
ILogListener listener = new ILogListener() {
@Override
public void logging(IStatus status, String plugin) {
if (status.getMessage().indexOf("Operation cancelled either manually or a timeout occured.")!=-1) {
result[0] = true;
}
}
};
GW4EProject project = new GW4EProject(bot, gwproject);
project.createSimpleProjectWithoutGeneration ();
IFile buildPolicyFile = (IFile) ResourceManager.getResource("gwproject/src/main/resources/com/company/build.policies");
BuildPolicyManager.setPolicies(buildPolicyFile, "Simple.json", "random(never);I", new NullProgressMonitor ());
buildPolicyFile.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor ());
FileParameters fp = project.generateForSimpleProject ();
fp.setTargetFilename("SimpleOffLineImpl");
OfflineTestUIPageTest page = walkToToOfflinePage(gwproject,fp);
page.selectTimeout("1");
page.selectStandAloneMode("MyClazz");
page.selectGenerators(new String [] {"random(never)"});
try {
ErrorDialog.AUTOMATED_MODE = true;
ResourceManager.addLogListener(listener);
page.finish();
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return result[0];
}
@Override
public String getFailureMessage() {
return "Operation not cancelled";
}
};
bot.waitUntil(condition,3 * 6 * SWTBotPreferences.TIMEOUT); //3mn
} finally {
ErrorDialog.AUTOMATED_MODE = false;
ResourceManager.removeLogListener(listener);
}
closeWizard ();
}
示例4: Workspace
/**
* Initialises a new workspace instance. Should usually only be called once per test.
*/
public Workspace() {
try {
this.copyLocation = Files.createTempDirectory("beagle-systemtest").toFile();
} catch (final IOException createError) {
throw new RuntimeException(createError);
}
try {
final IProjectDescription tmpProjectDescription =
ECLIPSE_WORKSPACE.newProjectDescription("Beagle System Test");
this.tmpProjectFolder = new File(this.copyLocation, "Beagle System Test Project");
this.tmpProjectFolder.mkdir();
tmpProjectDescription.setLocation(new Path(this.tmpProjectFolder.getAbsolutePath()));
this.tmpProject = ECLIPSE_WORKSPACE.getRoot().getProject(tmpProjectDescription.getName());
this.tmpProject.create(tmpProjectDescription, null);
this.tmpProject.open(null);
} catch (final CoreException projectCreationError) {
throw new RuntimeException(projectCreationError);
}
// Show the console view because that makes sense for tests
new UIJob("show console view") {
@Override
public IStatus runInUIThread(final IProgressMonitor monitor) {
try {
PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage()
.showView(IConsoleConstants.ID_CONSOLE_VIEW);
} catch (final PartInitException guiException) {
throw new RuntimeException(guiException);
}
return Status.OK_STATUS;
}
}.schedule();
// Show error windows
ErrorDialog.AUTOMATED_MODE = false;
}