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

How to use
getWidth
method
in
org.wings.SDimension

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

origin: io.github.dheid/wings

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

styleString.append("width:").append(preferredSize.getWidth()).append(';');
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-experimental

boolean tableWrapping = Utils.isMSIE(component) && preferredSize != null && "%".equals(preferredSize.getWidthUnit());
if (tableWrapping) {
  String actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  device.print("<table style=\"table-layout: fixed; width: " + actualWidth + "\"><tr>");
origin: io.github.dheid/wings

String actualWidth = null;
if (tableWrapping) {
  actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  device.print("<table style=\"table-layout: fixed; width: " + actualWidth + "\"><tr>");
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

String actualWidth = null;
if (ieTableWrapping) {
  actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  if (component.getSession().getUserAgent().getMajorVersion() >= 7) {
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

String actualWidth = null;
if (tableWrapping) {
  actualWidth = preferredSize.getWidth();
  Utils.setPreferredSize(component, "100%", preferredSize.getHeight());
  device.print("<table style=\"table-layout: fixed; width: " + actualWidth + "\"><tr>");
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

  width = getPreferredSize().getWidth();
} else {
  height = "100%";
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

Utils.optAttribute(device, "layoutHeight", height);
if (!"px".equals(preferredSize.getHeightUnit()))
  Utils.setPreferredSize(component, preferredSize.getWidth(), null);
  Utils.setPreferredSize(component, preferredSize.getWidth(), height);
ScriptManager.getInstance().addScriptListener(new LayoutFillScript(component.getName()));
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

Utils.setPreferredSize(scrollPane, preferredSize.getWidth(), null);
Utils.setPreferredSize(scrollPane, preferredSize.getWidth(), height);
scrollPane.getSession().getScriptManager().addScriptListener(new LayoutFillScript(scrollPane.getName()));
origin: org.jspresso/jspresso-wings-application

dialog.setPreferredSize(new SDimension(WIZARD_DIMENSION.getWidth(),
  SDimension.AUTO));
origin: io.github.dheid/wings

Utils.setPreferredSize(component, preferredSize.getWidth(), null);
Utils.setPreferredSize(component, preferredSize.getWidth(), height);
ScriptManager.getInstance().addScriptListener(new LayoutFillScript(component.getName()));
org.wingsSDimensiongetWidth

Popular methods of SDimension

  • getHeight
  • <init>
  • 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

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • findViewById (Activity)
  • putExtra (Intent)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best plugins for Eclipse
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