本文整理汇总了Java中com.google.gwt.user.client.ui.LayoutPanel.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutPanel.setStyleName方法的具体用法?Java LayoutPanel.setStyleName怎么用?Java LayoutPanel.setStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.LayoutPanel
的用法示例。
在下文中一共展示了LayoutPanel.setStyleName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GWTPTabPanel
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
/**
* Create a new GWTPTabPanel.
*
* @param placeManager the place manager to use when processing tab
* selections.
*/
public GWTPTabPanel(final PlaceManager placeManager) {
_layout = new LayoutPanel();
_layout.addStyleName("fill-layout"); //$NON-NLS-1$
_tabBar = new DefaultTabLayoutPanel(40, Unit.PX);
// _tabBar = new TabBar();
_tabBar.addSelectionHandler(new SelectionHandler<Integer>() {
@Override
public void onSelection(SelectionEvent<Integer> event) {
if (_modifyingTabs) {
// add/remove tab may change the selection
return;
}
if (event.getSelectedItem() < 0) {
// TODO: WHAT????
return;
}
final PlaceRequest current = placeManager.getCurrentPlaceRequest();
final String selectedToken = _tabs.get(event.getSelectedItem()).getTargetHistoryToken();
final String currentToken = current == null ? null : current.getNameToken();
if (!selectedToken.equals(currentToken)) {
placeManager.revealPlace(new PlaceRequest(selectedToken));
}
}
});
_content = new LayoutPanel();
_content.setStyleName("fill-layout"); //$NON-NLS-1$
_layout.add(_tabBar);
_layout.add(_content);
((LayoutPanel) _layout).setWidgetTopHeight(_tabBar, 0, Unit.PX, 40, Unit.PX);
((LayoutPanel) _layout).setWidgetTopHeight(_content, 40, Unit.PX, 100, Unit.PCT);
}
示例2: LayoutPanelView
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
@Inject
public LayoutPanelView() {
layout = new LayoutPanel();
layout.setStyleName("fill-layout");
}
示例3: DefaultIneFrameMasterPageView
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
@Inject
DefaultIneFrameMasterPageView(
IneFrameHeader.View header,
MenuRenderer.View menu,
MessagePanelWidget messagePanel,
NavigationDrawer navigationDrawer) {
this.header = header;
this.menu = menu;
this.navigationDrawer = navigationDrawer;
this.messagePanel = messagePanel;
messagePanel.getElement().setId("MessagePanel");
messagePanel.addStyleName(Res.INST.get().style().MessagePanel());
getElement().setId("MasterPage");
setSize("100%", "100%");
setStyleName(Res.INST.get().style().MasterPage());
clickHandlerLayout = new ClickableFlowPanel();
clickHandlerLayout.getElement().setId("ClickHandler");
clickHandlerLayout.setSize("100%", "100%");
clickHandlerLayout.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
closeNavigationDrawer();
}
});
headerAndPageRoot = new ResizeLayoutPanel();
headerAndPageRoot.getElement().setId("HeaderAndPageRoot");
headerAndPageRoot.setSize("100%", "100%");
headerAndPageRoot.setStyleName(Res.INST.get().style().HeaderAndPageRoot());
headerAndPage = new LayoutPanel();
headerAndPage.getElement().setId("HeaderAndPage");
headerAndPage.setStyleName(Res.INST.get().style().HeaderAndPage());
headerAndPage.add(header.asWidget());
headerAndPage.add(menu.asWidget());
header.asWidget().asWidget().getElement().setId("Header");
menu.asWidget().asWidget().getElement().setId("Menu");
headerAndPage.setWidgetTopHeight(
header.asWidget(),
0,
Unit.PX,
DesignConstants.base() + borderWidth,
Unit.PX);
headerAndPage.setWidgetTopBottom(
menu.asWidget(),
DesignConstants.base() + borderWidth,
Unit.PX,
0,
Unit.PX);
headerAndPageRoot.setWidget(headerAndPage);
navigationDrawer.asWidget().setSize(DesignConstants.b5WithUnit(), "100%");
navigationDrawer.asWidget().getElement().setId("NavigationDrawer");
navigationDrawer.asWidget().addStyleName(Res.INST.get().style().NavigationDrawer());
add(messagePanel);
add(navigationDrawer);
add(headerAndPageRoot);
}