Package javax.swing

Examples of javax.swing.JEditorPane$HeaderParser


    upperPanel.add(upperRightPanel, BorderLayout.EAST);

    /*
     * Detail pane definition
     */
    detail = new JEditorPane(ChainsawConstants.DETAIL_CONTENT_TYPE, "");
    detail.setEditable(false);

    detailPaneUpdater = new DetailPaneUpdater();

    addFocusListener(new FocusListener() {
View Full Code Here


            input.close();
        }
    }

    private JEditorPane createEditor(String title, String type) {
        JEditorPane editor = new JEditorPane();
        editor.setContentType(type);
        editor.setTransferHandler(new ParsingTransferHandler(
                editor.getTransferHandler(), this));
        tabs.add(title, new JScrollPane(editor));
        return editor;
    }
View Full Code Here

    final JComponent panel = new JPanel(new BorderLayout());
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));

    final HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
    htmlEditorKit.setStyleSheet(GuiResources.EDITORPANE_STYLESHEET);
    final JEditorPane jEditorPane = new JEditorPane() {

      @Override
      protected void paintComponent(final Graphics g) {
        super.paintComponent(g);
        final Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
      }

    };
    jEditorPane.setPreferredSize(new Dimension(550, 650));
    jEditorPane.setEditable(false);
    jEditorPane.setContentType("text/html");
    jEditorPane.setEditorKit(htmlEditorKit);


    jEditorPane.setText(html.toString());

    panel.add(ScrollPaneFacade.createScrollPane(jEditorPane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED));
    panel.setBorder(BorderFactory.createTitledBorder("FindBugs analysis run configuration"));
    dialogBuilder.setCenterPanel(panel);

    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        jEditorPane.scrollRectToVisible(new Rectangle(0, 0));
      }
    });

    return dialogBuilder;
  }
View Full Code Here

            }
          }
        }
      });

      final JEditorPane editorPane = new PluginEditorPane();
      editorPane.setEditable(false);
      editorPane.setEditorKit(new HTMLEditorKit());
      editorPane.setFocusable(false);
      editorPane.setContentType("text/html");

      final String website = plugin.getWebsite();
      final StringBuilder html = new StringBuilder("<html><body width='300px'>");
      html.append("<p><b>").append(text).append("</b> <font style='color:gray; font-size: 8px'>(").append(pluginId).append(")</font> </p>");
      html.append("<p><font style='color: gray; font-weight: normal; font-style:italic'>");
      html.append(pluginUrl);
      html.append("</font>");
      html.append(longText);
      html.append("</p>");

      if (website != null && !website.isEmpty()) {
        html.append("<br><p>");
        html.append("<font style='font-weight: bold; color:gray; font-size: 8px'>Website: ").append(website).append("</font>");
        html.append("</p>");
      }
      html.append("</html></body>");

      editorPane.setText(html.toString());
      _component.add(editorPane, "3, 1, 3, 1");

      _component.addMouseListener(new PluginComponentMouseAdapter(editorPane, checkbox));
      editorPane.addMouseListener(new PluginComponentMouseAdapter(editorPane, checkbox));
    }
View Full Code Here

        return pane;
    }

    private Component createResponseDataPanel()
    {
        results = new JEditorPane();
        results.setEditable(false);

        resultsScrollPane = makeScrollPane(results);
        imageLabel = new JLabel();
View Full Code Here

        }
    }

    @Override
    protected void setUp() throws Exception {
        jep = new JEditorPane();
        setIgnoreNotImplemented(true);
        action = new StyledTextAction("testName");
        message = null;
        bWasException = false;
        kit = new StyledEditorKit();
View Full Code Here

        assertEquals("testName", action.getValue(Action.NAME));
        assertTrue(action.isEnabled());
    }

    public void testGetEditor() {
        jep = new JEditorPane();
        assertEquals(jep, action.getEditor(new ActionEvent(jep, 1, "...")));
        //Really this is need to check NullPointerExceoption, but ...
    }
View Full Code Here

            }
        }
    }

    public void testGetStyledDocument() {
        jep = new JEditorPane();
        try {
            action.getStyledDocument(jep);
        } catch (IllegalArgumentException e) {
            bWasException = true;
            message = e.getMessage();
View Full Code Here

        assertTrue(bWasException);
        assertTrue(message.endsWith("'StyledDocument'"));
    }

    public void testGetStyledEditorKit() {
        jep = new JEditorPane();
        try {
            action.getStyledEditorKit(jep);
        } catch (IllegalArgumentException e) {
            bWasException = true;
            message = e.getMessage();
View Full Code Here

        super.setUp();

        setIgnoreNotImplemented(true);
       
        htmlEditorKit = new HTMLEditorKit();
        editorPane = new JEditorPane();
        editorPane.setEditorKit(htmlEditorKit);
        doc = (HTMLDocument) editorPane.getDocument();

        StringBuffer src = new StringBuffer();
        src.append("<HTML>");
View Full Code Here

TOP

Related Classes of javax.swing.JEditorPane$HeaderParser

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.