Package org.eclipse.wb.internal.core.utils.xml

Examples of org.eclipse.wb.internal.core.utils.xml.DocumentElement


  /**
   * @return the current size of {@link WidgetInfo}, in units.
   */
  private Double getSize(WidgetInfo widget) {
    DocumentElement dockElement = widget.getElement().getParent();
    Object value = getContext().getAttributeValue(dockElement, "size");
    if (value instanceof Number) {
      return ((Number) value).doubleValue();
    }
    return null;
View Full Code Here


    }
    return null;
  }

  public void setSize(WidgetInfo widget, double size) throws Exception {
    DocumentElement dockElement = widget.getElement().getParent();
    String sizeString = SIZE_FORMAT.format(size);
    dockElement.setAttribute("size", sizeString);
  }
View Full Code Here

      return getValue() != UNKNOWN_VALUE;
    }

    @Override
    public Object getValue() throws Exception {
      DocumentElement headerElement = getHeaderElement(false);
      if (headerElement == null) {
        return UNKNOWN_VALUE;
      }
      return headerElement.getTextNode().getText();
    }
View Full Code Here

      return headerElement.getTextNode().getText();
    }

    @Override
    protected void setValueEx(Object value) throws Exception {
      DocumentElement headerElement = getHeaderElement(true);
      if (value instanceof String) {
        String text = (String) value;
        headerElement.setText(text, false);
      } else {
        headerElement.remove();
      }
    }
View Full Code Here

        headerElement.remove();
      }
    }

    private DocumentElement getHeaderElement(boolean ensure) {
      DocumentElement element = getElement();
      String tag = element.getTagNS() + "header";
      DocumentElement headerElement = element.getChild(tag, false);
      if (headerElement == null && ensure) {
        headerElement = new DocumentElement(tag);
        element.addChild(headerElement, 0);
      }
      return headerElement;
    }
View Full Code Here

  /**
   * @return the name of direction.
   */
  private static String getDirection(WidgetInfo widget) {
    DocumentElement dockElement = widget.getElement().getParent();
    return dockElement.getAttribute("direction");
  }
View Full Code Here

    DocumentElement dockElement = widget.getElement().getParent();
    return dockElement.getAttribute("direction");
  }

  public void setDirection(WidgetInfo widget, String direction) throws Exception {
    DocumentElement dockElement = widget.getElement().getParent();
    dockElement.setAttribute("direction", direction);
    ExecutionUtils.refresh(this);
  }
View Full Code Here

    LocationValue size;
  }

  private Location getLocation(WidgetInfo widget, boolean horizontal) {
    UiBinderContext context = widget.getContext();
    DocumentElement layerElement = widget.getElement().getParent();
    Location location = new Location();
    location.layer = layerElement;
    if (horizontal) {
      location.leading = getLocationValue(context, layerElement, "left");
      location.trailing = getLocationValue(context, layerElement, "right");
View Full Code Here

    ExecutionUtils.refresh(this);
  }

  private void command_LOCATION_X(WidgetInfo widget, int x) throws Exception {
    Location location = getLocation(widget, true);
    DocumentElement layer = location.layer;
    // LeftWidth
    if (location.leading != null && location.size != null) {
      setPixels(location.leading, x);
      return;
    }
View Full Code Here

    }
  }

  private void command_LOCATION_Y(WidgetInfo widget, int y) throws Exception {
    Location location = getLocation(widget, false);
    DocumentElement layer = location.layer;
    // TopHeight
    if (location.leading != null && location.size != null) {
      setPixels(location.leading, y);
      return;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.utils.xml.DocumentElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.