Changeset 4522


Ignore:
Timestamp:
2003-06-09T13:15:05+12:00 (21 years ago)
Author:
kjdon
Message:

added another card to teh metadata card layout - now switch between three: a 'no file' placeholder, a 'no metadata' placeholder, and the card for the displayed metadata. thought this was easier than trying to change the displayed string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java

    r4519 r4522  
    149149    /** The name of the panel containing the metadata table. */
    150150    static final private String CARD_ONE  = "Card One";
    151     /** The name of the panel containing the placeholder for the metadata table. */
     151    /** The name of the panel containing the 'no file' placeholder for the metadata table. */
     152    static final private String CARD_TWO = "Card Two";
     153    /** The name of the panel containing the 'no metadata' placeholder for the metadata table. */
    152154    static final private String CARD_ZERO = "Card Zero";
    153155    /** The name of the panel containing the placeholder for the value tree. */
     
    459461    JPanel table_pane_zero = new JPanel();
    460462    table_pane_zero.setOpaque(false);
     463   
     464    JPanel table_pane_two = new JPanel();
     465    table_pane_two.setOpaque(false);
    461466
    462467    JLabel no_file_message = new JLabel(get("No_File"));
     
    464469    no_file_message.setOpaque(false);
    465470    no_file_message.setVerticalAlignment(JLabel.CENTER);
     471   
     472    JLabel no_metadata_message = new JLabel(get("No_Metadata"));
     473    no_metadata_message.setHorizontalAlignment(JLabel.CENTER);
     474    no_metadata_message.setOpaque(false);
     475    no_metadata_message.setVerticalAlignment(JLabel.CENTER);
    466476
    467477    JPanel table_pane_one = new JPanel();
     
    564574    table_pane_one.add(table_scroll, BorderLayout.CENTER);
    565575
     576    table_pane_two.setLayout(new BorderLayout());
     577    table_pane_two.add(no_metadata_message, BorderLayout.CENTER);
     578   
    566579    table_card_pane.setLayout(card_layout);
    567580    table_card_pane.add(table_pane_zero, CARD_ZERO);
    568581    table_card_pane.add(table_pane_one, CARD_ONE);
    569 
     582    table_card_pane.add(table_pane_two, CARD_TWO);
    570583    //view_button_pane.setLayout(new GridLayout(1,2,5,0));
    571584    //view_button_pane.add(assigned_metadata_view);
     
    784797    public void validateMetadataTable() {
    785798    // Validate card_layout
     799    if (records == null) {
     800        card_layout.show(table_card_pane, CARD_ZERO);
     801    } else if (model.getRowCount() == 0) {
     802        card_layout.show(table_card_pane, CARD_TWO);
     803    } else {
     804        card_layout.show(table_card_pane, CARD_ONE);
     805    }
     806    /*
    786807    if(records != null && model.getRowCount() > 0) {
    787808        card_layout.show(table_card_pane, CARD_ONE);
     
    789810    else {
    790811        card_layout.show(table_card_pane, CARD_ZERO);
    791     }
     812        }*/
    792813    }
    793814
Note: See TracChangeset for help on using the changeset viewer.