本文整理汇总了Java中com.smartgwt.client.widgets.Window.setKeepInParentRect方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setKeepInParentRect方法的具体用法?Java Window.setKeepInParentRect怎么用?Java Window.setKeepInParentRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.smartgwt.client.widgets.Window
的用法示例。
在下文中一共展示了Window.setKeepInParentRect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWindow
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
private Window createWindow(DynamicForm form) {
VLayout container = new VLayout();
container.setMembers(form, createButtons());
container.setMargin(15);
Window window = new Window();
window.setAutoCenter(true);
window.setAutoSize(true);
window.setIsModal(true);
window.addItem(container);
window.setTitle(i18nSgwt.dialog_LoginTitle());
window.setShowCloseButton(false);
window.setShowMinimizeButton(false);
window.setKeepInParentRect(true);
window.setShowModalMask(true);
window.setCanDragReposition(false);
return window;
}
示例2: createFullImageWindow
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
private Window createFullImageWindow(Canvas content) {
final Window window = new Window();
window.setWidth(Page.getWidth() - 200);
window.setHeight(Page.getHeight() - 40);
window.setAutoCenter(true);
window.setMaximized(true);
window.setCanDragResize(true);
window.setCanDragReposition(true);
window.setIsModal(true);
window.setDismissOnEscape(true);
window.setDismissOnOutsideClick(true);
window.setKeepInParentRect(true);
window.setShowMaximizeButton(true);
window.setShowMinimizeButton(false);
window.setModalMaskOpacity(10);
window.setShowModalMask(true);
window.setShowResizer(true);
window.setTitle(i18n.DigitalObjectPreview_Window_Title());
window.setBodyColor(BACKGROUND_COLOR);
window.setCanFocus(true);
window.addItem(content);
window.setHeaderControls(HeaderControls.HEADER_ICON, HeaderControls.HEADER_LABEL,
getWindowZoomer(), HeaderControls.MAXIMIZE_BUTTON, HeaderControls.CLOSE_BUTTON);
window.addCloseClickHandler(new CloseClickHandler() {
@Override
public void onCloseClick(CloseClickEvent event) {
event.cancel();
window.close();
onWindowClose();
}
});
return window;
}
示例3: createWindow
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
private Window createWindow() {
VLayout layout = new VLayout(5);
layout.setLayoutAlign(Alignment.CENTER);
layout.setAlign(Alignment.CENTER);
layout.setWidth100();
Label label = new Label(messages.searchControllerSearchingMessage());
label.setWidth100();
label.setHeight(30);
label.setAlign(Alignment.CENTER);
layout.addMember(label);
HTMLPane img = new HTMLPane();
img.setLayoutAlign(Alignment.CENTER);
img.setAlign(Alignment.CENTER);
img.setWidth(20);
img.setHeight(20);
img.setOverflow(Overflow.HIDDEN);
img.setContents("<img src=\"" + Geomajas.getIsomorphicDir()
+ "/geomajas/ajax-loader.gif\" width=\"18\" height=\"18\" />");
layout.addMember(img);
Window w = new DockableWindow();
w.setTitle(messages.searchControllerSearchingTitle());
w.setAlign(Alignment.CENTER);
w.setPadding(5);
w.setHeight(100);
w.setWidth(300);
w.addItem(layout);
w.setShowMinimizeButton(false);
w.setShowCloseButton(false);
w.setKeepInParentRect(true);
w.setAutoCenter(true);
return w;
}
示例4: createWindow
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
private Window createWindow(String subtitle) {
Window w = new Window();
w.setWidth(windowWidth);
w.setHeight(windowHeight);
w.setTitle(I18nProvider.getAttribute().getAttributeWindowTitle(subtitle));
w.setCanDragReposition(true);
w.setCanDragResize(true);
w.setAutoCenter(true);
w.setKeepInParentRect(true);
return w;
}
示例5: keepWindowInScreen
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
/**
* Try to force a window to stay within the screen bounds.
*
* @param window window to affect
*/
public static void keepWindowInScreen(Window window) {
window.setKeepInParentRect(true);
if (null != window.getHeightAsString()) {
int screenHeight = com.google.gwt.user.client.Window.getClientHeight();
int windowHeight = window.getViewportHeight();
window.setMaxHeight(screenHeight - WidgetLayout.windowOffset * 2);
if (windowHeight + window.getAbsoluteTop() > screenHeight) {
int top = screenHeight - windowHeight;
if (top >= 0) {
window.setPageTop(top);
} else {
window.setHeight(screenHeight - WidgetLayout.windowOffset);
window.setPageTop(WidgetLayout.windowOffset);
}
}
}
if (null != window.getWidthAsString()) {
int screenWidth = com.google.gwt.user.client.Window.getClientWidth();
int windowWidth = window.getViewportWidth();
window.setMaxWidth(screenWidth - WidgetLayout.windowOffset * 2);
if (windowWidth + window.getAbsoluteLeft() > screenWidth) {
int left = screenWidth - windowWidth;
if (left >= 0) {
window.setPageLeft(left);
} else {
window.setWidth(screenWidth - WidgetLayout.windowOffset);
window.setPageLeft(WidgetLayout.windowOffset);
}
}
}
}
示例6: SamplePanel
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
/**
* Constructor for the base sample panel. All extensions should have a public default constructor that uses this
* constructor.
*/
protected SamplePanel() {
setWidth100();
setHeight100();
setMembersMargin(10);
HLayout hLayout = new HLayout();
hLayout.setMembersMargin(10);
hLayout.setWidth100();
Canvas samplePanel = getViewPanel();
samplePanel.setHeight100();
samplePanel.setWidth("*");
hLayout.addMember(samplePanel);
String description = getDescription();
if (description != null) {
VLayout rightLayout = new VLayout();
rightLayout.setMembersMargin(15);
rightLayout.setWidth(220);
IButton sourceButton = new IButton(MESSAGES.generalSourceButton());
sourceButton.setIcon("[ISOMORPHIC]/geomajas/example/image/silk/script_go.png");
sourceButton.setLayoutAlign(Alignment.RIGHT);
sourceButton.setShowDisabledIcon(false);
sourceButton.setWidth(125);
sourceButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
getJavaSource();
}
});
rightLayout.addMember(sourceButton);
Window descriptionWindow = new Window();
descriptionWindow.setTitle(MESSAGES.generalDescription());
descriptionWindow.setHeaderIcon(WidgetLayout.iconGeomajas, 16, 16);
descriptionWindow.setShowEdges(true);
descriptionWindow.setKeepInParentRect(true);
descriptionWindow.setHeaderControls(HeaderControls.HEADER_ICON, HeaderControls.HEADER_LABEL);
Canvas contents = new Canvas();
contents.setCanSelectText(true);
contents.setPadding(5);
contents.setContents(description);
contents.setDefaultWidth(200);
descriptionWindow.setAutoSize(true);
descriptionWindow.setAutoHeight();
descriptionWindow.addItem(contents);
rightLayout.addMember(descriptionWindow);
hLayout.addMember(rightLayout);
}
addMember(hLayout);
}
示例7: showFiles
import com.smartgwt.client.widgets.Window; //导入方法依赖的package包/类
private void showFiles(Map<String, String> fileContents) {
Window sourceWindow = new Window();
sourceWindow.setTitle(MESSAGES.generalSourceTitle());
sourceWindow.setHeaderIcon(WidgetLayout.iconGeomajas, 16, 16);
sourceWindow.setKeepInParentRect(true);
sourceWindow.setWidth(640);
sourceWindow.setHeight(480);
sourceWindow.setTop(100);
sourceWindow.setLeft(100);
sourceWindow.setMembersMargin(5);
sourceWindow.setCanDragReposition(true);
sourceWindow.setCanDragResize(true);
TabSet tabs = new TabSet();
tabs.setTabBarPosition(Side.TOP);
tabs.setWidth100();
tabs.setHeight100();
addSourceTab(tabs, fileContents.get(getSourceFileName()));
for (Entry<String, String> entry : fileContents.entrySet()) {
if (!entry.getKey().equals(getSourceFileName())) {
VLayout resourceLayout = new VLayout();
HTMLPane tabPane = new HTMLPane();
tabPane.setWidth100();
tabPane.setHeight100();
tabPane.setContents("<pre style='color:#000000;'>" + XmlParser.parseXML(entry.getValue()) + "</pre>");
tabPane.setContentsType(ContentsType.PAGE);
Label resourceLabel = new Label(MESSAGES.generalFile() + ": <b>"
+ entry.getKey() + "</b>");
resourceLabel.setHeight(30);
resourceLabel.setPadding(5);
resourceLayout.addMember(resourceLabel);
VLayout paneLayout = new VLayout();
paneLayout.setBorder("1px solid #C0C0C0");
paneLayout.addMember(tabPane);
resourceLayout.addMember(paneLayout);
String tabTitle = entry.getKey();
int pos = tabTitle.lastIndexOf('/');
tabTitle = tabTitle.substring(pos + 1);
Tab tab = new Tab(tabTitle, "[ISOMORPHIC]/geomajas/example/image/silk/script_go.png");
tab.setPane(resourceLayout);
tabs.addTab(tab);
}
}
sourceWindow.addItem(tabs);
addChild(sourceWindow);
sourceWindow.show();
}