This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resizing of the Layouts is not proper.

 
Rahul Anan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing the different issue, whenever i am trying to resize the contents of my window it is not getting resized. I also tried the Resize Handler way as suggested above.

As we can see there is two components SnapshotChooserView and RunLogGrid and i have made it collapsible.
So, that when i make the SnapshotChooserView collapsed, then all the space should be occupied by the RunLogGrid and when i collape the RunLogGrid all the other space should be occupied by the SnapshotChooserView.

Can anyone help to figure this out.

public class RunView implements IsWidget {

// Client factory
private ClientFactory iClientFactory;

// Main Container
private BorderLayoutContainer borderLayoutContainer;

// Components
private SnapshotChooserView snapshotChooserView;

// Components
private RunLogGrid runLogGrid;

ContentPanel north;

ContentPanel south;

ResizeHandler handler1;

ResizeHandler handler2;

// ---- CONSTRUCTORS ----

public RunView() {
}

public RunView(ClientFactory aClientFactory) {

iClientFactory = aClientFactory;


borderLayoutContainer = new BorderLayoutContainer();
borderLayoutContainer.setBorders(true);

snapshotChooserView = iClientFactory.getSnapshotChooserView();
runLogGrid = new RunLogGrid(iClientFactory);

final double SnapshotChooserHeight = 500;
final int RunLogGridHeight = 350;

handler1 = new ResizeHandler(){
@Override
public void onResize(ResizeEvent event) {
north.setWidth(event.getWidth());
north.setHeight(event.getHeight());
}
};

handler2 = new ResizeHandler(){
@Override
public void onResize(ResizeEvent event) {
south.setWidth(event.getWidth());
south.setHeight(event.getHeight());
}
};

north = new ContentPanel();
north.setHeadingText("Run Details");
north.add(snapshotChooserView.asWidget());
north.setCollapsible(true);
north.setResize(true);
north.addResizeHandler(handler1);
// north.forceLayout();

south = new ContentPanel();
south.setHeadingText("Run Log Info");
south.add(runLogGrid.asWidget());
south.setCollapsible(true);
south.setResize(true);
south.addResizeHandler(handler2);
// south.forceLayout();

BorderLayoutData northData = new BorderLayoutData(SnapshotChooserHeight);
northData.setMargins(new Margins(2, 2, 2, 2));
//northData.setCollapsible(true);
//northData.setSplit(true);
//northData.setCollapsed(true);
//northData.setCollapseMini(true);


BorderLayoutData southData = new BorderLayoutData(RunLogGridHeight);
southData.setMargins(new Margins(2, 2, 2, 2));
//southData.setCollapsible(true);
//southData.setMinSize(RunLogGridHeight);
//southData.setMaxSize(850);
//southData.setSplit(true);
//southData.setCollapseMini(true);

// borderLayoutContainer.addResizeHandler(handler1);
// borderLayoutContainer.addResizeHandler(handler2);

borderLayoutContainer.setNorthWidget(north, northData);
borderLayoutContainer.setSouthWidget(south, southData);

}

/*
* @see RunLogGrid::TriggerGridReload
*/
public void triggerRunGridRefresh() {
runLogGrid.triggerGridReload();
}

/*
* (non-Javadoc)
*
* @see com.google.gwt.user.client.ui.IsWidget#asWidget()
*/
@Override
public Widget asWidget() {
return borderLayoutContainer;
}
}
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rahul,
Please do not quote your original post to bump the topic. If you haven't received any answer, most probably because people do not know how to fix it, or (as in my case) I do not use Sencha GXT
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic