Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/947915/#msg_947915
During the test run using swtbot I would like to maximize the window of an automated eclipse. Does anyone know what code I use to perform this operation?
Thank you.]]>Miguel Pessoa2012-10-17T15:14:33-00:00Re: How to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/947947/#msg_947947
as far as I know maximizing a shell isn't supported by SWTBot. You may
want to open an enhancement request. In the meanwhile, you can extend
the SWTBotShell like sketched below.
HTH
Rüdiger
public class SWTBotShellExtension extends SWTBotShell {
public void maximize() {
new SWTBot().waitUntil( new DefaultCondition() {
public String getFailureMessage() {
return "Timed out waiting for "
+ SWTUtils.toString( widget )
+ " to get maximized";
}
On 17.10.2012 17:14, Miguel Soares Pessoa wrote:
> Hello
> During the test run using swtbot I would like to maximize the window of
> an automated eclipse. Does anyone know what code I use to perform this
> operation?
>
> Thank you.
--
Rüdiger Herrmann http://codeaffine.com]]>Rüdiger Herrmann2012-10-17T15:49:08-00:00Re: How to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/948101/#msg_948101
How do I call this method at runtime?]]>Miguel Pessoa2012-10-17T19:08:48-00:00Re: How to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/948153/#msg_948153
shell from
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
or whereever your active workbench window is accessible from.
Once you have a reference to the shell that represents the workbench
window,
new SWTBotExtension( shell ).maximize()
will (hopefully) maximize the window.
HTH
Rüdiger
On 17.10.2012 21:08, Miguel Soares Pessoa wrote:
> The class constructor receives a Shell, which sheel is that this should
> be received?
> How do I call this method at runtime?
--
Rüdiger Herrmann http://codeaffine.com]]>Rüdiger Herrmann2012-10-17T20:13:55-00:00Re: How to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/948174/#msg_948174
Shell shell = new Shell();
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
new SWTBotShellExtension(shell).maximize();
What am I doing wrong?
Thank you for your patience and help.]]>Miguel Pessoa2012-10-17T20:43:57-00:00Re: How to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/948226/#msg_948226
obtaining the workbench window from PlaformUI... was just meant as an
example and might not fit your environment - though it commonly works.
What exactly isn't working when you run the code?
HTH
Rüdiger
On 17.10.2012 22:43, Miguel Soares Pessoa wrote:
> I'm not able to run this way:
> Shell shell = new Shell();
> shell =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
> new SWTBotShellExtension(shell).maximize();
> What am I doing wrong?
>
> Thank you for your patience and help.
--
Rüdiger Herrmann http://codeaffine.com]]>Rüdiger Herrmann2012-10-17T21:46:35-00:00Re: How to maximize the eclipse runtime using SWTBot?
https://www.eclipse.org/forums/index.php/mv/msg/405946/981278/#msg_981278
I tend to think that SWTBot is doing the right thing, but the EditPart
has a bug with 4.2 that prevents it from being selected.