Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to test defineLayout method from IPerspectiveFactory
How to test defineLayout method from IPerspectiveFactory [message #555017] Wed, 25 August 2010 04:19 Go to next message
snieguu is currently offline snieguu
Messages: 4
Registered: March 2010
Junior Member
I'd like to know if there is a way to check correctness of Layout of Views created in class that implements IPerspectiveLayouts. In other words I have
    private void defineLayout(final IPageLayout layout) {
        ...
        final IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.33f, editorArea);
        left.addPlaceholder(VIEW_ID);
        ...
     }

and in SWTBot test I want to check that after open view, It will appear in place defined in defineLayout method.
Re: How to test defineLayout method from IPerspectiveFactory [message #555096 is a reply to message #555017] Wed, 25 August 2010 08:59 Go to previous message
snieguu is currently offline snieguu
Messages: 4
Registered: March 2010
Junior Member
I have found solution:
       final SWTBotView view = _bot.viewById(VIEW_ID);
       final ViewReference viewRef =  (ViewReference)view.getReference(); 
       final ViewPane pane = viewRef.getPane();
       final ILayoutContainer layoutContainer = pane.getContainer();
       final ViewStack viewStack = (ViewStack)layoutContainer;
       assertEquals(viewStack.getID(),"left");
Previous Topic:How to select a menu on a popup menu with SWTBOT?
Next Topic:Setting keyboard layout different to the system's default
Goto Forum:
  


Current Time: Thu Apr 24 01:59:24 EDT 2014

Powered by FUDForum. Page generated in 0.01474 seconds