Ignore:
Timestamp:
2003-08-18T13:52:32+12:00 (21 years ago)
Author:
jmt12
Message:

Make value text field request focus after metadata element selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/valuetree/GValueTree.java

    r5105 r5149  
    77 * University of Waikato, New Zealand.
    88 *
    9  * <BR><BR>
    10  *
    119 * Author: John Thompson, Greenstone Digital Library, University of Waikato
    1210 *
    13  * <BR><BR>
    14  *
    1511 * Copyright (C) 1999 New Zealand Digital Library Project
    16  *
    17  * <BR><BR>
    1812 *
    1913 * This program is free software; you can redistribute it and/or modify
     
    2216 * (at your option) any later version.
    2317 *
    24  * <BR><BR>
    25  *
    2618 * This program is distributed in the hope that it will be useful,
    2719 * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2820 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2921 * GNU General Public License for more details.
    30  *
    31  * <BR><BR>
    3222 *
    3323 * You should have received a copy of the GNU General Public License
     
    224214    }
    225215
    226     // Load the model for the newly selected metadata element
    227216    selected_metadata_element = element;
    228     vm = Gatherer.c_man.getCollection().msm.getValueTree(element);
    229     tree.setModel(vm);
    230 
    231217    // Special case the extracted metadata set
    232     if (selected_metadata_element.getNamespace().equals("")) {
     218    if (selected_metadata_element.getNamespace().equals(Utility.EXTRACTED_METADATA_NAMESPACE)) {
    233219        // Display the panel showing the "you cannot edit this metadata" message
    234220        args[0] = selected_metadata_element.toString();
     
    238224    }
    239225    else {
     226        if(selected_metadata_element.hasValueTree()) {
     227        tree.setEnabled(true);
     228        // Load the model for the newly selected metadata element
     229        vm = Gatherer.c_man.getCollection().msm.getValueTree(element);
     230        }
     231        else {
     232        tree.setEnabled(false);
     233        vm = new GValueModel();
     234        }
     235        tree.setModel(vm);
     236
    240237        // Display the panel for viewing and assigning metadata
    241238        card_layout.show(this, TREE);
     
    267264        value.setCaretPosition(0);
    268265        manual_text_edit_event = true;
     266        value.requestFocus();
    269267    }
    270268    }
Note: See TracChangeset for help on using the changeset viewer.