本文整理汇总了Java中com.google.gwt.user.client.ui.LayoutPanel.add方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutPanel.add方法的具体用法?Java LayoutPanel.add怎么用?Java LayoutPanel.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.LayoutPanel
的用法示例。
在下文中一共展示了LayoutPanel.add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EditorMultiPartStackViewImpl
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
@Inject
public EditorMultiPartStackViewImpl(
SplitEditorPartViewFactory splitEditorPartViewFactory,
EmptyEditorsPanel emptyEditorsPanel,
EditorPlaceholderWidget editorPlaceholderWidget) {
this.splitEditorPartViewFactory = splitEditorPartViewFactory;
this.emptyEditorsPanel = emptyEditorsPanel;
this.splitEditorParts = HashBiMap.create();
this.editorPlaceholderWidget = editorPlaceholderWidget;
contentPanel = new LayoutPanel();
contentPanel.setSize("100%", "100%");
contentPanel.ensureDebugId("editorMultiPartStack-contentPanel");
initWidget(contentPanel);
contentPanel.add(emptyEditorsPanel);
}
示例2: Text
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
public Text(Composite parent, int style) {
this(new TextArea(), parent, style);
textArea = (TextArea) getGwtWidget();
panel = (LayoutPanel) getParent().getGwtWidget().getParent();
panel.add(textArea);
textArea.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
setText(textArea.getText());
textArea.removeFromParent();
sendEvent(SWT.Modify);
sendEvent(SWT.FocusOut);
}
});
}
示例3: onLoad
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
@Override
public void onLoad() {
LayoutPanel layoutPanel = new LayoutPanel();
controller = new ReportingController(eventBus, rpcService);
layoutPanel.add(controller.createView());
ReportingPresenter reportingPresenter = controller.getPresenter();
reportingPresenter.bind();
final RootPanel rootPanel = new RootPanel(layoutPanel, rpcService);
rootPanel.getHeader().addTab("Batch Class Management", "BatchClassManagement.html", false);
rootPanel.getHeader().addTab("Batch Instance Management", "BatchInstanceManagement.html", false);
rootPanel.getHeader().addTab("Workflow Management", "CustomWorkflowManagement.html", false);
rootPanel.getHeader().addTab("Folder Management", "FolderManager.html", false);
rootPanel.getHeader().addNonClickableTab("Reports", "Reporting.html");
rootPanel.getHeader().getTabBar().selectTab(4);
rootPanel.addStyleName("set_position");
rootPanel.getHeader().setEventBus(eventBus);
rpcService.getUserName(new EphesoftAsyncCallback<String>() {
@Override
public void onSuccess(final String userName) {
rootPanel.getHeader().setUserName(userName);
}
@Override
public void customFailure(final Throwable arg0) {
// Username cannot be set if the call failed.
}
});
RootLayoutPanel rootLayoutPanel = RootLayoutPanel.get();
rootLayoutPanel.clear();
rootLayoutPanel.add(rootPanel);
}
示例4: 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);
}
示例5: MenuOneLevelView
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
public MenuOneLevelView(LayoutPanel parent, int level, boolean hiddenMenu) {
this.hiddenMenu = hiddenMenu;
getElement().setId("OneLevel-" + level);
parent.add(this);
menu.addStyleName(ResourceHelper.getRes().style().menu());
menuBorder.addStyleName(ResourceHelper.getRes().style().menuBorder());
menu.getElement().setId("OneLevel-" + level + "-Menu");
getElement().getStyle().setOverflow(Overflow.VISIBLE);
init();
}
示例6: TabLayoutPanelCopy
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
/**
* Creates an empty tab panel.
*
* @param barHeight the size of the tab bar
* @param barUnit the unit in which the tab bar size is specified
*/
public TabLayoutPanelCopy(double barHeight, Unit barUnit) {
LayoutPanel panel = new LayoutPanel();
initWidget(panel);
// Add the tab bar to the panel.
panel.add(tabBar);
panel.setWidgetLeftRight(tabBar, 0, Unit.PX, 0, Unit.PX);
panel.setWidgetTopHeight(tabBar, 0, Unit.PX, barHeight, barUnit);
panel.setWidgetVerticalPosition(tabBar, Alignment.END);
// Add the deck panel to the panel.
// CHANGE4: styles again: deckPanel.addStyleName(CONTENT_CONTAINER_STYLE);
panel.add(deckPanel);
panel.setWidgetLeftRight(deckPanel, 0, Unit.PX, 0, Unit.PX);
panel.setWidgetTopBottom(deckPanel, barHeight, barUnit, 0, Unit.PX);
// Make the tab bar extremely wide so that tabs themselves never wrap.
// (Its layout container is overflow:hidden)
// CHANGE5: Adapt the TabBar Style element to our needs
Style tabBarStyle = tabBar.getElement().getStyle();
tabBarStyle.setHeight(barHeight, barUnit);
tabBarStyle.setWidth(BIG_ENOUGH_TO_NOT_WRAP, Unit.PX);
// CHANGE6: We don't want the standard GWT styles
// tabBar.setStyleName("gwt-TabLayoutPanelTabs");
// setStyleName("gwt-TabLayoutPanel");
}
示例7: DialogBoxForLayoutWidget
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
public DialogBoxForLayoutWidget( String title, IsWidget content )
{
int m = 50;
ImageResource closeImage = ImageResources.INSTANCE.close();
int titleSize = Math.max( closeImage.getHeight(), closeImage.getWidth() ) + 5;
dock = new LayoutPanel();
Glass glass = new Glass();
dock.add( glass );
DivWidget backGround = new DivWidget();
backGround.addStyleName( ResizablePanel.CSS.bkgnd() );
dock.add( backGround );
dock.setWidgetLeftRight( backGround, m, Unit.PX, m, Unit.PX );
dock.setWidgetTopBottom( backGround, m, Unit.PX, m, Unit.PX );
DivWidget titleWidget = new DivWidget();
titleWidget.addStyleName( ResizablePanel.CSS.title() );
titleWidget.getElement().setInnerText( title );
dock.add( titleWidget );
dock.setWidgetLeftRight( titleWidget, m, Unit.PX, m + titleSize, Unit.PX );
dock.setWidgetTopHeight( titleWidget, m, Unit.PX, titleSize, Unit.PX );
closeWidget = new Image( closeImage );
dock.add( closeWidget );
dock.setWidgetRightWidth( closeWidget, m, Unit.PX, titleSize, Unit.PX );
dock.setWidgetTopHeight( closeWidget, m, Unit.PX, titleSize, Unit.PX );
SimpleLayoutPanel contentPanel = new SimpleLayoutPanel();
contentPanel.setWidget( content.asWidget() );
contentPanel.addStyleName( ResizablePanel.CSS.content() );
dock.add( contentPanel );
dock.setWidgetLeftRight( contentPanel, m, Unit.PX, m, Unit.PX );
dock.setWidgetTopBottom( contentPanel, m + titleSize, Unit.PX, m, Unit.PX );
closeWidget.addClickHandler( new ClickHandler()
{
@Override
public void onClick( ClickEvent event )
{
if( isAutoHide )
hide();
}
} );
}
示例8: 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);
}
示例9: VisualCellContainer
import com.google.gwt.user.client.ui.LayoutPanel; //导入方法依赖的package包/类
public VisualCellContainer(ViewContext viewContext, ViewConfig config)
{
m_viewContext = viewContext;
m_scrollContainer.addStyleName("sm_cell_scroll_container");
m_magnifier = new Magnifier(viewContext, config.magnifierTickCount, config.magFadeInTime_seconds);
m_splashGlass.addStyleName("sm_splash_glass");
m_cellContainerInner.addStyleName("sm_cell_container_inner");
this.addStyleName("sm_cell_container");
E_ZIndex.CELL_SPLASH_GLASS.assignTo(m_splashGlass);
Window.addResizeHandler(this);
//smU_UI.toggleSelectability(this.getElement(), false);
final LayoutPanel magnifierContainer = new LayoutPanel();
magnifierContainer.setSize("100%", "100%");
magnifierContainer.add(m_magnifier);
magnifierContainer.setWidgetRightWidth(m_magnifier, 8, Unit.PX, 34, Unit.PX);
magnifierContainer.setWidgetTopHeight(m_magnifier, 8, Unit.PX, 196, Unit.PX);
for( int i = 0; i < m_cropper.length; i++ )
{
m_cropper[i] = new VisualCellCropper();
m_cellContainerInner.add(m_cropper[i]);
}
this.add(magnifierContainer);
m_scrollContainer.add(m_cellContainerInner);
m_scrollContainer.add(m_splashGlass);
this.add(m_scrollContainer);
m_statusAlignment.setPosition(E_AlignmentType.MASTER_ANCHOR_HORIZONTAL, E_AlignmentPosition.RIGHT_OR_BOTTOM);
m_statusAlignment.setPosition(E_AlignmentType.MASTER_ANCHOR_VERTICAL, E_AlignmentPosition.RIGHT_OR_BOTTOM);
m_statusAlignment.setPosition(E_AlignmentType.SLAVE_ANCHOR_HORIZONTAL, E_AlignmentPosition.RIGHT_OR_BOTTOM);
m_statusAlignment.setPosition(E_AlignmentType.SLAVE_ANCHOR_VERTICAL, E_AlignmentPosition.RIGHT_OR_BOTTOM);
m_statusAlignment.setPadding(E_AlignmentType.SLAVE_ANCHOR_HORIZONTAL, S_UI.ADDRESS_STATUS_TOOL_TIP_PADDING);
m_statusAlignment.setPadding(E_AlignmentType.SLAVE_ANCHOR_VERTICAL, S_UI.ADDRESS_STATUS_TOOL_TIP_PADDING);
m_snapTargetAlignment.setPosition(E_AlignmentType.MASTER_ANCHOR_HORIZONTAL, E_AlignmentPosition.LEFT_OR_TOP);
m_snapTargetAlignment.setPosition(E_AlignmentType.MASTER_ANCHOR_VERTICAL, E_AlignmentPosition.RIGHT_OR_BOTTOM);
m_snapTargetAlignment.setPosition(E_AlignmentType.SLAVE_ANCHOR_HORIZONTAL, E_AlignmentPosition.LEFT_OR_TOP);
m_snapTargetAlignment.setPosition(E_AlignmentType.SLAVE_ANCHOR_VERTICAL, E_AlignmentPosition.RIGHT_OR_BOTTOM);
m_snapTargetAlignment.setPadding(E_AlignmentType.SLAVE_ANCHOR_HORIZONTAL, S_UI.ADDRESS_STATUS_TOOL_TIP_PADDING);
m_snapTargetAlignment.setPadding(E_AlignmentType.SLAVE_ANCHOR_VERTICAL, S_UI.ADDRESS_STATUS_TOOL_TIP_PADDING);
}