/** * Set the error message for the dialog box * * @param errorMessage Message for the error dialog */ private void setErrorMessage(String errorMessage) { if (BasicHTML.isHTMLString(errorMessage)) { this.errorMessage.setContentType("text/html"); } else { this.errorMessage.setContentType("text/plain"); } this.errorMessage.setText(errorMessage); this.errorMessage.setCaretPosition(0); }
private Vector createHTMLVector() { Vector htmlViews = new Vector(); int count = tabPane.getTabCount(); if (count > 0) { for (int i = 0; i < count; i++) { String title = tabPane.getTitleAt(i); if (BasicHTML.isHTMLString(title)) { htmlViews.addElement(BasicHTML.createHTMLView(tabPane, title)); } else { htmlViews.addElement(null); } } } return htmlViews; }
public void componentAdded(ContainerEvent e) { JTabbedPane tp = (JTabbedPane) e.getContainer(); Component child = e.getChild(); if (child instanceof UIResource) { return; } int index = tp.indexOfComponent(child); String title = tp.getTitleAt(index); boolean isHTML = BasicHTML.isHTMLString(title); if (isHTML) { if (htmlViews == null) { // Initialize vector htmlViews = createHTMLVector(); } else { // Vector already exists View v = BasicHTML.createHTMLView(tp, title); htmlViews.insertElementAt(v, index); } } else { // Not HTML if (htmlViews != null) { // Add placeholder htmlViews.insertElementAt(null, index); } // else nada! } }