mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 15:42:14 +00:00
ICU-3501 Fix some compiler warnings
X-SVN-Rev: 15963
This commit is contained in:
parent
baa5ea3a34
commit
1fa0dc1773
4 changed files with 125 additions and 4 deletions
|
@ -104,8 +104,8 @@ class RBProjectItemPanel extends JPanel implements ActionListener {
|
|||
JPanel centerPanel = new JPanel(new BorderLayout());
|
||||
mainBox = new Box(BoxLayout.Y_AXIS);
|
||||
JScrollPane scrollPane = new JScrollPane(mainBox,
|
||||
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
|
||||
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
|
||||
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
||||
centerPanel.add(scrollPane, BorderLayout.NORTH);
|
||||
centerPanel.setBorder(BorderFactory.createEtchedBorder());
|
||||
JPanel botPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.awt.event.*;
|
|||
import java.util.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.*;
|
||||
|
||||
import com.ibm.rbm.*;
|
||||
|
||||
|
@ -276,3 +277,63 @@ class RBSearchPanel extends JPanel {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
// The table model for searched Items
|
||||
|
||||
class SearchItemsTableModel extends AbstractTableModel {
|
||||
Vector items;
|
||||
|
||||
public SearchItemsTableModel(Vector items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public void setItems(Vector items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int getColumnCount() { return 3; }
|
||||
|
||||
public int getRowCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public Object getValueAt(int row, int col) {
|
||||
BundleItem item = (BundleItem)items.elementAt(row);
|
||||
String retStr = null;
|
||||
|
||||
switch(col) {
|
||||
case 0:
|
||||
retStr = item.getKey();
|
||||
break;
|
||||
case 1:
|
||||
retStr = item.getTranslation();
|
||||
break;
|
||||
case 2:
|
||||
retStr = (item.getParentGroup() == null ? "" : item.getParentGroup().getName());
|
||||
break;
|
||||
default:
|
||||
retStr = Resources.getTranslation("table_cell_error");
|
||||
}
|
||||
|
||||
return retStr;
|
||||
}
|
||||
|
||||
public String getColumnName(int col) {
|
||||
if (col == 0) return Resources.getTranslation("languageuntrans_column_key");
|
||||
else if (col == 1) return Resources.getTranslation("languageuntrans_column_translation");
|
||||
else if (col == 2) return Resources.getTranslation("languageuntrans_column_group");
|
||||
else return Resources.getTranslation("table_column_error");
|
||||
}
|
||||
|
||||
public BundleItem getBundleItem(int row) {
|
||||
return (BundleItem)items.elementAt(row);
|
||||
}
|
||||
|
||||
public Vector getBundleItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
fireTableDataChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ class RBStatisticsPanel extends JPanel {
|
|||
jTextFieldStatsCountry.setColumns(25);
|
||||
jTextFieldStatsVariant.setColumns(25);
|
||||
|
||||
updateButton.setEnabled(false);
|
||||
//updateButton.setEnabled(false);
|
||||
|
||||
// Update the display
|
||||
if (mainBox != null){
|
||||
|
@ -168,7 +168,8 @@ class RBStatisticsPanel extends JPanel {
|
|||
} else {
|
||||
mainBox = new Box(BoxLayout.Y_AXIS);
|
||||
}
|
||||
if (dupBox != null) dupBox.removeAll();
|
||||
if (dupBox != null)
|
||||
dupBox.removeAll();
|
||||
removeAll();
|
||||
mainBox.add(jLabelStatsTitle);
|
||||
mainBox.add(Box.createVerticalStrut(10));
|
||||
|
|
|
@ -250,3 +250,62 @@ class RBUntranslatedPanel extends JPanel {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The table model for untranslated Items
|
||||
*/
|
||||
|
||||
class UntranslatedItemsTableModel extends AbstractTableModel {
|
||||
Bundle bundle;
|
||||
|
||||
public UntranslatedItemsTableModel(Bundle bundle) {
|
||||
this.bundle = bundle;
|
||||
}
|
||||
|
||||
public void setBundle(Bundle bundle) {
|
||||
this.bundle = bundle;
|
||||
update();
|
||||
}
|
||||
|
||||
public int getColumnCount() { return 3; }
|
||||
|
||||
public int getRowCount() {
|
||||
return bundle.getUntranslatedItemsSize();
|
||||
}
|
||||
|
||||
public Object getValueAt(int row, int col) {
|
||||
BundleItem item = bundle.getUntranslatedItem(row);
|
||||
String retStr = null;
|
||||
|
||||
switch(col) {
|
||||
case 0:
|
||||
retStr = item.getKey();
|
||||
break;
|
||||
case 1:
|
||||
retStr = item.getTranslation();
|
||||
break;
|
||||
case 2:
|
||||
retStr = (item.getParentGroup() == null ? "" : item.getParentGroup().getName());
|
||||
break;
|
||||
default:
|
||||
retStr = Resources.getTranslation("table_cell_error");
|
||||
}
|
||||
|
||||
return retStr;
|
||||
}
|
||||
|
||||
public String getColumnName(int col) {
|
||||
if (col == 0) return Resources.getTranslation("languageuntrans_column_key");
|
||||
else if (col == 1) return Resources.getTranslation("languageuntrans_column_translation");
|
||||
else if (col == 2) return Resources.getTranslation("languageuntrans_column_group");
|
||||
else return Resources.getTranslation("table_column_error");
|
||||
}
|
||||
|
||||
public BundleItem getBundleItem(int row) {
|
||||
return bundle.getUntranslatedItem(row);
|
||||
}
|
||||
|
||||
public void update() {
|
||||
fireTableDataChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue