Exemple #1
0
 /**
  * Sets a preferred width that serves as a hint in calculating the preferred size of the <code>
  * HtmlPanel</code>. Note that the preferred size can only be calculated when a document is
  * available, and it will vary during incremental rendering.
  *
  * <p>This method currently does not have any effect when the document is a FRAMESET.
  *
  * <p>Note also that setting the preferred width (to a value other than <code>-1</code>) will
  * negatively impact performance.
  *
  * @param width The preferred width, or <code>-1</code> to unset.
  */
 public void setPreferredWidth(final int width) {
   this.preferredWidth = width;
   final HtmlBlockPanel htmlBlock = this.htmlBlockPanel;
   if (htmlBlock != null) {
     htmlBlock.setPreferredWidth(width);
   }
 }
Exemple #2
0
 private void setUpAsBlock(final UserAgentContext ucontext, final HtmlRendererContext rcontext) {
   final HtmlBlockPanel shp = this.createHtmlBlockPanel(ucontext, rcontext);
   shp.setPreferredWidth(this.preferredWidth);
   shp.setDefaultOverflowX(this.defaultOverflowX);
   shp.setDefaultOverflowY(this.defaultOverflowY);
   this.htmlBlockPanel = shp;
   this.frameSetPanel = null;
   this.removeAll();
   this.add(shp);
   this.nodeRenderer = shp;
 }