當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollPanel.setSize方法代碼示例

本文整理匯總了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);
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:28,代碼來源:HistorySearch.java

示例2: showSourceCode

import com.google.gwt.user.client.ui.ScrollPanel; //導入方法依賴的package包/類
protected void showSourceCode(String sourceCode) {
    sourceCode = sourceCode.replaceAll("<", "&lt,").replace(">", "&gt;");

    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();
}
 
開發者ID:iSergio,項目名稱:gwt-cs,代碼行數:17,代碼來源:ShowSourceButton.java

示例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;
}
 
開發者ID:jboss-switchyard,項目名稱:switchyard,代碼行數:21,代碼來源:BindingDetailsWidget.java

示例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());
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:14,代碼來源:GwtUtil.java

示例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();
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:14,代碼來源:ProjectListPopup.java

示例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;
}
 
開發者ID:Peergos,項目名稱:Peergos,代碼行數:31,代碼來源:CwDockPanel.java

示例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");
}
 
開發者ID:cominvent,項目名稱:solr-explorer,代碼行數:9,代碼來源:FieldFacetPane.java

示例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");
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:72,代碼來源:PreviewPopupPanel.java

示例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);
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:47,代碼來源:MessageStack.java

示例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 });
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:55,代碼來源:StatDialog.java

示例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 });
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:56,代碼來源:StatDialog.java

示例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, "&nbsp;&nbsp;&nbsp;");
  grid.setHTML(0, 2, constants.cwTreeDynamicLabel());
  grid.setWidget(1, 0, staticDecorator);
  grid.setHTML(1, 1, "&nbsp;&nbsp;&nbsp;");
  grid.setWidget(1, 2, dynamicDecorator);

  // Wrap the trees in DecoratorPanels
  return grid;
}
 
開發者ID:Peergos,項目名稱:Peergos,代碼行數:44,代碼來源:CwTree.java


注:本文中的com.google.gwt.user.client.ui.ScrollPanel.setSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。