ICU-3848 Fix some updating problems.

X-SVN-Rev: 15959
This commit is contained in:
George Rhoten 2004-06-30 01:29:54 +00:00
parent 086955a394
commit c599fb313f
3 changed files with 35 additions and 30 deletions

View File

@ -490,3 +490,32 @@ class GroupComboActionListener implements ActionListener {
} else RBManagerGUI.debugMsg("Selection changed, but no active components");
}
}
/**
* The list model for groups
*/
class GroupItemsListModel extends AbstractListModel {
BundleGroup group;
public void setGroup(BundleGroup group) {
this.group = group;
}
public GroupItemsListModel(BundleGroup group) {
this.group = group;
}
public int getSize() {
if (group == null) return 0;
return group.getItemCount();
}
public Object getElementAt(int index) {
return group.getBundleItem(index);
}
public void update() {
fireContentsChanged(this, 0, getSize()-1);
}
}

View File

@ -262,6 +262,7 @@ public class RBManagerGUI extends JFrame implements ActionListener, MouseListene
public void createBundleItem() {
new BundleItemCreationDialog(rbm, this, Resources.getTranslation("dialog_title_new_item"), true);
updateDisplayPanels();
updateProjectTree();
}
/**
@ -1288,33 +1289,6 @@ class RBTreeCellRenderer extends DefaultTreeCellRenderer {
}
}
// The list model for groups
class GroupItemsListModel extends AbstractListModel {
BundleGroup group;
public void setGroup(BundleGroup group) {
this.group = group;
}
public GroupItemsListModel(BundleGroup group) {
this.group = group;
}
public int getSize() {
if (group == null) return 0;
return group.getItemCount();
}
public Object getElementAt(int index) {
return group.getBundleItem(index);
}
public void update() {
fireContentsChanged(this, 0, getSize()-1);
}
}
// Table model for resource bundle projects
class RBProject {

View File

@ -143,11 +143,13 @@ class RBProjectItemPanel extends JPanel implements ActionListener {
for (int i=0; i < bundles.size(); i++) {
Bundle bundle = (Bundle)bundles.elementAt(i);
BundleItem bundleItem = bundle.getBundleItem(key);
boolean translated = bundleItem.isTranslated();
//boolean translated = bundleItem.isTranslated();
JLabel encodingLabel = new JLabel(Resources.getTranslation("project_panel_bundle", bundle.toString()),
SwingConstants.LEFT);
if (!translated) encodingLabel.setText(Resources.getTranslation("project_panel_bundle_untranslated",
bundle.toString()));
if (bundleItem == null || !bundleItem.isTranslated()) {
encodingLabel.setText(Resources.getTranslation("project_panel_bundle_untranslated",
bundle.toString()));
}
String fieldText = (bundleItem == null ? Resources.getTranslation("project_panel_item_inherits") :
bundleItem.getTranslation());
JTextField itemField = new JTextField(fieldText);