1 32 33 package com.nqadmin.swingSet; 34 35 import javax.swing.*; 36 import java.awt.event.*; 37 import java.awt.*; 38 import com.nqadmin.swingSet.datasources.SSRowSet; 39 40 50 public class SSTextArea extends JTextArea { 51 52 55 protected SSRowSet sSRowSet; 56 57 60 protected String columnName = ""; 61 62 65 public SSTextArea() { 66 init(); 67 } 68 69 75 public SSTextArea(int _rows, int _columns) { 76 super(_rows, _columns); 77 } 79 80 86 public SSTextArea(SSRowSet _sSRowSet, String _columnName) { 87 sSRowSet = _sSRowSet; 88 columnName = _columnName; 89 init(); 90 bind(); 91 } 92 93 99 public void setColumnName(String _columnName) { 100 String oldValue = columnName; 101 columnName = _columnName; 102 firePropertyChange("columnName", oldValue, columnName); 103 bind(); 104 } 105 106 111 public String getColumnName() { 112 return columnName; 113 } 114 115 120 public void setSSRowSet(SSRowSet _sSRowSet) { 121 SSRowSet oldValue = sSRowSet; 122 sSRowSet = _sSRowSet; 123 firePropertyChange("sSRowSet", oldValue, sSRowSet); 124 bind(); 125 } 126 127 132 public SSRowSet getSSRowSet() { 133 return sSRowSet; 134 } 135 136 142 public void bind(SSRowSet _sSRowSet, String _columnName) { 143 SSRowSet oldValue = sSRowSet; 144 sSRowSet = _sSRowSet; 145 firePropertyChange("sSRowSet", oldValue, sSRowSet); 146 147 String oldValue2 = columnName; 148 columnName = _columnName; 149 firePropertyChange("columnName", oldValue2, columnName); 150 151 bind(); 152 } 153 154 157 protected void init() { 158 159 setPreferredSize(new Dimension(200,80)); 161 } 162 163 166 protected void bind() { 167 168 if (columnName==null || columnName.trim().equals("") || sSRowSet==null) { 170 return; 171 } 172 173 176 setDocument(new SSTextDocument(sSRowSet, columnName)); 178 179 182 } 183 184 185 } 187 188 189 | Popular Tags |