Examples of HTMLDocument


Examples of com.aicontest.visualizer.js.dom.HTMLDocument

  public void run() {
    try {
      final JSObject jsRoot = JSObject.getWindow(this);
      webWrapper = new Visualizer(this, getWidth(), getHeight(), false);
      webWrapper.setJsRoot(jsRoot);
      HTMLDocument document = webWrapper.getDomWindow().getDocument();
      ScriptableObject options = webWrapper.construct("Options", null);
      Object config = null;
      String configString = getParameter("configOverrides");
      if (configString != null) {
        config = webWrapper.parseJSON(configString);
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument

     */
    public void initialize(final WebWindow webWindow) {
        webWindow_ = webWindow;
        webWindow_.setScriptObject(this);

        document_ = new HTMLDocument();
        document_.setParentScope(this);
        document_.setPrototype(getPrototype(HTMLDocument.class));
        document_.setWindow(this);
        if (webWindow.getEnclosedPage() instanceof SgmlPage) {
            final SgmlPage page = (SgmlPage) webWindow.getEnclosedPage();
View Full Code Here

Examples of com.gistlabs.mechanize.document.html.HtmlDocument

  String longUrl = "http://gistlabs.com/software/mechanize-for-java/";

  @Test
  public void testShortUrl() throws JSONException {
    Mechanize agent = new MechanizeAgent();
    HtmlDocument html = agent.get(shortUrl);
    assertEquals(longUrl, html.getUri());
  }
View Full Code Here

Examples of de.l3s.boilerpipe.sax.HTMLDocument

                String text;
                if(cache.contains(url.toString())){
                    text = cache.get(url.toString());
                    logger.debug("  Fetched from cache:"+url.toString());
                } else {
                    HTMLDocument htmlDoc = HTMLFetcher.fetch(url);
                    TextDocument doc = new BoilerpipeSAXInput(htmlDoc.toInputSource()).getTextDocument();
                    text = ArticleExtractor.INSTANCE.getText(doc);
                    cache.put(url.toString(), text);
                    logger.debug("Fetched from web:"+url.toString());
                }
                if(text.length()<100){
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

        .getFavoritesContainingProgram(mProgram);
    boolean hasFavorites = favorites != null && favorites.length > 0;
    mHighlight.setEnabled(hasFavorites);

    Highlighter highlighter = mInfoEP.getHighlighter();
    HTMLDocument document = (HTMLDocument) mInfoEP.getDocument();
    highlighter.removeAllHighlights();

    if (!hasFavorites
        || !ProgramInfo.getInstance().getSettings().getHighlightFavorite()) {
      return;
    }

    DefaultHighlightPainter painter = new DefaultHighlightPainter(ProgramInfo
        .getInstance().getSettings().getHighlightColor());
    for (Favorite favorite : favorites) {
      ProgramSearcher searcher = null;
      try {
        searcher = favorite.getSearcher();
      } catch (TvBrowserException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      if (searcher instanceof RegexSearcher) {
        Pattern pattern = ((RegexSearcher) searcher).getPattern();
        if (pattern != null) {
          if (pattern.pattern().startsWith(".*")) {
            pattern = Pattern.compile(pattern.pattern().substring(2));
          }
          if (pattern.pattern().endsWith(".*")) {
            pattern = Pattern.compile(pattern.pattern().substring(0,
                pattern.pattern().length() - 2));
          }
          for (HTMLDocument.Iterator it = document
              .getIterator(HTML.Tag.CONTENT); it.isValid(); it.next()) {
            try {
              String fragment = document.getText(it.getStartOffset(), it
                  .getEndOffset()
                  - it.getStartOffset());
              Matcher matcher = pattern.matcher(fragment);
              while (matcher.find()) {
                highlighter.addHighlight(it.getStartOffset() + matcher.start(),
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

      }

      private String getLink(int pos, JEditorPane html) {
        Document doc = html.getDocument();
        if (doc instanceof HTMLDocument) {
          HTMLDocument hdoc = (HTMLDocument) doc;
          Element e = hdoc.getCharacterElement(pos);
          AttributeSet a = e.getAttributes();
          AttributeSet anchor = (AttributeSet) a.getAttribute(HTML.Tag.A);

          if (anchor != null) {
            return (String) anchor.getAttribute(HTML.Attribute.HREF);
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

  public void hyperlinkUpdate(HyperlinkEvent evt) {
    if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
      if (evt instanceof HTMLFrameHyperlinkEvent) {
        HTMLFrameHyperlinkEvent frameEvt = (HTMLFrameHyperlinkEvent) evt;
        HTMLDocument doc = (HTMLDocument) mEditorPane.getDocument();
        doc.processHTMLFrameHyperlinkEvent(frameEvt);
      } else {
        addThisSiteToHistory();
        String filename = evt.getDescription();

        // Falls in Link ein Anker vorkommt, diesen ignorieren
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
  return;

    if (e instanceof HTMLFrameHyperlinkEvent) {
  HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent)e;
  HTMLDocument doc = (HTMLDocument)contentEditorPane.getDocument();
  doc.processHTMLFrameHyperlinkEvent(evt);
    }
    else {
  try {
      pages.goTo(e.getURL());
      updateNavActions();
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    public DcMultiLineToolTipUI() {
        super();
        if (textPane == null) {
            textPane = ComponentFactory.getTextPane();
            textPane.setDocument(new HTMLDocument());
            textPane.setEditorKit(new HTMLEditorKit());
        }
    }
View Full Code Here

Examples of javax.swing.text.html.HTMLDocument

    }
   
    private void setHtmlText(String text) {
        String s = getHtmlText(text);
       
        HTMLDocument document = (HTMLDocument) textPane.getDocument();
        HTMLEditorKit kit = (HTMLEditorKit) textPane.getEditorKit();
       
        try {
            textPane.setText("");
            kit.insertHTML(document, 0, s, 0, 0, null);
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.