Package com.google.gwt.xml.client

Examples of com.google.gwt.xml.client.NodeList


      {
        PUWeb.engine().fillTexture(mSpriteTexture, image);
       
        Document infoDom = XMLParser.parse(imageInfo);
       
        NodeList sprites = infoDom.getElementsByTagName("sprite");
        PU_Resources.this.mSpriteCount = sprites.getLength();
        for(int i = 0; i < sprites.getLength(); i++)
        {
          Element element = (Element) sprites.item(i);
         
          String name = element.getAttribute("n");
         
          PU_Rect texCoords = new PU_Rect();
          texCoords.x = Integer.parseInt(element.getAttribute("x"));
View Full Code Here


      {
        PUWeb.engine().fillTexture(mPokemonTexture, image);
       
        Document infoDom = XMLParser.parse(imageInfo);
       
        NodeList sprites = infoDom.getElementsByTagName("sprite");
        PU_Resources.this.mPokemonCount = sprites.getLength();
        for(int i = 0; i < sprites.getLength(); i++)
        {
          Element element = (Element) sprites.item(i);
         
          String name = element.getAttribute("n");
         
          PU_Rect texCoords = new PU_Rect();
          texCoords.x = Integer.parseInt(element.getAttribute("x"));
View Full Code Here

   
    Document infoDom = XMLParser.parse(info);
    Element common = (Element)infoDom.getElementsByTagName("common").item(0);
    mLineHeight = Integer.parseInt(common.getAttribute("lineHeight"));
   
    NodeList chars = infoDom.getElementsByTagName("char");
    for(int i = 0; i < chars.getLength(); i++)
    {
      Element character = (Element) chars.item(i);
     
      PU_FontCharacter fontCharacter = new PU_FontCharacter();
      int id = Integer.parseInt(character.getAttribute("id"));
      fontCharacter.x = Integer.parseInt(character.getAttribute("x"));
      fontCharacter.y = Integer.parseInt(character.getAttribute("y"));
View Full Code Here

            return node != null ? getTextValue(node) : null;
        }

        @Nullable
        private Node getUniqueElementByTagName(@Nonnull final String tagName) {
            NodeList nodes = ((Element)entryNode).getElementsByTagName(tagName);
            return nodes.getLength() == 1 ? nodes.item(0) : null;
        }
View Full Code Here

  }

  public ListLoadResult read(C loadConfig, Object data) {
    Document doc = XMLParser.parse((String) data);
    Node root = doc.getFirstChild();
    NodeList list = doc.getElementsByTagName(modelType.recordName);
    ArrayList<BaseModel> records = new ArrayList<BaseModel>();
    for (int i = 0; i < list.getLength(); i++) {
      Node node = list.item(i);
      Element elem = (Element) node;
      BaseModel model = new BaseModel();
      for (int j = 0; j < modelType.getFieldCount(); j++) {
        DataField field = modelType.getField(j);
        String map = field.map != null ? field.map : field.name;
View Full Code Here

          dialogBox.center();
        }

        public void onResponseReceived( Request request, Response response ) {
          Document doc = XMLParser.parse( response.getText() );
          NodeList updates = doc.getElementsByTagName( "update" ); //$NON-NLS-1$
          if ( updates.getLength() > 0 ) {
            FlexTable updateTable = new FlexTable();
            updateTable.setStyleName( "backgroundContentTable" ); //$NON-NLS-1$
            updateTable.setWidget( 0, 0, new Label( Messages.getString( "version" ) ) ); //$NON-NLS-1$
            updateTable.setWidget( 0, 1, new Label( Messages.getString( "type" ) ) ); //$NON-NLS-1$
            updateTable.setWidget( 0, 2, new Label( Messages.getString( "os" ) ) ); //$NON-NLS-1$
            updateTable.setWidget( 0, 3, new Label( Messages.getString( "link" ) ) ); //$NON-NLS-1$
            updateTable.getCellFormatter().setStyleName( 0, 0, "backgroundContentHeaderTableCell" ); //$NON-NLS-1$
            updateTable.getCellFormatter().setStyleName( 0, 1, "backgroundContentHeaderTableCell" ); //$NON-NLS-1$
            updateTable.getCellFormatter().setStyleName( 0, 2, "backgroundContentHeaderTableCell" ); //$NON-NLS-1$
            updateTable.getCellFormatter().setStyleName( 0, 3, "backgroundContentHeaderTableCellRight" ); //$NON-NLS-1$

            for ( int i = 0; i < updates.getLength(); i++ ) {
              Element updateElement = (Element) updates.item( i );
              String version = updateElement.getAttribute( "version" ); //$NON-NLS-1$
              String type = updateElement.getAttribute( "type" ); //$NON-NLS-1$
              String os = updateElement.getAttribute( "os" ); //$NON-NLS-1$
              // String title = updateElement.getAttribute("title");
              String downloadURL = updateElement.getElementsByTagName( "downloadurl" ).item( 0 ).toString(); //$NON-NLS-1$
              downloadURL = downloadURL.substring( downloadURL.indexOf( "http" ), downloadURL.indexOf( "]" ) ); //$NON-NLS-1$ //$NON-NLS-2$
              updateTable.setWidget( i + 1, 0, new Label( version ) );
              updateTable.setWidget( i + 1, 1, new Label( type ) );
              updateTable.setWidget( i + 1, 2, new Label( os ) );
              updateTable
                  .setWidget(
                    i + 1,
                    3,
                    new HTML(
                      "<A HREF=\"" + downloadURL + "\" target=\"_blank\" title=\"" + downloadURL + "\">" + Messages
                        .getString( "download" ) + "</A>" ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
              updateTable.getCellFormatter().setStyleName( i + 1, 0, "backgroundContentTableCell" ); //$NON-NLS-1$
              updateTable.getCellFormatter().setStyleName( i + 1, 1, "backgroundContentTableCell" ); //$NON-NLS-1$
              updateTable.getCellFormatter().setStyleName( i + 1, 2, "backgroundContentTableCell" ); //$NON-NLS-1$
              updateTable.getCellFormatter().setStyleName( i + 1, 3, "backgroundContentTableCellRight" ); //$NON-NLS-1$
              if ( i == updates.getLength() - 1 ) {
                // last
                updateTable.getCellFormatter().setStyleName( i + 1, 0, "backgroundContentTableCellBottom" ); //$NON-NLS-1$
                updateTable.getCellFormatter().setStyleName( i + 1, 1, "backgroundContentTableCellBottom" ); //$NON-NLS-1$
                updateTable.getCellFormatter().setStyleName( i + 1, 2, "backgroundContentTableCellBottom" ); //$NON-NLS-1$
                updateTable.getCellFormatter().setStyleName( i + 1, 3, "backgroundContentTableCellBottomRight" ); //$NON-NLS-1$
View Full Code Here

            EventBusUtil.EVENT_BUS.fireEvent( event );
            boolean cutSameDir = false;
            if ( getChildrenResponse.getStatusCode() >= 200 && getChildrenResponse.getStatusCode() < 300 ) {
              boolean promptForOptions = false;
              Document children = XMLParser.parse( getChildrenResponse.getText() );
              NodeList childrenNameNodes = children.getElementsByTagName( NAME_NODE_TAG );
              List<String> childNames = new ArrayList<String>();
              for ( int i = 0; i < childrenNameNodes.getLength(); i++ ) {
                Node childNameNode = childrenNameNodes.item( i );
                childNames.add( childNameNode.getFirstChild().getNodeValue() );
              }

              for ( SolutionBrowserFile file : clipboardFileItems ) {
                if ( file.getPath() != null ) {
View Full Code Here

  }

  private List<String> getSortedItems( String type, Response response ) {
    String txt = response.getText();
    Document doc = XMLParser.parse( txt );
    NodeList items = doc.getElementsByTagName( type );
    final List<String> itemsSorted = new ArrayList<String>();
    for ( int i = 0; i < items.getLength(); i++ ) {
      itemsSorted.add( items.item( i ).getFirstChild().getNodeValue() );
    }
    Collections.sort( itemsSorted );

    return itemsSorted;
  }
View Full Code Here

      removeAllAces( fileInfo );
    } else {
      // Check if any of the permission sets should be replaced with ALL.
      // Any non-inherited Ace with a permission set containing PERM_GRANT_PERM should be replaced
      // with a single PERM_ALL.
      NodeList aces = fileInfo.getElementsByTagName( ACES_ELEMENT_NAME );
      for ( int i = 0; i < aces.getLength(); i++ ) {
        Element ace = (Element) aces.item( i );
        NodeList perms = ace.getElementsByTagName( PERMISSIONS_ELEMENT_NAME );
        for ( int j = 0; j < perms.getLength(); j++ ) {
          Element perm = (Element) perms.item( j );
          if ( perm.getFirstChild() != null ) {
            if ( Integer.parseInt( perm.getFirstChild().getNodeValue() ) == PERM_GRANT_PERM ) {
              replacePermissionsWithAll( ace, fileInfo );
              break;
            }
View Full Code Here

  // *********************
  // Document manipulation
  // *********************
  void removeRecipient( String recipient, String recipientType, Document fileInfo ) {
    NodeList aces = fileInfo.getElementsByTagName( ACES_ELEMENT_NAME );
    for ( int i = 0; i < aces.getLength(); i++ ) {
      Element ace = (Element) aces.item( i );
      if ( ace.getElementsByTagName( RECIPIENT_ELEMENT_NAME ).item( 0 ).getFirstChild().getNodeValue().equals(
          recipient ) &&  ace.getElementsByTagName( RECIPIENT_TYPE_ELEMENT_NAME ).item( 0 ).getFirstChild().getNodeValue().equals(
          recipientType ) ) {
        ace.getParentNode().removeChild( ace );
        break;
View Full Code Here

TOP

Related Classes of com.google.gwt.xml.client.NodeList

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.