Tabnine Logo
SDimension.getHeight
Code IndexAdd Tabnine to your IDE (free)

How to use
getHeight
method
in
org.wings.SDimension

Best Java code snippets using org.wings.SDimension.getHeight (Showing top 20 results out of 315)

origin: io.github.dheid/wings

public String toString() {
  return "width: " + getWidth() + "; height: " + getHeight();
}
origin: io.github.dheid/wings

styleString.append("height:").append(preferredSize.getHeight()).append(';');
origin: io.github.dheid/wings

String height = preferredSize != null ? preferredSize.getHeight() : null;
boolean clientLayout = height != null && Utils.isMSIE(container) && !"auto".equals(height)
  && (layout instanceof SBorderLayout || layout instanceof SGridBagLayout || layout instanceof SCardLayout);
origin: io.github.dheid/wings

@Override
public void writeInternal(Device device, SComponent component) throws IOException {
  SScrollPane scrollpane = (SScrollPane) component;
  if (scrollpane.getMode() == SScrollPane.MODE_COMPLETE) {
    SDimension preferredSize = scrollpane.getPreferredSize();
    if (preferredSize == null) {
      scrollpane.setPreferredSize(new SDimension(200, 400));
    } else {
      if (preferredSize.getWidthInt() < 0) Utils.setPreferredSize(component, "200", preferredSize.getHeight());
      if (preferredSize.getHeightInt() < 0) Utils.setPreferredSize(component, preferredSize.getWidth(), "400");;
    }
    ScriptManager.getInstance().addScriptListener(new LayoutScrollPaneScript(component.getName()));
    writeContent(device, component);
  } else {
    writeContent(device, component);
  }
  
  Adjustable sb = scrollpane.getVerticalScrollBar();
  SComponent viewport = (SComponent)scrollpane.getScrollable();
  if (viewport != null && sb instanceof SScrollBar) {
    final JavaScriptDOMListener handleMouseWheel = new JavaScriptDOMListener(
        "DOMMouseScroll",
        "wingS.scrollbar.handleMouseWheel", '\'' +((SScrollBar)sb).getName()+ '\'', viewport);
    viewport.addScriptListener(handleMouseWheel);            
  }
}
origin: io.github.dheid/wings

public SDimension(SDimension dim) {
  this(dim.getWidth(), dim.getHeight());
}
origin: io.github.dheid/wings

private static String getInitScript(SPopup popup) {
  String anchor = popup.isAnchored() ? popup.getAnchor().getName() : "";
  String corner = popup.isAnchored() ? popup.getCorner() : "";
  String name = "popup_" + popup.getName();
  SDimension dim = popup.getPreferredSize();
  if (dim == null) {
    dim = DEFAULT_DIMENSION;
  }
  String heightUnit = dim.getHeightUnit();
  if (heightUnit != null && !heightUnit.equals("px")) {
    throw new IllegalStateException("Only 'px' is a valid unit, but height was specified as " + dim.getHeight());
  }
  String widthUnit = dim.getWidthUnit();
  if (widthUnit != null && !widthUnit.equals("px")) {
    throw new IllegalStateException("Only 'px' is a valid unit, but width was specified as " + dim.getWidth());
  }
  StringBuilder code = new StringBuilder();
  code.append("if (document.getElementById('").append(popup.getName()).append("yahoo') != null) { return; }\n");
  code.append(name).
      append(" = new wingS.Popup(").
      append('\'').append(popup.getName()).append("', ").append(popup.getX()).append(", ").append(popup.getY()).append(", ").
      append(dim.getWidthInt()).append(", ").
      append(dim.getHeightInt()).append(", ").
      append('\'').append(anchor).append("', ").
      append('\'').append(corner).append('\'').
      append(");");
  code.append(name).append(".show();");
  return code.toString();
}
origin: io.github.dheid/wings

