Package javax.swing.text.html

Examples of javax.swing.text.html.HTMLEditorKit$InsertHRAction


    private boolean showPopup = true;

    //~ Constructors -------------------------------------------------------------------------------------------------------------
    public JHTMLEditorPane() {
        super();
        setEditorKit(new HTMLEditorKit());
        setEditable(false);
        setOpaque(true);
        setAutoscrolls(true);
        addHyperlinkListener(this);
        setTransferHandler(new HTMLTextAreaTransferHandler());
View Full Code Here


        statusDetails = "";
        URLConnection con = google.openConnection();
        con.setRequestProperty("User-Agent", "");
        InputStream in = con.getInputStream();
        try {
            HTMLEditorKit kit = new HTMLEditorKit();
            HTMLDocument doc = new HTMLDocument();
            doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
            kit.read(new InputStreamReader(in, "UTF-8"), doc, 0);
            HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
            while (it.isValid()) {
                if(it.getAttributes() != null) {
                    String href = (String) it.getAttributes().getAttribute(HTML.Attribute.HREF);
                    if (href != null && href.endsWith("." + currentFiletype)) {
View Full Code Here

     */
    private boolean searchPage(URL page, String searchText) {
        try {
            // create a document instance to search only in the view
            // and to exlude the formatting texts like HTML tags
            HTMLEditorKit editorKit = new HTMLEditorKit();
            Document doc = editorKit.createDefaultDocument();
            doc.putProperty("IgnoreCharsetDirective", new Boolean(true));
            editorKit.read(page.openStream(), doc, 0);

            String content = doc.getText(0, doc.getLength());

            return content.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
        } catch (Exception e) {
View Full Code Here

    /**
     * Given some html, extracts its text.
     */
    public static String extractTextFromHTML(final String html) {
        try {
            final EditorKit kit = new HTMLEditorKit();
            final Document doc = kit.createDefaultDocument();

            // The Document class does not yet handle charset's properly.
            doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);

            // Create a reader on the HTML content.
            final Reader rd = new StringReader(html);

            // Parse the HTML.
            kit.read(rd, doc, 0);

            // The HTML text is now stored in the document
            return doc.getText(0, doc.getLength());
        } catch (final Exception e) {
        }
View Full Code Here

    init();
  }


  public final void init() {
    _htmlEditorKit = new HTMLEditorKit();
    _htmlEditorKit.setStyleSheet(GuiResources.EDITORPANE_STYLESHEET);
  }
View Full Code Here

    dialogBuilder.addCloseButton();
    dialogBuilder.setTitle("FindBugs analysis settings");
    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);
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'>");
View Full Code Here


        protected void initHtmlEditPane()
        {
                htmlEditPane = new JEditorPane();
                HTMLEditorKit htmlKit = new HTMLEditorKit();
                htmlEditPane.setEditorKit(htmlKit);
        }
View Full Code Here

    textArea = new JEditorPane();
    textArea.setEditable(false);
    textArea.setBackground(new Color(0, 0, 0, 0));
    textArea.setOpaque(false);
    textArea.setEditorKit(new HTMLEditorKit());

    setTitle(Messages.getString("MigrationDialog.Title"));

    super.init();
  }
View Full Code Here

    {
      final JEditorPane textArea = new JEditorPane();
      textArea.setEditable(false);
      textArea.setBackground(new Color(0, 0, 0, 0));
      textArea.setOpaque(false);
      textArea.setEditorKit(new HTMLEditorKit());
      textArea.setText(Messages.getString("MigrateReportTask.Message",
          ClassicEngineBoot.printVersion(ClassicEngineBoot.computeCurrentVersionId())));

      final JPanel panel = new JPanel(new BorderLayout());
      panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
View Full Code Here

TOP

Related Classes of javax.swing.text.html.HTMLEditorKit$InsertHRAction

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.