Package org.rssowl.ui.internal.editors.feed

Examples of org.rssowl.ui.internal.editors.feed.NewsBrowserLabelProvider


      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
    });

    /* Create LabelProvider */
    fBrowserViewer.setLabelProvider(new NewsBrowserLabelProvider(fBrowserViewer));

    /* Set input when selection in result viewer changes */
    fResultViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        IStructuredSelection selection = (IStructuredSelection) event.getSelection();
View Full Code Here


          close();
      }
    });

    /* Label Provider to produce HTML per News */
    fLabelProvider = new NewsBrowserLabelProvider(fBrowser);

    /* Load and Display the Feed */
    loadFeed();

    /* Separator */
 
View Full Code Here

    /* Might be bad timing */
    if (viewer == null)
      return;

    /* Ask for sorted Elements */
    NewsBrowserLabelProvider labelProvider = (NewsBrowserLabelProvider) viewer.getLabelProvider();
    Object[] children = new Object[0];
    if (viewer instanceof NewsBrowserViewer)
      children = ((NewsBrowserViewer) viewer).getFlattendChildren(elements);

    /* Write HTML to the Receiver */
    BufferedWriter writer = null;
    try {
      boolean portable = Controller.getDefault().isPortable();
      writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));

      if (Application.IS_WINDOWS && portable)
        writer.append("HTTP/1.1 205 OK").append(CRLF); //$NON-NLS-1$
      else
        writer.append("HTTP/1.1 200 OK").append(CRLF); //$NON-NLS-1$

      synchronized (RFC_1123_DATE) {
        writer.append("Date: ").append(RFC_1123_DATE.format(new Date())).append(CRLF); //$NON-NLS-1$
      }

      writer.append("Server: RSSOwl Local Server").append(CRLF); //$NON-NLS-1$
      writer.append("Content-Type: text/html; charset=UTF-8").append(CRLF); //$NON-NLS-1$
      writer.append("Connection: close").append(CRLF); //$NON-NLS-1$
      writer.append("Expires: 0").append(CRLF); //$NON-NLS-1$
      writer.write(CRLF);

      /* Begin HTML */
      writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); //$NON-NLS-1$

      /* Windows only: Mark of the Web */
      if (Application.IS_WINDOWS) {
        writer.write(IE_MOTW);
        writer.write("\n"); //$NON-NLS-1$
      }

      writer.write("<html>\n  <head>\n"); //$NON-NLS-1$

      /* Append Base URI if available */
      String base = getBase(children);
      if (base != null) {
        writer.write("  <base href=\""); //$NON-NLS-1$
        writer.write(base);
        writer.write("\">"); //$NON-NLS-1$
      }

      writer.write("\n  <title></title>"); //$NON-NLS-1$
      writer.write("\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); //$NON-NLS-1$

      /* CSS */
      labelProvider.writeCSS(writer);

      /* Open Body */
      writer.write("  </head>\n  <body id=\"owlbody\">\n"); //$NON-NLS-1$

      /* Output each Element as HTML */
      for (int i = 0; i < children.length; i++) {
        String html = unicodeToEntities(labelProvider.getText(children[i], i));
        writer.write(html);
      }

      /* End HTML */
      writer.write("\n  </body>\n</html>"); //$NON-NLS-1$
View Full Code Here

      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
    });

    /* Create LabelProvider */
    NewsBrowserLabelProvider labelProvider = new NewsBrowserLabelProvider(fBrowserViewer);
    labelProvider.setForceShowFeedInformation(true);
    fBrowserViewer.setLabelProvider(labelProvider);

    /* Set input when selection in result viewer changes */
    fResultViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
View Full Code Here

          close();
      }
    });

    /* Label Provider to produce HTML per News */
    fLabelProvider = new NewsBrowserLabelProvider(fBrowser);

    /* Load and Display the Feed */
    loadFeed();

    /* Separator */
 
View Full Code Here

      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
    });

    /* Create LabelProvider */
    NewsBrowserLabelProvider labelProvider = new NewsBrowserLabelProvider(fBrowserViewer);
    labelProvider.setShowFooter(false);
    labelProvider.setForceShowFeedInformation(true);
    labelProvider.setStripMediaFromNews(!fPreferences.getBoolean(DefaultPreferences.ENABLE_IMAGES), !fPreferences.getBoolean(DefaultPreferences.ENABLE_MEDIA));
    fBrowserViewer.setLabelProvider(labelProvider);

    /* Set input when selection in result viewer changes */
    fResultViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
View Full Code Here

    /* Might be bad timing */
    if (viewer == null)
      return;

    /* Ask for sorted Elements */
    NewsBrowserLabelProvider labelProvider = (NewsBrowserLabelProvider) viewer.getLabelProvider();
    Object[] children = new Object[0];
    if (viewer instanceof NewsBrowserViewer) {
      children = ((NewsBrowserViewer) viewer).getFlattendChildren(elements);
      ((NewsBrowserViewer) viewer).updateViewModel(children);
    }

    /* Write HTML to the Receiver */
    BufferedWriter writer = null;
    try {
      boolean portable = Controller.getDefault().isPortable();
      writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));

      if (Application.IS_WINDOWS && portable)
        writer.append("HTTP/1.1 205 OK").append(CRLF); //$NON-NLS-1$
      else
        writer.append("HTTP/1.1 200 OK").append(CRLF); //$NON-NLS-1$

      synchronized (RFC_1123_DATE) {
        writer.append("Date: ").append(RFC_1123_DATE.format(new Date())).append(CRLF); //$NON-NLS-1$
      }

      writer.append("Server: RSSOwl Local Server").append(CRLF); //$NON-NLS-1$
      writer.append("Content-Type: text/html; charset=UTF-8").append(CRLF); //$NON-NLS-1$
      writer.append("Connection: close").append(CRLF); //$NON-NLS-1$
      writer.append("Expires: 0").append(CRLF); //$NON-NLS-1$
      writer.write(CRLF);

      /* Begin HTML */
      writer.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); //$NON-NLS-1$

      /* Windows only: Mark of the Web */
      if (Application.IS_WINDOWS) {
        writer.write(IE_MOTW);
        writer.write("\n"); //$NON-NLS-1$
      }

      writer.write("<html>\n  <head>\n"); //$NON-NLS-1$

      /* Append Base URI if available */
      String base = getBase(children);
      if (base != null) {
        writer.write("  <base href=\""); //$NON-NLS-1$
        writer.write(base);
        writer.write("\">"); //$NON-NLS-1$
      }

      writer.write("\n  <title></title>"); //$NON-NLS-1$
      writer.write("\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); //$NON-NLS-1$

      /* CSS */
      labelProvider.writeCSS(writer);

      /* Open Body */
      writer.write("  </head>\n  <body id=\"owlbody\">\n"); //$NON-NLS-1$

      /* Output each Element as HTML */
      for (int i = 0; i < children.length; i++) {
        String html = unicodeToEntities(labelProvider.getText(children[i], true, true, i));
        writer.write(html);
      }

      /* End HTML */
      writer.write("\n  </body>\n</html>"); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.editors.feed.NewsBrowserLabelProvider

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.