use of com.google.gerrit.client.ui.MorphingTabPanel in project gerrit by GerritCodeReview.
the class Gerrit method onModuleLoad2.
private void onModuleLoad2(HostPageData hpd) {
RESOURCES.gwt_override().ensureInjected();
RESOURCES.css().ensureInjected();
topMenu = RootPanel.get("gerrit_topmenu");
final RootPanel gStarting = RootPanel.get("gerrit_startinggerrit");
final RootPanel gBody = RootPanel.get("gerrit_body");
bottomMenu = RootPanel.get("gerrit_btmmenu");
topMenu.setStyleName(RESOURCES.css().gerritTopMenu());
gBody.setStyleName(RESOURCES.css().gerritBody());
final Grid menuLine = new Grid(1, 3);
menuLeft = new MorphingTabPanel();
menuRight = new LinkMenuBar();
searchPanel = new SearchPanel();
menuLeft.setStyleName(RESOURCES.css().topmenuMenuLeft());
menuLine.setStyleName(RESOURCES.css().topmenu());
topMenu.add(menuLine);
final FlowPanel menuRightPanel = new FlowPanel();
menuRightPanel.setStyleName(RESOURCES.css().topmenuMenuRight());
menuRightPanel.add(searchPanel);
menuRightPanel.add(menuRight);
menuLine.setWidget(0, 0, menuLeft);
menuLine.setWidget(0, 1, new FlowPanel());
menuLine.setWidget(0, 2, menuRightPanel);
final CellFormatter fmt = menuLine.getCellFormatter();
fmt.setStyleName(0, 0, RESOURCES.css().topmenuTDmenu());
fmt.setStyleName(0, 1, RESOURCES.css().topmenuTDglue());
fmt.setStyleName(0, 2, RESOURCES.css().topmenuTDmenu());
siteHeader = RootPanel.get("gerrit_header");
siteFooter = RootPanel.get("gerrit_footer");
body = new ViewSite<Screen>() {
@Override
protected void onShowView(Screen view) {
String token = view.getToken();
History.newItem(token, false);
dispatchHistoryHooks(token);
if (view instanceof ChangeListScreen) {
lastChangeListToken = token;
}
super.onShowView(view);
view.onShowView();
lastViewToken = token;
}
};
gBody.add(body);
JsonUtil.addRpcStartHandler(RpcStatus.INSTANCE);
JsonUtil.addRpcCompleteHandler(RpcStatus.INSTANCE);
gStarting.getElement().getParentElement().removeChild(gStarting.getElement());
RootPanel.detachNow(gStarting);
ApiGlue.init();
applyUserPreferences();
populateBottomMenu(bottomMenu, hpd);
refreshMenuBar();
History.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
display(event.getValue());
}
});
JumpKeys.register(body);
saveDefaultTheme();
if (hpd.messages != null) {
new MessageOfTheDayBar(hpd.messages).show();
}
PluginLoader.load(hpd.plugins, hpd.pluginsLoadTimeout, new GerritCallback<VoidResult>() {
@Override
public void onSuccess(VoidResult result) {
String token = History.getToken();
if (token.isEmpty()) {
token = isSignedIn() ? PageLinks.MINE : PageLinks.toChangeQuery("status:open");
}
display(token);
}
});
}
Aggregations