本文整理匯總了Java中com.google.gwt.user.client.ui.ScrollPanel.setSize方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrollPanel.setSize方法的具體用法?Java ScrollPanel.setSize怎麽用?Java ScrollPanel.setSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.ScrollPanel
的用法示例。
在下文中一共展示了ScrollPanel.setSize方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: HistorySearch
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
/**
* HistorySearch
*/
public HistorySearch() {
stackPanel = new StackLayoutPanel(Unit.PX);
searchSaved = new SearchSaved();
userNews = new UserNews();
scrollSearchSavedPanel = new ScrollPanel();
scrollUserNewsSavedPanel = new ScrollPanel();
scrollSearchSavedPanel.addStyleName("okm-PanelSelected");
scrollUserNewsSavedPanel.addStyleName("okm-PanelSelected");
scrollSearchSavedPanel.add(searchSaved);
scrollSearchSavedPanel.setSize("100%", "100%");
scrollUserNewsSavedPanel.add(userNews);
scrollUserNewsSavedPanel.setSize("100%", "100%");
stackPanel.add(scrollSearchSavedPanel, Util.createHeaderHTML("img/icon/stackpanel/find.gif", Main.i18n("leftpanel.label.stored.search")), true, 22);
stackPanel.add(scrollUserNewsSavedPanel, Util.createHeaderHTML("img/icon/news.gif", Main.i18n("leftpanel.label.user.search")), true, 22);
stackPanel.showWidget(0);
stackPanel.setStyleName("okm-StackPanel");
stackPanel.addStyleName("okm-DisableSelect");
initWidget(stackPanel);
}
示例2: showSourceCode
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
protected void showSourceCode(String sourceCode) {
sourceCode = sourceCode.replaceAll("<", "<,").replace(">", ">");
final String html = "<pre class=\"brush: java; toolbar: false;\">" + sourceCode + "</pre>";
ScrollPanel sp = new ScrollPanel();
sp.setSize((Window.getClientWidth() * 0.6) + "px",
(Window.getClientHeight() * 0.7) + "px");
sp.add(new HTML(html));
DialogBoxWithCloseButton dialogBox = new DialogBoxWithCloseButton(false);
dialogBox.setWidget(sp);
dialogBox.setText(ShowcaseSearchPanel.I18N.viewSource(source));
dialogBox.center();
super.doFormat();
}
示例3: asWidget
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
/**
* @return the widget
*/
public Widget asWidget() {
_bindingConfiguration = DOM.createElement("pre"); //$NON-NLS-1$
Element code = DOM.createElement("code"); //$NON-NLS-1$
code.appendChild(_bindingConfiguration);
HTML html = new HTML();
html.getElement().appendChild(code);
html.setSize("100%", "100%"); //$NON-NLS-1$ //$NON-NLS-2$
ScrollPanel panel = new ScrollPanel();
panel.setStyleName("fill-layout-width"); //$NON-NLS-1$
panel.add(html);
panel.setSize("100%", "100%"); //$NON-NLS-1$ //$NON-NLS-2$
return panel;
}
示例4: showDebugMsgBox
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
public static void showDebugMsgBox(final String msg) {
if (_debugMsgBoxPopup == null) {
_debugMsgBox = new TextArea();
ScrollPanel wrapper = new ScrollPanel(_debugMsgBox);
wrapper.setSize("300px", "200px");
_debugMsgBoxPopup = new PopupPane("Debug", wrapper, false, false);
_debugMsgBox.setCharacterWidth(2000);
_debugMsgBox.setVisibleLines(10);
}
_debugMsgBox.setText(_debugMsgBox.getText() + "\n" + msg);
if (!_debugMsgBoxPopup.isVisible()) _debugMsgBoxPopup.show();
_debugMsgBox.getElement().setScrollTop(_debugMsgBox.getElement().getScrollHeight());
}
示例5: initPopup
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
public void initPopup(String popupText, String currentPageLink) {
createWidgets(popupText, currentPageLink);
final FlowPanel pfp = new FlowPanel();
pfp.add(filterPanel);
pfp.add(closeTop);
sp = new ScrollPanel(projectsTab);
sp.setSize("100%", "100%");
pfp.add(sp);
pfp.add(closeBottom);
popup.setWidget(pfp);
popup.setHeight("100%");
popupPosition = getPositionCallback();
}
示例6: onInitialize
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a Dock Panel
DockPanel dock = new DockPanel();
dock.setStyleName("cw-DockPanel");
dock.setSpacing(4);
dock.setHorizontalAlignment(DockPanel.ALIGN_CENTER);
// Add text all around
dock.add(new HTML(constants.cwDockPanelNorth1()), DockPanel.NORTH);
dock.add(new HTML(constants.cwDockPanelSouth1()), DockPanel.SOUTH);
dock.add(new HTML(constants.cwDockPanelEast()), DockPanel.EAST);
dock.add(new HTML(constants.cwDockPanelWest()), DockPanel.WEST);
dock.add(new HTML(constants.cwDockPanelNorth2()), DockPanel.NORTH);
dock.add(new HTML(constants.cwDockPanelSouth2()), DockPanel.SOUTH);
// Add scrollable text in the center
HTML contents = new HTML(constants.cwDockPanelCenter());
ScrollPanel scroller = new ScrollPanel(contents);
scroller.setSize("400px", "100px");
dock.add(scroller, DockPanel.CENTER);
// Return the content
dock.ensureDebugId("cwDockPanel");
return dock;
}
示例7: FieldFacetPane
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
public FieldFacetPane() {
main = new VerticalPanel();
main.setWidth("100%");
ScrollPanel sp = new ScrollPanel(main);
sp.setSize("100%", "100%");
initWidget(sp);
setStylePrimaryName("FieldFacetPane");
}
示例8: init
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
/**
* Initialize
*
* @param path Result root address
*/
protected void init(String path) {
this.setSize("650px", "400px");
this.setGlassEnabled(true);
this.setModal(true);
closeButton.setSize("10px", "10px");
closeButton.setStyleName("closebtn");
closeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
PreviewPopupPanel.this.hide();
}
});
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.add(closeButton);
verticalPanel.setCellHeight(closeButton, "13px");
verticalPanel.setStyleName("vpanel");
desc.setStyleName("popupTitle");
verticalPanel.add(desc);
verticalPanel.setCellHeight(desc, "30px");
HorizontalPanel hPanel = new HorizontalPanel();
savebtn.setStyleName("popupsavebtn");
savebtn.setVisible(false);
refreshBtn.setStyleName("popuprefreshbtn");
refreshBtn.setVisible(false);
uploadSubmitButton.setVisible(false);
hPanel.add(uploadSubmitButton);
hPanel.add(savebtn);
hPanel.add(refreshBtn);
hPanel.setCellVerticalAlignment(uploadSubmitButton,
HasVerticalAlignment.ALIGN_BOTTOM);
tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
tabPanel.setSize("650px", "355px");
dirPanel = new HorizontalPanel();
resultDirTree = PopupRetDirTreeLoad.load(path);
resultDirTree.getRoot().setState(false);
ScrollPanel dirScrollPanel = new ScrollPanel();
dirScrollPanel.add(resultDirTree);
dirScrollPanel.setAlwaysShowScrollBars(true);
dirScrollPanel.setSize("300px", "320px");
VerticalPanel fileViewPanel = new VerticalPanel();
fileLabel.setText("Please select a file to view!");
fileLabel.setStyleName("popupFileSelectName");
fileViewPanel.add(fileLabel);
fileTextArea.setStyleName("popupMsg");
fileTextArea.setSize("342px", "298px");
fileTextArea.getElement().setAttribute("wrap", "off");
fileTextArea.setReadOnly(true);
fileViewPanel.add(fileTextArea);
dirPanel.add(dirScrollPanel);
dirPanel.add(fileViewPanel);
tabPanel.add(dirPanel,"Results directory");
AbsolutePanel bottomPanel = new AbsolutePanel();
bottomPanel.setSize("650px", "360px");
bottomPanel.add(tabPanel, 0, 0);
bottomPanel.add(hPanel,460,3);
fileSizeLabel.setStyleName("popupFileSelectName");
verticalPanel.add(bottomPanel);
verticalPanel.add(fileSizeLabel);
this.add(verticalPanel);
this.setStyleName("loading_container");
}
示例9: MessageStack
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
/**
* MessageStack
*/
public MessageStack() {
status = new Status();
status.setStyleName("okm-StatusPopup");
stackPanel = new ExtendedStackPanel();
proposedSubscriptionReceived = new ProposedSubscriptionReceivedStack();
proposedQueryReceived = new ProposedQueryReceivedStack();
messageReceived = new MessageReceivedStack();
messageSent = new MessageSentStack();
scrollProposeSubscriptionReceivedPanel = new ScrollPanel();
scrollProposeQueryReceivedPanel = new ScrollPanel();
scrollMessageReceivedPanel = new ScrollPanel();
scrollMessageSentPanel = new ScrollPanel();
scrollProposeSubscriptionReceivedPanel.addStyleName("okm-PanelSelected");
scrollProposeQueryReceivedPanel.addStyleName("okm-PanelSelected");
scrollMessageReceivedPanel.addStyleName("okm-PanelSelected");
scrollMessageSentPanel.addStyleName("okm-PanelSelected");
scrollProposeSubscriptionReceivedPanel.add(proposedSubscriptionReceived);
scrollProposeQueryReceivedPanel.add(proposedQueryReceived);
scrollMessageReceivedPanel.add(messageReceived);
scrollMessageSentPanel.add(messageSent);
scrollProposeSubscriptionReceivedPanel.setSize("100%", "100%");
scrollProposeQueryReceivedPanel.setSize("100%", "100%");
scrollMessageSentPanel.setSize("100%", "100%");
// Mandatory can not be a resource bundle due IE problem !
stackPanel.add(scrollProposeSubscriptionReceivedPanel, UtilComunicator.createHeaderHTML("img/icon/actions/propose_subscription.png",
GeneralComunicator.i18nExtension("messaging.label.propose")), true, UIDesktopConstants.STACK_HEIGHT);
stackPanel.add(scrollProposeQueryReceivedPanel, UtilComunicator.createHeaderHTML("img/icon/actions/share_query.gif",
GeneralComunicator.i18nExtension("messaging.label.share.query")), true, UIDesktopConstants.STACK_HEIGHT);
stackPanel.add(scrollMessageReceivedPanel, UtilComunicator.createHeaderHTML("img/icon/actions/message_received.png",
GeneralComunicator.i18nExtension("messaging.label.message.received")), true, UIDesktopConstants.STACK_HEIGHT);
stackPanel.add(scrollMessageSentPanel, UtilComunicator.createHeaderHTML("img/icon/actions/message.png",
GeneralComunicator.i18nExtension("messaging.label.message.sent")), true, UIDesktopConstants.STACK_HEIGHT);
stackPanel.showWidget(0);
stackPanel.setStartUpFinished();
stackPanel.setStyleName("okm-StackPanel");
stackPanel.addStyleName("okm-DisableSelect");
initWidget(stackPanel);
}
示例10: StatDialog
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
public StatDialog() {
PopupChrome chrome = PopupChromeFactory.createPopupChrome();
popup = PopupFactory.createPopup(Document.get().getElementById(WebClient.APP_ELEMENT_ID),
new CenterPopupPositioner(), chrome, true);
htmlPanel = new HTMLPanel("");
htmlPanel.addDomHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
Element e = event.getNativeEvent().getEventTarget().cast();
if (e.getTagName().toLowerCase().equals("a")) {
event.preventDefault();
if (isClient) {
if (ID_ENABLE.equals(e.getId()) || ID_DISABLE.equals(e.getId())) {
Timing.setEnabled(!Timing.isEnabled());
showClientStatistic();
} else if (ID_CLEAR.equals(e.getId())) {
Timing.clearStatistics();
showClientStatistic();
}
} else {
String href = e.getPropertyString("href");
int index = href.lastIndexOf('/');
if (index != -1) {
showUrl(StatService.STAT_URL + href.substring(index+1));
}
}
}
}
}, ClickEvent.getType());
ScrollPanel scroll = new ScrollPanel(htmlPanel);
scroll.setSize(RootPanel.get().getOffsetWidth()-100 + "px",
RootPanel.get().getOffsetHeight()-200 + "px");
targetButton = new DialogButton("", new Command() {
@Override
public void execute() {
if (isClient) {
showServerStatistic();
} else {
showClientStatistic();
}
}
});
exitButton = new DialogButton("Exit", new Command() {
@Override
public void execute() {
popup.hide();
}
});
DialogBox.create(popup, "", scroll, new DialogButton[] { targetButton, exitButton });
}
示例11: StatDialog
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
public StatDialog() {
PopupChrome chrome = PopupChromeFactory.createPopupChrome();
popup = PopupFactory.createPopup(
Document.get().getElementById("app"), new CenterPopupPositioner(), chrome, true);
htmlPanel = new HTMLPanel("");
htmlPanel.addDomHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
Element e = event.getNativeEvent().getEventTarget().cast();
if (e.getTagName().toLowerCase().equals("a")) {
event.preventDefault();
if (isClient) {
if (ID_ENABLE.equals(e.getId()) || ID_DISABLE.equals(e.getId())) {
Timing.setEnabled(!Timing.isEnabled());
showClientStatistic();
} else if (ID_CLEAR.equals(e.getId())) {
Timing.clearStatistics();
showClientStatistic();
}
} else {
String href = e.getPropertyString("href");
int index = href.lastIndexOf('/');
if (index != -1) {
showUrl(StatService.STAT_URL + href.substring(index+1));
}
}
}
}
}, ClickEvent.getType());
ScrollPanel scroll = new ScrollPanel(htmlPanel);
scroll.setSize(RootPanel.get().getOffsetWidth()-100 + "px",
RootPanel.get().getOffsetHeight()-200 + "px");
targetButton = new DialogBox.DialogButton("", new Command() {
@Override
public void execute() {
if (isClient) {
showServerStatistic();
} else {
showClientStatistic();
}
}
});
exitButton = new DialogBox.DialogButton("Exit", new Command() {
@Override
public void execute() {
popup.hide();
}
});
DialogBox.create(popup, "", scroll,
new DialogBox.DialogButton[] { targetButton, exitButton });
}
示例12: onInitialize
import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a static tree and a container to hold it
Tree staticTree = createStaticTree();
staticTree.setAnimationEnabled(true);
staticTree.ensureDebugId("cwTree-staticTree");
ScrollPanel staticTreeWrapper = new ScrollPanel(staticTree);
staticTreeWrapper.ensureDebugId("cwTree-staticTree-Wrapper");
staticTreeWrapper.setSize("300px", "300px");
// Wrap the static tree in a DecoratorPanel
DecoratorPanel staticDecorator = new DecoratorPanel();
staticDecorator.setWidget(staticTreeWrapper);
// Create a dynamically generated tree and a container to hold it
final Tree dynamicTree = createDynamicTree();
dynamicTree.ensureDebugId("cwTree-dynamicTree");
ScrollPanel dynamicTreeWrapper = new ScrollPanel(dynamicTree);
dynamicTreeWrapper.ensureDebugId("cwTree-dynamicTree-Wrapper");
dynamicTreeWrapper.setSize("300px", "300px");
// Wrap the dynamic tree in a DecoratorPanel
DecoratorPanel dynamicDecorator = new DecoratorPanel();
dynamicDecorator.setWidget(dynamicTreeWrapper);
// Combine trees onto the page
Grid grid = new Grid(2, 3);
grid.setCellPadding(2);
grid.getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_TOP);
grid.setHTML(0, 0, constants.cwTreeStaticLabel());
grid.setHTML(0, 1, " ");
grid.setHTML(0, 2, constants.cwTreeDynamicLabel());
grid.setWidget(1, 0, staticDecorator);
grid.setHTML(1, 1, " ");
grid.setWidget(1, 2, dynamicDecorator);
// Wrap the trees in DecoratorPanels
return grid;
}