/* * MultiContentPanel.java * * Created on den 19 september 2001, 14:21 */ package ip1.u9; import java.awt.Color; import java.io.File; import ip1.u9.util.Attachment; /**e-postredigerarens innehållsdel: hanterar textinnehåll och attachments. * * @author Henrik Johansson, DS80 * @version ht2001 */ public class MultiContentPanel extends javax.swing.JPanel implements ExtendedContentPanel { /** Skapar en ny MultiContentPanel */ public MultiContentPanel() { initComponents(); } public String getContent() { return content.getText(); } /** Avlägsnar allt innehåll från denna delkomponent */ public void clearPanel() { content.setText(""); this.attachmentPanel.setAttachments(new Attachment[0]); } public void setContent(String content) { this.content.setText(content); } public boolean hasAttachments() { return attachmentPanel.hasAttachments(); } public Attachment[] getAttachments() { return attachmentPanel.getAttachmentFiles(); } public void setAttachments(Attachment[] attachments) { attachmentPanel.setAttachments(attachments); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() {//GEN-BEGIN:initComponents attachmentPanel = new ip1.u9.AttachmentPanel(); jScrollPane1 = new javax.swing.JScrollPane(); content = new javax.swing.JEditorPane(); setLayout(new java.awt.GridBagLayout()); java.awt.GridBagConstraints gridBagConstraints1; setBackground(java.awt.Color.white); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints1.insets = new java.awt.Insets(5, 5, 5, 5); gridBagConstraints1.weightx = 1.0; add(attachmentPanel, gridBagConstraints1); jScrollPane1.setViewportView(content); gridBagConstraints1 = new java.awt.GridBagConstraints(); gridBagConstraints1.gridx = 0; gridBagConstraints1.gridy = 1; gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints1.insets = new java.awt.Insets(0, 5, 5, 5); gridBagConstraints1.weightx = 1.0; gridBagConstraints1.weighty = 1.0; add(jScrollPane1, gridBagConstraints1); }//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private ip1.u9.AttachmentPanel attachmentPanel; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JEditorPane content; // End of variables declaration//GEN-END:variables }