1 19 20 package jemmyI18NWizard.wizardSupport; 21 22 import org.netbeans.jemmy.operators.JTableOperator; 23 24 import org.netbeans.test.oo.gui.jam.JamComboBox; 25 import org.netbeans.test.oo.gui.jam.Jemmy; 26 import org.netbeans.test.oo.gui.jello.JelloWizard; 27 import org.netbeans.test.oo.gui.jello.JelloBundle; 28 import org.netbeans.test.oo.gui.jello.JelloUtilities; 29 30 import org.netbeans.modules.i18n.HardCodedString; 31 import org.netbeans.modules.i18n.I18nString; 32 33 34 public class Page2 extends JelloWizard { 35 36 protected JamComboBox sourceSelectionComboBox; 37 public JTableOperator foundStringTable; 38 39 private static final String wizardBundle = "org.netbeans.modules.i18n.wizard.Bundle"; 40 41 public Page2() { 42 super(JelloUtilities.getForteFrame(), JelloBundle.getString(wizardBundle, "LBL_WizardTitle")); 43 sourceSelectionComboBox = this.getJamComboBox(0); 44 foundStringTable = new JTableOperator(Jemmy.getOp(this)); 45 } 46 47 public void clearTableSelection() { 48 foundStringTable.clearSelection(); 49 } 50 51 public String getColumnName(int index) { 52 return foundStringTable.getColumnName(index); 53 } 54 55 private boolean isCellEditable(int rowIndex, int columnIndex) { 56 return foundStringTable.isCellEditable(rowIndex, columnIndex); 57 } 58 59 public Object getCell(int rowIndex, int columnIndex) { 60 return foundStringTable.getValueAt(rowIndex, columnIndex); 61 } 62 63 public void setCell(Object object, int rowIndex, int columnIndex) { 64 foundStringTable.setValueAt(object, rowIndex, columnIndex); 65 } 66 67 public void selectRow(int index) { 68 foundStringTable.setRowSelectionInterval(index, index); 69 } 70 71 public void selectRows(int index1, int index2) { 72 foundStringTable.setRowSelectionInterval(index1, index2); 73 } 74 75 public int getSelectedRow() { 76 return foundStringTable.getSelectedRow(); 77 } 78 79 public int[] getSelectedRows() { 80 return foundStringTable.getSelectedRows(); 81 } 82 83 public int getSelectedColumn() { 84 return foundStringTable.getSelectedColumn(); 85 } 86 87 public void selectSource(int index) { 88 sourceSelectionComboBox.setSelectedItem(index); 89 } 90 91 public void selectSource(String source) { 92 sourceSelectionComboBox.setSelectedItem(source); 93 } 94 95 public String getSelectedSource() { 96 return sourceSelectionComboBox.getSelectedItem(); 97 } 98 99 public int getSelectedItemIndex() { 100 return sourceSelectionComboBox.getSelectedIndex(); 101 } 102 103 public String getHardcodedString(int rowIndex) { 104 HardCodedString hardcodedString = (HardCodedString)this.getCell(rowIndex,1); 105 return hardcodedString.getText(); 106 } 107 108 public String getKey(int rowIndex) { 109 I18nString string = (I18nString)this.getCell(rowIndex,2); 110 return string.getKey(); 111 } 112 113 public String getValue(int rowIndex) { 114 I18nString string = (I18nString)this.getCell(rowIndex,3); 115 return string.getValue(); 116 } 117 118 public boolean getEnabled(int rowIndex) { 119 Boolean enabled = (Boolean )this.getCell(rowIndex,0); 120 return enabled.booleanValue(); 121 } 122 123 public String getComment(int rowIndex) { 124 I18nString string = (I18nString)this.getCell(rowIndex,3); 125 return string.getComment(); 126 } 127 128 public void setKey(int rowIndex, String key) { 129 I18nString string = (I18nString)this.getCell(rowIndex,2); 130 string.setKey(key); 131 } 132 133 public void setValue(int rowIndex, String value) { 134 I18nString string = (I18nString)this.getCell(rowIndex,2); 135 string.setValue(value); 136 } 137 138 public void setEnabled(int rowIndex, boolean enabled) { 139 this.setCell(enabled ? Boolean.TRUE : Boolean.FALSE, rowIndex, 0); 140 } 141 142 public void setComment(int rowIndex, String comment) { 143 I18nString string = (I18nString)this.getCell(rowIndex,3); 144 string.setComment(comment); 145 } 146 147 148 protected void updatePanel(int panelIndex) { 149 } 150 151 } 152 153 154 | Popular Tags |