本文整理汇总了Java中com.google.gwt.event.logical.shared.ResizeHandler类的典型用法代码示例。如果您正苦于以下问题:Java ResizeHandler类的具体用法?Java ResizeHandler怎么用?Java ResizeHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResizeHandler类属于com.google.gwt.event.logical.shared包,在下文中一共展示了ResizeHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createView
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public void createView() {
shell = new ResizeLayoutPanel();
shell.setSize("100%", "100%");
shell.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
forceLayout();
}
});
panel = new DockLayoutPanel(Style.Unit.PX);
panel.setSize("100%", "100%");
shell.add(panel);
Widget header = createNorth();
panel.addNorth(header, 128);
Widget footer = createSouth();
panel.addSouth(footer, 42);
}
示例2: createWidget
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
private void createWidget() {
widgetPanel = new ResizeLayoutPanel();
widgetPanel.addStyleName(style.widgetPanel());
widgetPanel.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
forceLayout();
}
});
panel = new FlowPanel();
panel.addStyleName(style.panel());
widgetPanel.add(panel);
label = new Label();
label.addStyleName(style.label());
panel.add(label);
textBox = new TextBox();
textBox.addStyleName(style.textBox());
panel.add(textBox);
initWidget(widgetPanel);
}
示例3: initWindow
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public static void initWindow() {
// consoleContainer = new AbsolutePanel();
// consoleContainer.setWidth("3000px");
// consoleContainer.setHeight("3000px");
// RootPanel.get().add(consoleContainer, 0, 0);
// //consoleContainer.getElement().getStyle().setPosition(Position.FIXED);
updateWindowInfo();
if (isMobile) {
initMobile();
} else {
// Prevent scrollbars from being shown
Window.enableScrolling(false);
}
// Add window resize handler
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
doResizeAndRotate();
}
});
}
示例4: setResizeCheckingEnabled
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
/**
* Set whether or not resize checking is enabled. If disabled, elements will
* still be resized on window events, but the timer will not check their
* dimensions periodically.
*
* @param enabled true to enable the resize checking timer
*/
public void setResizeCheckingEnabled(boolean enabled) {
if (enabled && !resizeCheckingEnabled) {
resizeCheckingEnabled = true;
if (windowHandler == null) {
windowHandler = Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
onWindowResized(event.getWidth(), event.getHeight());
}
});
}
resizeCheckTimer.schedule(resizeCheckDelay);
} else if (!enabled && resizeCheckingEnabled) {
resizeCheckingEnabled = false;
if (windowHandler != null) {
windowHandler.removeHandler();
windowHandler = null;
}
resizeCheckTimer.cancel();
}
}
示例5: BasicImageGrid
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public BasicImageGrid(AbstractPreviewData previewData) {
super.setSize("100%", "100%");
_previewData = (PreviewImageGridCreator.ImageGridPreviewData)previewData;
mainPanel.setSize("100%", "100%");
super.add(mainPanel);
GwtUtil.setStyle(mainPanel, "backgroundColor", GRID_BACKGROUND_DEFAULT_COLOR);
GwtUtil.setStyle(this, "backgroundColor", GRID_BACKGROUND_DEFAULT_COLOR);
setPlotWidgetGroupValue(_previewData.getPlotWidgetGroup());
for (int i = 0; i < INIT_SIZE; i++) {
createAndAddMiniPlotWidget();
}
getPlotWidgetGroup().setImageGrid(this);
getPlotWidgetGroup().setGridPopoutColumns(_previewData.getGridPopoutCols());
getPlotWidgetGroup().setGridPopoutZoomType(_previewData.getGridPopoutZoomtype());
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
resize();
}
});
plotError = new MiniPlotWidget.PlotError() {
public void onError(WebPlot wp, String briefDesc, String desc, String details, Exception e) {
}
};
}
示例6: addXYPlot
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public static void addXYPlot(JscriptRequest jspr, String div) {
Map<String,String> paramMap= jspr.asMap();
WidgetFactory factory= Application.getInstance().getWidgetFactory();
TablePreview xyPrev= factory.createObserverUI(WidgetFactory.XYPLOT,paramMap);
xyPrev.bind(FFToolEnv.getHub());
SimplePanel panel= makeCenter();
panel.add(xyPrev.getDisplay());
FFToolEnv.addToPanel(div, panel, "XY Plot");
if (xyPrev.getDisplay() instanceof RequiresResize) {
final RequiresResize resizer= (RequiresResize)xyPrev.getDisplay();
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
resizer.onResize();
}
});
}
}
示例7: ResizableLayoutManager
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public ResizableLayoutManager(int minWidth, int minHeight) {
super(minWidth, minHeight);
mainPanel = new DockPanel();
// resizer = new Resizer();
Window.addResizeHandler(new ResizeHandler(){
public void onResize(ResizeEvent event) {
Application.getInstance().resize();
}
});
// WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW,
// new WebEventListener(){
// public void eventNotify(WebEvent ev) {
// resizer.setVisible(Application.getInstance().hasSearchResult());
// }
// });
setupStatusRegion(this);
}
示例8: show
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
@Override
public void show() {
if (recenter == null) {
recenter =
Window.addResizeHandler(
new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
final int w = event.getWidth();
final int h = event.getHeight();
AutoCenterDialogBox.this.onResize(w, h);
}
});
}
super.show();
}
示例9: onShowView
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
@Override
public void onShowView() {
super.onShowView();
Window.enableScrolling(false);
if (prefs.hideTopMenu()) {
Gerrit.setHeaderVisible(false);
}
resizeHandler =
Window.addResizeHandler(
new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
resizeCodeMirror();
}
});
}
示例10: setComponentResized
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public void setComponentResized(JavaScriptObject aValue) {
if (componentResized != aValue) {
if (componentResizedReg != null) {
componentResizedReg.removeHandler();
componentResizedReg = null;
}
componentResized = aValue;
if (componentResized != null && component instanceof HasResizeHandlers)
componentResizedReg = ((HasResizeHandlers) component).addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
if (componentResized != null) {
executeEvent(componentResized, EventsPublisher.publish(event));
}
}
});
}
}
示例11: AbstractView
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public AbstractView() {
super(Style.Unit.PX);
setWidth(Window.getClientWidth() + "px");
setHeight(Window.getClientHeight() + "px");
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
int height = event.getHeight();
setHeight(height + "px");
int width = event.getWidth();
setWidth(width + "px");
parentResized(height, width, "px");
}
});
}
示例12: TwitterTimelineWindow
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
public TwitterTimelineWindow(String title, String href, String dataWidgetId) {
this.href = href;
this.dataWidgetId = dataWidgetId;
fireHideEvent = true;
window = new Window();
window.setHeadingText(title);
window.setWidth(450);
window.setHeight(490);
window.setCollapsible(false);
window.setResizable(true);
window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
if (timelineWidget != null) {
timelineWidget.setSize(event.getWidth(), event.getHeight());
}
}
});
window.show();
window.center();
loadTimeline();
}
示例13: initialize
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
@Override
public void initialize() {
contactHistoryGrid = new Grid<ContactHistory>(new ListStore<ContactHistory>(), buildColumnModel());
contactHistoryGrid.getView().setForceFit(true);
contactHistoryGrid.setAutoHeight(true);
contactHistoryGrid.addListener(Events.ViewReady, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
resizeGrid(contactHistoryGrid, container, true);
}
});
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
resizeGrid(contactHistoryGrid, container, true);
}
});
container = Panels.content(null, false, Layouts.vBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH, new Layouts.LayoutOptions(new Padding(10))), "x-border-layout-ct");
container.setScrollMode(Style.Scroll.AUTOY);
container.add(contactHistoryGrid);
add(container);
}
示例14: addTab
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
@Override
public void addTab(String tabTitle, final Widget tabView) {
final TabItem tabItem = new TabItem(tabTitle);
tabItem.addListener(Events.Select, new Listener<ComponentEvent>() {
@Override
public void handleEvent(ComponentEvent be) {
fixTabViewHeight(tabView, tabItem);
}
});
tabItem.add(tabView);
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
fixTabViewHeight(tabView, tabItem);
}
});
fixTabViewHeight(tabView, tabItem);
tabPanel.add(tabItem);
}
示例15: show
import com.google.gwt.event.logical.shared.ResizeHandler; //导入依赖的package包/类
@Override
public void show() {
if (resizeHandlerRegistration == null) {
resizeHandlerRegistration = Window
.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
windowWidth = event.getWidth();
}
});
}
Timer timer = new Timer() {
public void run() {
getElement().getStyle().setProperty("clip", "auto");
}
};
timer.schedule(300);
super.show();
}