/**
 * Prints a HTML style attribute with widht/height of 100% if the passed dimension defines a height or width..
 * <p>Sample: <code> style="width:100%;"</code>
 * <p/>
 * <p>This is typicall needed to stretch inner HTML element to expand to the full dimenstion defined
 * on an outer, sized HTML element. Otherwise the component would appear to small (as size is applied only
 * on the invisible outer limiting element)
 *
 * @param device        Device to print to
 * @param preferredSize trigger dimension
 */
public static void printCSSInlineFullSize(Device device, SDimension preferredSize) throws IOException {
  if ((preferredSize != null) &&
      (!SDimension.AUTO.equals(preferredSize.getWidth()) ||
       !SDimension.AUTO.equals(preferredSize.getHeight())))
  {
    // opera doesn't show height 100% when parent has no defined height
    if (!SDimension.AUTO.equals(preferredSize.getHeight())) {
      device.print(" style=\"width:100%;height:100%\"");
    } else {
      device.print(" style=\"width:100%\"");
    }
  }
}
origin: io.github.dheid/wings

public static void optFullSize(Device device, SComponent component) throws IOException {
  SDimension dim = component.getPreferredSize();
  if (dim != null) {
    String width = dim.getWidth();
    boolean widthSet = width != null && !"".equals(width) && !SDimension.AUTO.equals(width);
    String height = dim.getHeight();
    boolean heightSet = height != null && !"".equals(height) && !SDimension.AUTO.equals(height);
    StringBuilder style = new StringBuilder();
    if (widthSet) {
      style.append("width:100%;");
    }
    if (heightSet) {
      style.append("height:100%;");
    }
    if (style.length() > 0)
      Utils.optAttribute(device, "style", style);
  }
}
origin: io.github.dheid/wings

/**
 * Prints a HTML style attribute with widht/height of 100% if the passed dimension defines a height or width..
 * <p>Sample: <code> style="width:100%;"</code>
 * <p/>
 * <p>This is typicall needed to stretch inner HTML element to expand to the full dimenstion defined
 * on an outer, sized HTML element. Otherwise the component would appear to small (as size is applied only
 * on the invisible outer limiting element)
 *
 * @param pStringBuilder buffer to append to
 * @param pComponent      preferredSize trigger dimension
 */
