Package org.mortbay.util.ajax

Examples of org.mortbay.util.ajax.JSON$Source


    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    Button btnCreateSource = new Button(container, SWT.NONE);
    btnCreateSource.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        Source newSource = new Source();
        newSource.setId("Source_" + (table.getItemCount() + 1)); //$NON-NLS-1$
        SourceBindingWrapper sourceBindingWrapper = new SourceBindingWrapper(newSource);
        writableList.add(sourceBindingWrapper);
        tableViewer.setSelection(new StructuredSelection(sourceBindingWrapper));
      }
    });
View Full Code Here


    titleStmt.getTitles().add(title);
    fileDesc.setTitleStmt(titleStmt);
    PubStmt pubStmt = new PubStmt();
    fileDesc.setPubStmt(pubStmt);
    SourceDesc sourceDesc = new SourceDesc();
    Source source = new Source();
    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
View Full Code Here

    String format = request.getParameter("format");
    Collection<MetricsContext> allContexts =
      ContextFactory.getFactory().getAllContexts();
    if ("json".equals(format)) {
      // Uses Jetty's built-in JSON support to convert the map into JSON.
      out.print(new JSON().toJSON(makeMap(allContexts)));
    } else {
      printMap(out, makeMap(allContexts));
    }
    out.close();
  }
View Full Code Here

      }
      if (mrc != null) {
        map.put("jobtracker_port", mrc.getJobTrackerPort());
      }
      FileWriter fw = new FileWriter(new File(writeDetails));
      fw.write(new JSON().toJSON(map));
      fw.close();
    }
  }
View Full Code Here

            if (_jsonOut == null)
            {
                _jsonOut = (JSON)_httpClient.getAttribute(__JSON);
                if (_jsonOut==null)
                {
                    _jsonOut = new JSON();
                    _httpClient.setAttribute(__JSON,_jsonOut);
                }
            }

            if (_timer == null)
View Full Code Here

        Object ext=_ext == null?get(Bayeux.EXT_FIELD):_ext;
        if (ext instanceof Map)
            return (Map<String,Object>)ext;
        if (ext instanceof JSON.Literal)
        {
            JSON json=_pool == null?JSON.getDefault():_pool.getMsgJSON();
            _ext=ext=json.fromJSON(ext.toString());
            super.put(Bayeux.EXT_FIELD,ext);
            return (Map<String,Object>)ext;
        }

        if (!create)
View Full Code Here

    /* ------------------------------------------------------------ */
    public String getJSON()
    {
        if (_json == null)
        {
            JSON json=_pool == null?JSON.getDefault():_pool.getMsgJSON();
            StringBuffer buf=new StringBuffer(json.getStringBufferSize());
            synchronized(buf)
            {
                json.appendMap(buf,this);
                _json=buf.toString();
            }
        }
        return _json;
    }
View Full Code Here

        Object ext = _ext==null?get(Bayeux.EXT_FIELD):_ext;
        if (ext instanceof Map)
            return (Map<String,Object>)ext;
        if (ext instanceof JSON.Literal)
        {
            JSON json=_pool==null?JSON.getDefault():_pool.getMsgJSON();
            _ext=ext=json.fromJSON(ext.toString());
            super.put(Bayeux.EXT_FIELD,ext);
            return (Map<String,Object>)ext;
        }

        if (!create)
View Full Code Here

    /* ------------------------------------------------------------ */
    public String getJSON()
    {
        if (_json==null)
        {
            JSON json=_pool==null?JSON.getDefault():_pool.getMsgJSON();
            StringBuffer buf = new StringBuffer(json.getStringBufferSize());
            synchronized(buf)
            {
                json.appendMap(buf,this);
                _json=buf.toString();
            }
        }
        return _json;
    }
View Full Code Here

    if ("json".equals(format)) {
      response.setContentType("application/json; charset=utf-8");
      PrintWriter out = response.getWriter();
      try {
        // Uses Jetty's built-in JSON support to convert the map into JSON.
        out.print(new JSON().toJSON(makeMap(allContexts)));
      } finally {
        out.close();
      }
    } else {
      PrintWriter out = response.getWriter();
View Full Code Here

TOP

Related Classes of org.mortbay.util.ajax.JSON$Source

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.