本文整理汇总了Java中com.google.gwt.user.client.ui.LayoutPanel类的典型用法代码示例。如果您正苦于以下问题:Java LayoutPanel类的具体用法?Java LayoutPanel怎么用?Java LayoutPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutPanel类属于com.google.gwt.user.client.ui包,在下文中一共展示了LayoutPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onModuleLoad
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
/**
* Entry point for the application.
*/
@Override
public void onModuleLoad() {
projectService = GWT.create(ProjectRpc.class);
userService = GWT.create(UserRpc.class);
dataService = GWT.create(DataRpc.class);
contentPanel = new LayoutPanel();
RootLayoutPanel.get().add(contentPanel);
// Handle history changes. (Such as clicking a navigation hyperlink.)
History.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
String historyToken = event.getValue();
handleUrl(historyToken);
}
});
handleUrl(History.getToken());
}
示例3: GwtRulerComposite
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
/**
* Constructor
*
* @param parent
* a widget which will be the parent of the new instance (cannot
* be null)
* @param style
* the style of widget to construct
* @see Composite#Composite(org.eclipse.swt.widgets.Composite, int)
*/
// public GwtRulerComposite(Composite parent, int style) {
// super(parent, style);
// addDisposeListener(new DisposeListener() {
// public void widgetDisposed(DisposeEvent e) {
// disposeResources();
// }
// });
// }
public GwtRulerComposite(LayoutPanel element) {
super(null, SWT.NONE);
this.rootElement = element;
// create dock panel here with rulers
dockLayoutPanel = new DockLayoutPanel(Unit.PX);
dockLayoutPanel.getElement().setId("INNER_DOCK_LAYOUT_PANEL");
rootElement.add(dockLayoutPanel);
northPanel = new DockLayoutPanel(Unit.PX);
northPanel.getElement().setId("NORTH_DOCK_LAYOUT_PANEL");
dockLayoutPanel.addNorth(northPanel, 19);
northPanel.addWest(createPickle(), 19);
topPartInDockPanel = new Composite(null, SWT.NONE);
LayoutPanel topPanel = (LayoutPanel) topPartInDockPanel
.getNativeWidget();
topPanel.getElement().setId("TOP_RULER");
northPanel.add(topPanel);
northPanel.forceLayout();
westPartInDockPanel = new Composite(null, SWT.NONE);
westPanel = (LayoutPanel) westPartInDockPanel.getNativeWidget();
westPanel.getElement().setId("LEFT_RULER");
dockLayoutPanel.addWest(westPanel, 19);
view = (LayoutPanel) getGwtWidget();
dockLayoutPanel.add(view);
dockLayoutPanel.forceLayout();
}
示例4: onResize
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
@Override
public void onResize() {
final Element realParent = (Element) ((LayoutPanel) canvas.getParent())
.getWidgetContainerElement(canvas);
int pw = realParent.getClientWidth();
int ph = realParent.getClientHeight();
// in case of trouble :)
// canvas.setPixelSize(pw, ph);
canvas.setCoordinateSpaceWidth(pw);
canvas.setCoordinateSpaceHeight(ph);
canvas.getElement().getStyle().setProperty("DIRTY", "dirty");
IFigure rootFigure = getLightweightSystem().getRootFigure();
rootFigure.revalidate();
rootFigure.repaint();
}
示例5: 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);
}
});
}
示例6: ViewWithToolbar
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
public ViewWithToolbar(final PartStackUIResources resources) {
container = new DockLayoutPanel(Style.Unit.PX);
initWidget(container);
container.setSize("100%", "100%");
toolBar = new LayoutPanel();
toolBar.addStyleName(resources.partStackCss().ideBasePartToolbar());
container.addNorth(toolBar, 20);
// this hack used for adding box shadow effect to toolbar
toolBar.getElement().getParentElement().getStyle().setOverflow(Style.Overflow.VISIBLE);
}
示例7: testPanels
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
@Test
public void testPanels() throws Exception {
invokeAllAccessibleMethods(new AbsolutePanel() {});
invokeAllAccessibleMethods(new CellPanel() {});
invokeAllAccessibleMethods(new ComplexPanel() {});
invokeAllAccessibleMethods(new DeckLayoutPanel() {});
invokeAllAccessibleMethods(new DeckPanel() {});
invokeAllAccessibleMethods(new DecoratorPanel() {});
invokeAllAccessibleMethods(new DockLayoutPanel(Unit.PX) {});
invokeAllAccessibleMethods(new DockPanel() {});
invokeAllAccessibleMethods(new FlowPanel() {});
invokeAllAccessibleMethods(new FocusPanel() {});
invokeAllAccessibleMethods(new HorizontalPanel() {});
invokeAllAccessibleMethods(new HTMLPanel("") {});
invokeAllAccessibleMethods(new LayoutPanel() {});
invokeAllAccessibleMethods(new PopupPanel() {});
invokeAllAccessibleMethods(new RenderablePanel("") {});
invokeAllAccessibleMethods(new ResizeLayoutPanel() {});
invokeAllAccessibleMethods(new SimpleLayoutPanel() {});
invokeAllAccessibleMethods(new SimplePanel() {});
invokeAllAccessibleMethods(new SplitLayoutPanel() {});
invokeAllAccessibleMethods(new StackPanel() {});
invokeAllAccessibleMethods(new VerticalPanel() {});
}
示例8: Timeline
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
public Timeline(Canvas canvas, ScrollPanel scroll, LayoutPanel viewPanel) {
logger.setLevel(Level.INFO);
this.canvas = canvas;
this.scroll = scroll;
this.viewPanel = viewPanel;
landmarks = new Vector<Landmark>();
landmarkbars = new Vector<LandmarkBar>();
startTime = new Date();
currentTime = new Date();
lenghtOfAMinute = 1000;
color = CssColor.make("rgba(" + 0 + ", " + 0 + "," + 255 + ", " + 1
+ ")");
canvas.setWidth(minWidth + "px");
canvas.setCoordinateSpaceWidth(minWidth);
canvas.setHeight(minHeight + "px");
canvas.setCoordinateSpaceHeight(minHeight);
timer = new Timer() {
@Override
public void run() {
updateTime();
drawTimeline();
}
};
timer.scheduleRepeating(5000);
updateTime();
drawTimeline();
}
示例9: 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);
}
示例10: SplitLayoutPanelView
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
public SplitLayoutPanelView() {
layout = new SplitLayoutPanel(2);
centerPanel = new LayoutPanel();
westPanel = new LayoutPanel();
// TODO (hbraun): the actual width should become meta data. i.e. passed through the position object
layout.addWest(westPanel,
217);
layout.add(centerPanel);
}
示例11: 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);
}
示例12: createPickle
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
private LayoutPanel createPickle() {
LayoutPanel pickle = new LayoutPanel();
pickle.getElement().setId("PICKLE");
pickle.setPixelSize(19, 19);
Style style = pickle.getElement().getStyle();
style.setBackgroundColor("rgb(230,230,230)");
return pickle;
}
示例13: propertyChange
import com.google.gwt.user.client.ui.LayoutPanel; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
com.google.gwt.canvas.client.Canvas canvas = (com.google.gwt.canvas.client.Canvas) getNativeWidget();
LayoutPanel canvasParent = (LayoutPanel) canvas.getParent();
if (isInPalette(canvas)) {
return;
}
int defWidth = canvasParent.getOffsetWidth();
RangeModel model = (RangeModel) evt.getSource();
int maxVal = model.getMaximum();
int minVal = model.getMinimum();
int value = model.getValue();
int size = maxVal - minVal;
LayoutPanel simplePanel = getSimplePanel();
simplePanel.setWidth(size + "px");
ScrollPanel parent = (ScrollPanel) simplePanel.getParent();
Element canvasContainerElement = canvasParent
.getWidgetContainerElement(canvas);
if ((minVal < 0 || maxVal > defWidth) && defWidth > 0
&& scrollbarsVisible == false) {
canvasContainerElement.getStyle().setBottom(SCROLL_SIZE,
Unit.PX);
onResize();
scrollbarsVisible = true;
} else if (minVal >= 0 && maxVal <= defWidth
&& scrollbarsVisible == true) {
canvasContainerElement.getStyle().setBottom(0, Unit.PX);
onResize();
scrollbarsVisible = false;
}
parent.setHorizontalScrollPosition(value - minVal);
// There is a missing event that isn't sent:
scroll(parent);
getLightweightSystem().getRootFigure().repaint();
}
示例14: 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();
}
示例15: 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");
}