Examples of XmlElement


Examples of com.jbidwatcher.util.xml.XMLElement

   */
  public void fromXML(XMLInterface curElement) {
    Iterator<XMLInterface> logStep = curElement.getChildren();

    while(logStep.hasNext()) {
      XMLElement curEntry = (XMLElement)logStep.next();

      if(curEntry.getTagName().equals("entry")) {
        long msgtime = System.currentTimeMillis();
        String msg = "Nothing has happened.";
        int curCount = Integer.parseInt(curEntry.getProperty("COUNT"));

        Iterator<XMLInterface> entryStep = curEntry.getChildren();
        while(entryStep.hasNext()) {
          XMLElement entryField = (XMLElement)entryStep.next();
          if(entryField.getTagName().equals("message")) msg = entryField.getContents();
          if(entryField.getTagName().equals("date")) msgtime = Long.parseLong(entryField.getContents());
        }

        EventStatus newEvent = new EventStatus(msg, new Date(msgtime), mEntryId, mIdentifier, mTitle);
        newEvent.setRepeatCount(curCount);
        newEvent.saveDB();
View Full Code Here

Examples of com.l2fprod.contrib.nanoxml.XMLElement

   */
  public static Skin loadThemePackDefinition(java.net.URL url)
    throws Exception {
    Skin skin = null;

    XMLElement element = new XMLElement();
    element.parseFromReader(new java.io.InputStreamReader(getInputStream(url)));

    checkRequiredVersion(element.getProperty("REQUIRE"));

    // reset any custom properties that may be set in the skin
    UIManager.put("JDesktopPane.backgroundEnabled", Boolean.FALSE);
    UIManager.put("PopupMenu.animation", Boolean.FALSE);
    UIManager.put("ScrollBar.alternateLayout", Boolean.FALSE);
    UIManager.put("JSplitPane.alternateUI", Boolean.FALSE);

    Enumeration enumeration = element.enumerateChildren();
    while (enumeration.hasMoreElements()) {
      element = (XMLElement)enumeration.nextElement();
      String tagName = element.getTagName().toLowerCase();
      if ("skin".equals(tagName)) {
        skin = buildSkin(url, element);
      } else if ("property".equals(tagName)) {
        String type = element.getProperty("TYPE");

        // Take the boolean class if the typeclass is not specified for
        // backward compatibility.
        if (type == null
          || "".equals(type)
          || "boolean".equalsIgnoreCase(type)
          || "java.lang.Boolean".equalsIgnoreCase(type)) {
          UIManager.put(
            element.getProperty("NAME"),
            Boolean.valueOf(element.getProperty("VALUE")));
        } else if (
          "int".equalsIgnoreCase(type)
            || "java.lang.Integer".equalsIgnoreCase(type)) {
          UIManager.put(
            element.getProperty("NAME"),
            Integer.valueOf(element.getProperty("VALUE")));
        } else if (
          "String".equalsIgnoreCase(type)
            || "java.lang.String".equalsIgnoreCase(type)) {
          UIManager.put(
            element.getProperty("NAME"),
            element.getProperty("VALUE"));
        } else if (
          "Color".equalsIgnoreCase(type)
            || "java.awt.Color".equalsIgnoreCase(type)) {
          Color color = Color.decode(element.getProperty("VALUE"));
          UIManager.put(
            element.getProperty("NAME"),
            new ColorUIResource(color));
        } else if (
          "Insets".equalsIgnoreCase(type)
            || "java.awt.Insets".equalsIgnoreCase(type)) {
          Insets insets = parseInsets(element.getProperty("VALUE"));
          UIManager.put(
            element.getProperty("NAME"),
            new InsetsUIResource(
              insets.top,
              insets.left,
              insets.bottom,
              insets.right));
        } else if (
          "Dimension".equalsIgnoreCase(type)
            || "java.awt.Dimension".equalsIgnoreCase(type)) {
          Dimension dim = parseDimension(element.getProperty("VALUE"));
          UIManager.put(
            element.getProperty("NAME"),
            new DimensionUIResource(dim.width, dim.height));
        } else if (
          "LineBorder".equalsIgnoreCase(type)
            || "javax.swing.border.LineBorder".equalsIgnoreCase(type)) {

          boolean rounded = false;
          Color color = Color.black;
          int thickness = 1;
          int padding = 0;
          String temp;

          temp = element.getProperty("ROUNDED");

          if (temp != null) {
            rounded = (Boolean.getBoolean(temp));
          }

          temp = element.getProperty("THICKNESS");
          if (temp != null) {
            thickness = Integer.parseInt(temp);
          }

          temp = element.getProperty("PADDING");
          if (temp != null) {
            padding = Integer.parseInt(temp);
          }

          temp = element.getProperty("COLOR");
          if (temp != null) {
            color = Color.decode(temp);
          }
          Border border =
            new com.l2fprod.gui.border.LineBorder(color, thickness, rounded);
          if (padding > 0) {
            border =
              new CompoundBorder(
                border,
                BorderFactory.createEmptyBorder(
                  padding,
                  padding,
                  padding,
                  padding));
          }
          UIManager.put(
            element.getProperty("NAME"),
            new BorderUIResource(border));
        } else if (
          "EmptyBorder".equalsIgnoreCase(type)
            || "javax.swing.border.EmptyBorder".equalsIgnoreCase(type)) {
          Insets insets = parseInsets(element.getProperty("VALUE"));
          Border border = new javax.swing.border.EmptyBorder(insets);
          UIManager.put(
            element.getProperty("NAME"),
            new BorderUIResource(border));
        }
      } else if ("font".equalsIgnoreCase(tagName)) {
        String[] fontStyle =
          StringUtils.splitString(element.getProperty("VALUE"), ",");
        Font f =
          SkinUtils.getFont(
            fontStyle[0],
            Integer.parseInt(fontStyle[1]),
            Integer.parseInt(fontStyle[2]));
        if (f != null) {
          if ("Global".equalsIgnoreCase(element.getProperty("NAME"))) {
            SkinUtils.setFont(new FontUIResource(f));
          } else {
            UIManager.put(element.getProperty("NAME"), new FontUIResource(f));
          }
        }
      } else if ("icon".equalsIgnoreCase(tagName)) {
        final URL iconURL = new URL(url, element.getProperty("VALUE"));
        ImageIcon icon = new ImageIcon(SkinUtils.loadImage(iconURL));
        UIManager.put(element.getProperty("NAME"), new IconUIResource(icon));
        // put the default internal icon at work for JOptionPane too
        if ("InternalFrame.icon".equals(element.getProperty("NAME"))) {
          JOptionPane.getRootFrame().setIconImage(icon.getImage());
        }
      }
    }
    return skin;
View Full Code Here

Examples of com.sun.enterprise.deployment.node.XMLElement

   
    private BundleDescriptor bundleDescriptor;

    public WebServicesDescriptorNode(BundleDescriptor descriptor) {
        bundleDescriptor = descriptor;
        registerElementHandler(new XMLElement(WebServicesTagNames.WEB_SERVICE),
                               WebServiceNode.class);
    }  
View Full Code Here

Examples of com.sun.xml.internal.txw2.annotation.XmlElement

            }
        }

        XmlAttribute xa = method.getAnnotation(XmlAttribute.class);
        XmlValue xv = method.getAnnotation(XmlValue.class);
        XmlElement xe = method.getAnnotation(XmlElement.class);


        if(xa!=null) {
            if(xv!=null || xe!=null)
                throw new IllegalAnnotationException(method.toString());
View Full Code Here

Examples of com.sun.xml.txw2.annotation.XmlElement

    /*package*/ static QName getTagName( Class<?> c ) {
        String localName="";
        String nsUri="##default";

        XmlElement xe = c.getAnnotation(XmlElement.class);
        if(xe!=null) {
            localName = xe.value();
            nsUri = xe.ns();
        }

        if(localName.length()==0) {
            localName = c.getName();
            int idx = localName.lastIndexOf('.');
View Full Code Here

Examples of com.tangosol.run.xml.XmlElement

      if (cluster.getServiceInfo(AUTO_POF_SERVICE) != null) {
        CacheService service = (CacheService) cluster.getService(AUTO_POF_SERVICE);
        typeMap = service.ensureCache(AUTO_POF_MAPPING, null);
      }
      else {
        XmlElement xml = XmlHelper.loadXml(XML_FRAGMENT);
        typeMap = new DefaultConfigurableCacheFactory(xml).ensureCache(AUTO_POF_MAPPING, null);
      }
    }
  }
View Full Code Here

Examples of de.timroes.axmlrpc.xmlcreator.XmlElement

  }

  public XmlElement serialize(Object object) {

    XmlElement struct = new XmlElement(SerializerHandler.TYPE_STRUCT);

    try {

      XmlElement entry, name, value;

      // We can safely cast here, this Serializer should only be called when
      // the parameter is a map.
      @SuppressWarnings("unchecked")
      Map<String,Object> map = (Map<String,Object>)object;

      for(Map.Entry<String,Object> member : map.entrySet()) {
        entry = new XmlElement(STRUCT_MEMBER);
        name = new XmlElement(STRUCT_NAME);
        value = new XmlElement(STRUCT_VALUE);
        name.setContent(member.getKey());
        value.addChildren(SerializerHandler.getDefault().serialize(member.getValue()));
        entry.addChildren(name);
        entry.addChildren(value);
        struct.addChildren(entry);
      }

    } catch(XMLRPCException ex) {
      throw new XMLRPCRuntimeException(ex);
View Full Code Here

Examples of diva.util.xml.XmlElement

            public void run() throws Exception {
                TreeMap attrs = new TreeMap();
                attrs.put("name0", "value0");
                attrs.put("name1", "value1");
                elt = new XmlElement("element", attrs);
            }

            public void check() throws TestFailedException {
                String result = "<element name0=\"value0\" name1=\"value1\"></element>\n";
                assertEquals(result, elt.toString(), result + " != "
View Full Code Here

Examples of es.udc.pfc.xmpp.xml.XMLElement

      case DISCONNECTED:
        throw new Exception("received DISCONNECTED");
      }
    }
    else if (e.getMessage() instanceof XMLElement) {
      final XMLElement element = (XMLElement) e.getMessage();
     
      switch (status) {
      case AUTHENTICATE:
        if (!"handshake".equals(element.getTagName()))
          throw new Exception("expected handshake");
        status = Status.READY;
        System.out.println("logged in");
       
        ctx.getPipeline().get(XMPPStreamHandler.class).loggedIn();
View Full Code Here

Examples of gld.xml.XMLElement

      loader.load(this, statsOverlay);
    }
  }

  public XMLElement saveSelf() throws XMLCannotSaveException
  XMLElement result = super.saveSelf();
    /* This code is buggy
    result.addAttribute(new XMLAttribute("saved-by", "simulator"));
     result.addAttribute(new XMLAttribute("tlc-category",
        menuBar.getTLCMenu().getCategory()));
    result.addAttribute(new XMLAttribute("tlc-number",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.