作業部屋の使い方を試しています。
(empty log message)
| @@ -1,33 +0,0 @@ | ||
| 1 | -/* | |
| 2 | - * To change this license header, choose License Headers in Project Properties. | |
| 3 | - * To change this template file, choose Tools | Templates | |
| 4 | - * and open the template in the editor. | |
| 5 | - */ | |
| 6 | - | |
| 7 | -package test1; | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * | |
| 11 | - * @author kgto | |
| 12 | - */ | |
| 13 | -public class SampleDTO { | |
| 14 | - | |
| 15 | - private String userId; | |
| 16 | - private String userName; | |
| 17 | - | |
| 18 | - public void setUserId(String userId) { | |
| 19 | - this.userId = userId; | |
| 20 | - } | |
| 21 | - | |
| 22 | - public void setUserName(String userName) { | |
| 23 | - this.userName = userName; | |
| 24 | - } | |
| 25 | - | |
| 26 | - public String getUserId() { | |
| 27 | - return userId; | |
| 28 | - } | |
| 29 | - | |
| 30 | - public String getUserName() { | |
| 31 | - return userName; | |
| 32 | - } | |
| 33 | -} | |
| \ No newline at end of file |
| @@ -0,0 +1,70 @@ | ||
| 1 | +/* | |
| 2 | + * To change this license header, choose License Headers in Project Properties. | |
| 3 | + * To change this template file, choose Tools | Templates | |
| 4 | + * and open the template in the editor. | |
| 5 | + */ | |
| 6 | + | |
| 7 | +package test1; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * | |
| 11 | + * @author kgto | |
| 12 | + */ | |
| 13 | +public class serachData { | |
| 14 | + | |
| 15 | + private String item; | |
| 16 | + private String htmltag; | |
| 17 | + private String htmlid; | |
| 18 | + private String htmlclass; | |
| 19 | + private String around; | |
| 20 | + private String regexp; | |
| 21 | + | |
| 22 | + public void setitem(String item) { | |
| 23 | + this.item = item; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setHtmltag(String htmltag) { | |
| 27 | + this.htmltag = htmltag; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setHtmlid(String htmlid) { | |
| 31 | + this.htmlid = htmlid; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setHtmlclass(String htmlclass) { | |
| 35 | + this.htmlclass = htmlclass; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setaround(String around) { | |
| 39 | + this.around = around; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setregexp(String regexp) { | |
| 43 | + this.regexp = regexp; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public String getitem() { | |
| 47 | + return item; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public String getHtmltag() { | |
| 51 | + return htmltag; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public String getHtmlid() { | |
| 55 | + return htmlid; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public String getHtmlclass() { | |
| 59 | + return htmlclass; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public String getaround() { | |
| 63 | + return around; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getregexp() { | |
| 67 | + return regexp; | |
| 68 | + } | |
| 69 | + | |
| 70 | +} |
| @@ -15,7 +15,7 @@ | ||
| 15 | 15 | */ |
| 16 | 16 | public class Frame1 extends javax.swing.JFrame { |
| 17 | 17 | |
| 18 | - private List sampleDtoList = ObservableCollections.observableList(new ArrayList()); | |
| 18 | + private List serachDataList = ObservableCollections.observableList(new ArrayList()); | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Creates new form Frame1 |
| @@ -24,12 +24,12 @@ | ||
| 24 | 24 | initComponents(); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public List getSampleDtoList() { | |
| 28 | - return this.sampleDtoList; | |
| 27 | + public List getSerachDataList() { | |
| 28 | + return this.serachDataList; | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public void setSampleDtoList(List sampleDtoList) { | |
| 32 | - this.sampleDtoList = sampleDtoList; | |
| 31 | + public void setSerachDataList(List serachDataList) { | |
| 32 | + this.serachDataList = serachDataList; | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| @@ -50,13 +50,28 @@ | ||
| 50 | 50 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); |
| 51 | 51 | |
| 52 | 52 | jTable1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); |
| 53 | + jTable1.getTableHeader().setReorderingAllowed(false); | |
| 53 | 54 | |
| 54 | - org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${sampleDtoList}"); | |
| 55 | + org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${serachDataList}"); | |
| 55 | 56 | org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, jTable1); |
| 56 | - org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${userId}")); | |
| 57 | + org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${item}")); | |
| 58 | + columnBinding.setColumnName("項目名"); | |
| 59 | + columnBinding.setColumnClass(String.class); | |
| 60 | + columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${htmltag}")); | |
| 61 | + columnBinding.setColumnName("タグ"); | |
| 62 | + columnBinding.setColumnClass(String.class); | |
| 63 | + columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${htmlid}")); | |
| 57 | 64 | columnBinding.setColumnName("ID"); |
| 58 | - columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${userName}")); | |
| 59 | - columnBinding.setColumnName("ユーザ名"); | |
| 65 | + columnBinding.setColumnClass(String.class); | |
| 66 | + columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${htmlclass}")); | |
| 67 | + columnBinding.setColumnName("クラス"); | |
| 68 | + columnBinding.setColumnClass(String.class); | |
| 69 | + columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${around}")); | |
| 70 | + columnBinding.setColumnName("位置"); | |
| 71 | + columnBinding.setColumnClass(String.class); | |
| 72 | + columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${regexp}")); | |
| 73 | + columnBinding.setColumnName("抽出条件"); | |
| 74 | + columnBinding.setColumnClass(String.class); | |
| 60 | 75 | bindingGroup.addBinding(jTableBinding); |
| 61 | 76 | jTableBinding.bind(); |
| 62 | 77 | jScrollPane1.setViewportView(jTable1); |
| @@ -107,10 +122,14 @@ | ||
| 107 | 122 | }// </editor-fold>//GEN-END:initComponents |
| 108 | 123 | |
| 109 | 124 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed |
| 110 | - SampleDTO dto = new SampleDTO(); | |
| 111 | - dto.setUserId("1"); | |
| 112 | - dto.setUserName("しがのん"); | |
| 113 | - this.sampleDtoList.add(dto); | |
| 125 | + serachData sdat = new serachData(); | |
| 126 | + sdat.setitem("項目1"); | |
| 127 | + sdat.setHtmltag("DIV"); | |
| 128 | + sdat.setHtmlid(""); | |
| 129 | + sdat.setHtmlclass("classkey1"); | |
| 130 | + sdat.setaround(""); | |
| 131 | + sdat.setregexp(""); | |
| 132 | + this.serachDataList.add(sdat); | |
| 114 | 133 | }//GEN-LAST:event_jButton1ActionPerformed |
| 115 | 134 | |
| 116 | 135 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed |
| @@ -117,7 +136,7 @@ | ||
| 117 | 136 | //System.out.println(jTable1.getSelectedRow()); |
| 118 | 137 | int SelectedRow = jTable1.getSelectedRow(); |
| 119 | 138 | if(!(SelectedRow < 0)) { |
| 120 | - this.sampleDtoList.remove(SelectedRow); | |
| 139 | + this.serachDataList.remove(SelectedRow); | |
| 121 | 140 | } |
| 122 | 141 | }//GEN-LAST:event_jButton2ActionPerformed |
| 123 | 142 |