Changeset 11948


Ignore:
Timestamp:
2006-06-20T13:46:11+12:00 (18 years ago)
Author:
kjdon
Message:

tidied up layout a bit, added radio buttons for installing cd/noinstall cd

File:
1 edited

Legend:

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

    r11754 r11948  
    9090    private JTextArea instructions_textarea;
    9191
     92    /** The radio button for switching on the noinstall option */
     93    private JRadioButton noinstall_button = null;
     94    private JRadioButton install_button = null;
    9295    private JTextField title_field = null;
    9396    private JTextField estimated_size_field = null;
     
    173176    //title.getDocument().addDocumentListener(new DocumentListener());
    174177
     178    noinstall_button = new JRadioButton();
     179    Dictionary.registerBoth(noinstall_button, "WriteCDImagePrompt.NoInstall", "WriteCDImagePrompt.NoInstall_Tooltip");
     180
     181    install_button = new JRadioButton();
     182    Dictionary.registerBoth(install_button, "WriteCDImagePrompt.Install", "WriteCDImagePrompt.Install_Tooltip");
     183
     184   
    175185    }
    176186
     
    196206     * returns true if it has exported the collections that are currently selected */
    197207    public boolean display() {
     208
     209    // Radio buttons
     210    ButtonGroup radio_group = new ButtonGroup();
     211    radio_group.add(install_button);
     212    install_button.setSelected(true);
     213    radio_group.add(noinstall_button);
     214
    198215    // Top pane
    199216    JPanel instructions_pane = new JPanel(new BorderLayout());
    200     instructions_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
     217    instructions_pane.setBorder(BorderFactory.createEmptyBorder(5,5,0,5));
    201218    instructions_pane.add(new JScrollPane(instructions_textarea), BorderLayout.CENTER);
    202219   
     
    206223    title_pane.add(title_label, BorderLayout.WEST);
    207224    title_pane.add(title_field, BorderLayout.CENTER);
    208     instructions_pane.add(title_pane, BorderLayout.SOUTH);
     225    title_pane.setBorder(BorderFactory.createEmptyBorder(5,0,5,0));
     226
     227    JPanel radio_pane = new JPanel(new GridLayout(2,1));
     228    install_button.setBackground(Configuration.getColor("coloring.collection_heading_background", true));
     229    noinstall_button.setBackground(Configuration.getColor("coloring.collection_heading_background", true));
     230    radio_pane.add(install_button);
     231    radio_pane.add(noinstall_button);
     232   
     233   
     234    JPanel options_pane = new JPanel(new BorderLayout());
     235    options_pane.add(title_pane, BorderLayout.NORTH);
     236    options_pane.add(radio_pane, BorderLayout.CENTER);
     237    instructions_pane.add(options_pane, BorderLayout.SOUTH);
    209238
    210239    // Central pane
     
    323352    }
    324353
     354    if (noinstall_button.isSelected()) {
     355        command_parts_list.add("-noinstall");
     356    }
     357
    325358    for (int i = 0; i < num_collections; i++) {
    326359        command_parts_list.add(((BasicCollectionConfiguration) selected_collections.get(i)).getShortName());
     
    332365    }
    333366    DebugStream.println("");
    334 
    335367    // Run the exportcol.pl command
    336368    String[] command_parts = (String[]) command_parts_list.toArray(new String[0]);
Note: See TracChangeset for help on using the changeset viewer.