Package com.google.gwt.dom.client.Style

Examples of com.google.gwt.dom.client.Style.Unit


            if ("".equals(s)) {
                return null;
            }

            float size = 0;
            Unit unit = null;

            MatchResult matcher = sizePattern.exec(s);
            if (matcher.getGroupCount() > 1) {

                size = Float.parseFloat(matcher.getGroup(1));
View Full Code Here


{
  @Override
  public void instantiateWidget(SourcePrinter out, StackLayoutContext context) throws CruxGeneratorException
  {
    String className = getWidgetClassName();
    Unit unit = AbstractLayoutPanelFactory.getUnit(context.readWidgetProperty("unit"));
    out.println(className + " " + context.getWidget()+" = new "+className+"("+Unit.class.getCanonicalName()+"."+unit.toString()+");");
  }
View Full Code Here

{
  @Override
  public void instantiateWidget(SourcePrinter out, DockLayoutPanelContext context) throws CruxGeneratorException
  {
    String className = getWidgetClassName();
    Unit unit = getUnit(context.readWidgetProperty("unit"));
    out.println(className + " " + context.getWidget()+" = new "+className+"("+Unit.class.getCanonicalName()+"."+unit.toString()+");");
  }
View Full Code Here

   * @param sizeUnit
   * @return
   */
  public static Unit getUnit(String sizeUnit)
  {
    Unit unit;
    if (!StringUtils.isEmpty(sizeUnit))
    {
      unit = Unit.valueOf(sizeUnit);
    }
    else
View Full Code Here

    {
      out.println(className + " " + context.getWidget()+" = new "+className+"(20,"+Unit.class.getCanonicalName()+".PX);");
    }
    else
    {
      Unit unit = AbstractLayoutPanelFactory.getUnit(context.readWidgetProperty("unit"));
      out.println(className + " " + context.getWidget()+" = new "+className+"("+Double.parseDouble(height)+","+Unit.class.getCanonicalName()+"."+unit.toString()+");");
    }
  }
View Full Code Here

       
                                       int headerHeight = 05*H/100;
        int westWidth   = 25*W/100;    int westHeight   = 80*H/100;
        int centerWidth = 60*W/100;    int centerHeight = 80*H/100;
                                       int footerHeight = 02*H/100;
        Unit unit = Unit.PX;

        stockPanel       = new MarketDataPanel(this, westWidth-10, 40*westHeight/100);
        int N = stocks.size();
        for (int i = 0; i < N; i++) {
            stockPanel.insert(stocks.get(i));
View Full Code Here

            final Widget w = asWidget(update.getLong(PROPERTY.WIDGET), uiService);
            final Alignment alignment = getAlignement(PROPERTY.VERTICAL_ALIGNMENT, update);
            uiObject.setWidgetVerticalPosition(w, alignment);
        } else if (update.containsKey(PROPERTY.UNIT)) {
            final Widget w = asWidget(update.getLong(PROPERTY.WIDGET), uiService);
            final Unit unit = getUnit(update);

            if (update.containsKey(PROPERTY.LEFT)) {
                final double left = update.getDouble(PROPERTY.LEFT);
                if (update.containsKey(PROPERTY.RIGHT)) {
                    final double right = update.getDouble(PROPERTY.RIGHT);
View Full Code Here

      @Override
      public void onChange(ChangeEvent event) {
        int selectedIndex = listBox.getSelectedIndex();
     
        if (selectedWidget != null) {
          Unit borderUnit = null;
          String selectedStyle = listBox.getItemText(selectedIndex);
          if (selectedStyle.equals("CM")) {
            borderUnit = Unit.CM;
          }
         
          else if (selectedStyle.equals("EM")) {
            borderUnit = Unit.EM;
          }

          else if (selectedStyle.equals("EX")) {
            borderUnit = Unit.EX;
          }

          else if (selectedStyle.equals("IN")) {
            borderUnit = Unit.IN;
          }

          else if (selectedStyle.equals("MM")) {
            borderUnit = Unit.MM;
          }

          else if (selectedStyle.equals("PC")) {
            borderUnit = Unit.PC;
          }

          else if (selectedStyle.equals("PCT")) {
            borderUnit = Unit.PCT;
          }

          else if (selectedStyle.equals("PT")) {
            borderUnit = Unit.PT;
          }

          else if (selectedStyle.equals("PX")) {
            borderUnit = Unit.PX;
          }
         
          if (borderUnit != null) {
            int borderWidth = 0;
            if (textBox.getValue() != null && textBox.getValue().trim().length() > 0) {
              borderWidth = Integer.parseInt(textBox.getValue().trim());
              selectedWidget.getElement().getStyle().setBorderWidth(borderWidth, borderUnit);
            }
           
            else {
              selectedWidget.getElement().getStyle().clearBorderWidth();
            }
          }
         
          else {
            selectedWidget.getElement().getStyle().clearBorderWidth();
          }
        }
      }
      });

     
    textBox.addChangeHandler(new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
       
        if (selectedWidget != null) {
         
            Unit borderUnit = null;
            String selectedUnit = listBox.getValue(listBox.getSelectedIndex());
            if (selectedUnit.equals("CM")) {
              borderUnit = Unit.CM;
            }
           
View Full Code Here

      @Override
      public void onChange(ChangeEvent event) {
        int selectedIndex = listBox.getSelectedIndex();
     
        if (selectedWidget != null) {
          Unit unit = null;
          String selectedStyle = listBox.getItemText(selectedIndex);
          if (selectedStyle.equals("CM")) {
            unit = Unit.CM;
          }
         
          else if (selectedStyle.equals("EM")) {
            unit = Unit.EM;
          }

          else if (selectedStyle.equals("EX")) {
            unit = Unit.EX;
          }

          else if (selectedStyle.equals("IN")) {
            unit = Unit.IN;
          }

          else if (selectedStyle.equals("MM")) {
            unit = Unit.MM;
          }

          else if (selectedStyle.equals("PC")) {
            unit = Unit.PC;
          }

          else if (selectedStyle.equals("PCT")) {
            unit = Unit.PCT;
          }

          else if (selectedStyle.equals("PT")) {
            unit = Unit.PT;
          }

          else if (selectedStyle.equals("PX")) {
            unit = Unit.PX;
          }
         
          if (unit != null) {
            int width = 0;
            if (textBox.getValue() != null && textBox.getValue().trim().length() > 0) {
              width = Integer.parseInt(textBox.getValue().trim());
              selectedWidget.getElement().getStyle().setWidth(width, unit);
            }
           
            else {
              selectedWidget.getElement().getStyle().clearWidth();
            }
          }
        }
      }
      });

     
    textBox.addChangeHandler(new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
       
        if (selectedWidget != null) {
         
            Unit unit = null;
            String selectedUnit = listBox.getValue(listBox.getSelectedIndex());
            if (selectedUnit.equals("CM")) {
              unit = Unit.CM;
            }
           
View Full Code Here

      @Override
      public void onChange(ChangeEvent event) {
        int selectedIndex = listBox.getSelectedIndex();
     
        if (selectedWidget != null) {
          Unit unit = null;
          String selectedStyle = listBox.getItemText(selectedIndex);
          if (selectedStyle.equals("CM")) {
            unit = Unit.CM;
          }
         
          else if (selectedStyle.equals("EM")) {
            unit = Unit.EM;
          }

          else if (selectedStyle.equals("EX")) {
            unit = Unit.EX;
          }

          else if (selectedStyle.equals("IN")) {
            unit = Unit.IN;
          }

          else if (selectedStyle.equals("MM")) {
            unit = Unit.MM;
          }

          else if (selectedStyle.equals("PC")) {
            unit = Unit.PC;
          }

          else if (selectedStyle.equals("PCT")) {
            unit = Unit.PCT;
          }

          else if (selectedStyle.equals("PT")) {
            unit = Unit.PT;
          }

          else if (selectedStyle.equals("PX")) {
            unit = Unit.PX;
          }
         
          if (unit != null) {
            int height = 0;
            if (textBox.getValue() != null && textBox.getValue().trim().length() > 0) {
              height = Integer.parseInt(textBox.getValue().trim());
              selectedWidget.getElement().getStyle().setHeight(height, unit);
            }
           
            else {
              selectedWidget.getElement().getStyle().clearWidth();
            }
          }
         
          else {
            selectedWidget.getElement().getStyle().clearWidth();
          }
        }
      }
      });

     
    textBox.addChangeHandler(new ChangeHandler() {
      @Override
      public void onChange(ChangeEvent event) {
       
        if (selectedWidget != null) {
         
            Unit unit = null;
            String selectedUnit = listBox.getValue(listBox.getSelectedIndex());
            if (selectedUnit.equals("CM")) {
              unit = Unit.CM;
            }
           
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.Style.Unit

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.