public static void appendCSSInlineFullSize(StringBuilder pStringBuilder, SComponent pComponent) {
  SDimension preferredSize = pComponent.getPreferredSize();
  if (preferredSize != null &&
    (!SDimension.AUTO.equals(preferredSize.getWidth()) || !SDimension.AUTO.equals(preferredSize.getHeight())))
  {
    pStringBuilder.append("width:100%;height:100%;");
  }
}
origin: io.github.dheid/wings-experimental

  height = getPreferredSize().getHeight();
  width = getPreferredSize().getWidth();
} else {
origin: io.github.dheid/wings

/**
 * @param d the device to write the code to
 * @param l the layout manager
 * @throws IOException
 */
@Override
public void write(Device d, SLayoutManager l)
    throws IOException
{
  SCardLayout cardLayout = (SCardLayout) l;
  SContainer container = l.getContainer();
  SComponent c = cardLayout.getVisibleComponent();
  SDimension preferredSize = container.getPreferredSize();
  String height = preferredSize != null ? preferredSize.getHeight() : null;
  boolean clientLayout = Utils.isMSIE(container) && height != null && !"auto".equals(height);
  if (clientLayout)
    d.print("<tr yweight=\"100\">");
  else
    openLayouterRow(d, "100%");
  openLayouterCell(d, c);
  // Just present visible component
  if (c != null) {
    c.write(d);
  }
  closeLayouterCell(d);
  closeLayouterRow(d);
}
origin: io.github.dheid/wings

String height = preferredSize != null ? preferredSize.getHeight() : null;
boolean clientLayout = Utils.isMSIE(container) && height != null && !"auto".equals(height);
origin: io.github.dheid/wings

String height = preferredSize != null ? preferredSize.getHeight() : null;
boolean clientLayout = Utils.isMSIE(scrollPane) && height != null && !"auto".equals(height)
  && scrollPane.getMode() != SScrollPane.MODE_COMPLETE;
origin: io.github.dheid/wings

if (tableWrapping) {
  actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  device.print("<table style=\"table-layout: fixed; width: " + actualWidth + "\"><tr>");
  device.print("<td style=\"padding-right: " + Utils.calculateHorizontalOversize(component, true) + "px\">");
device.print("/>");
if (tableWrapping) {
  Utils.setPreferredSize(component, actualWidth, preferredSize.getHeight());
  device.print("</td></tr></table>");
origin: io.github.dheid/wings

private static void writeVerticalScrollbar(Device device, SScrollBar sb) throws IOException {
  SDimension preferredSize = sb.getPreferredSize();
  String height = preferredSize != null ? preferredSize.getHeight() : null;
  boolean clientLayout = Utils.isMSIE(sb) && height != null && !"auto".equals(height);
  Utils.printNewline(device, sb);
  device.print("<table");
  if (clientLayout) {
    Utils.optAttribute(device, "layoutHeight", height);
    Utils.setPreferredSize(sb, preferredSize.getWidth(), null);
  }
  sb.setAttribute(CSSProperty.TABLE_LAYOUT, "fixed");
  Utils.writeAllAttributes(device, sb);
  if (clientLayout) {
    Utils.setPreferredSize(sb, preferredSize.getWidth(), height);
    sb.getSession().getScriptManager().addScriptListener(new LayoutFillScript(sb.getName()));
  }
  device.print("><tbody><tr><td>\n");
  device.print("<div class=\"outer\"><div class=\"inner\"/></div>\n");
  device.print("</td></tr></tbody></table>");
  sb.getSession().getScriptManager().addScriptListener(new VerticalScrollBarLayoutScript(sb));
  sb.getSession().getScriptManager().addScriptListener(new VerticalScrollBarSetScript(sb));
}
origin: io.github.dheid/wings-experimental

if (tableWrapping) {
  String actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  device.print("<table style=\"table-layout: fixed; width: " + actualWidth + "\"><tr>");
  device.print("<td style=\"padding-right: " + Utils.calculateHorizontalOversize(component, true) + "px\">");
origin: io.github.dheid/wings

String height = preferredSize != null ? preferredSize.getHeight() : null;
boolean clientLayout = Utils.isMSIE(form) && height != null && !"auto".equals(height)
  && (layout instanceof SBorderLayout || layout instanceof SGridBagLayout);
origin: org.jspresso.framework/jspresso-wings-application

scrollPane.setViewportView(viewComponent);
scrollPane.setPreferredSize(new SDimension("180px", scrollPane
  .getPreferredSize().getHeight()));
IView<SComponent> view = constructView(scrollPane, viewDescriptor,
  connector);
origin: io.github.dheid/wings

if (ieTableWrapping) {
  actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  if (component.getSession().getUserAgent().getMajorVersion() >= 7) {
    device.print("<table style=\"width: " + actualWidth + "\"><tr>");
  Utils.setPreferredSize(component, actualWidth, preferredSize.getHeight());
  device.print("</td></tr></table>");
origin: org.jspresso/jspresso-wings-application

scrollPane.setViewportView(viewComponent);
scrollPane.setPreferredSize(new SDimension("180px", scrollPane
  .getPreferredSize().getHeight()));
IView<SComponent> view = constructView(scrollPane, viewDescriptor,
  connector);
org.wingsSDimensiongetHeight

Popular methods of SDimension

  • <init>
  • getWidth
  • getHeightInt
    Get just the height as number without trailing unit.
  • getWidthInt
    Get just the width as number without trailing unit.
  • getWidthUnit
  • equals
  • extractNumericValue
    Extract number from string.
  • extractUnit
    Tries to extract unit from passed string. I.e. returtn "px" if you pass "120px".
  • getHeightUnit
  • setHeight
    Sets the preferred height via an string. Expects an dimension/unit compount i.e. "120px" or "80%" bu
  • setSize
    Set the size of this Dimension object to the specified width and height.
  • setWidth
    Sets the preferred width via an string. Expects an dimension/unit compount i.e. "120px" or "80%" but
  • setSize,
  • setWidth,
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JLabel (javax.swing)
  • JPanel (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now