Changeset 17578

Show
Ignore:
Timestamp:
23.10.2008 10:58:03 (11 years ago)
Author:
oranfry
Message:

more HCI changes to the installer: an animated activity indicator during install, better target names for the greenstone2 installers

Location:
release-kits/shared/ant-installer
Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/input/InputField.java

    r17517 r17578  
    4545        if( org.tp23.antinstaller.Installer.langPack != null){ 
    4646            try { 
    47                 String r = org.tp23.antinstaller.Installer.langPack.getString(getProperty() + ".displayText"); 
     47                String r = org.tp23.antinstaller.Installer.langPack.getString(getProperty().replaceAll(" ","_") + ".displayText"); 
    4848                return r; 
    4949            } catch (MissingResourceException e) {} 
     
    5454        if( org.tp23.antinstaller.Installer.langPack != null ) { 
    5555            try { 
    56                 return org.tp23.antinstaller.Installer.langPack.getString(getProperty() + ".explanatoryText"); 
     56                return org.tp23.antinstaller.Installer.langPack.getString(getProperty().replaceAll(" ","_") + ".explanatoryText"); 
    5757            } catch (MissingResourceException e) { 
    5858                // ignore and return null explanatoryText is optional 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java

    r17569 r17578  
    2727import javax.swing.BorderFactory; 
    2828import javax.swing.JLabel; 
     29import javax.swing.JButton; 
    2930import javax.swing.JPanel; 
    3031import javax.swing.JScrollPane; 
    3132import javax.swing.JTabbedPane; 
    3233import javax.swing.JToggleButton; 
     34import javax.swing.ImageIcon; 
    3335 
    3436import org.tp23.antinstaller.page.ProgressPage; 
     
    5658    private JToggleButton jToggleButton = new JToggleButton(); 
    5759    private JLabel feedBackLabel = new JLabel(); 
     60    private JLabel progressOn = null; 
     61    private JLabel progressOff = null; 
     62    private JPanel messagesLeft = null; 
     63    private JPanel messagesRight = null; 
    5864 
    5965    private SystemOutJTextArea outPanel = new SystemOutJTextArea(); 
     
    100106        this.add(contentPanel,BorderLayout.CENTER); 
    101107         
    102         messagesPanel.setLayout(null); 
    103         Dimension messPanelSize = new Dimension(SizeConstants.PAGE_WIDTH,MESSAGE_PANEL_HEIGHT); 
    104         messagesPanel.setSize(messPanelSize); 
    105         messagesPanel.setPreferredSize(messPanelSize); 
    106         messagesPanel.setMaximumSize(messPanelSize); 
    107         messagesPanel.setMinimumSize(messPanelSize); 
     108        messagesPanel.setLayout( new BorderLayout() ); 
     109        //Dimension messPanelSize = new Dimension(SizeConstants.PAGE_WIDTH,MESSAGE_PANEL_HEIGHT); 
     110        //messagesPanel.setSize(messPanelSize); 
     111        //messagesPanel.setPreferredSize(messPanelSize); 
     112        //messagesPanel.setMaximumSize(messPanelSize); 
     113        //messagesPanel.setMinimumSize(messPanelSize); 
     114 
     115        ImageIcon progressOnIcon = createImageIcon("/resources/progressOn.gif"); 
     116        progressOn = new JLabel( progressOnIcon ); 
     117        progressOnIcon.setImageObserver(progressOn); 
     118        progressOff = new JLabel( createImageIcon("/resources/progressOff.gif") ); 
    108119 
    109120        //FIXME not i18n properly since the sentence is not correct ordering in German 
    110121        feedBackLabel.setText(org.tp23.antinstaller.Installer.langPack.getString("click")+" "+ctx.getInstaller().getFinishButtonText()+" "+org.tp23.antinstaller.Installer.langPack.getString("toContinue")); 
    111         feedBackLabel.setBounds(new Rectangle(115, 7, 272, 22)); 
     122        //feedBackLabel.setBounds(new Rectangle(115, 7, 272, 22)); 
    112123        jToggleButton.setText(org.tp23.antinstaller.Installer.langPack.getString("showDetails")); 
    113         jToggleButton.setBounds(new Rectangle(5, 7, 104, 22)); 
    114         jToggleButton.setMargin(new Insets(0,0,0,0)); 
    115         messagesPanel.add(jToggleButton, null); 
    116         messagesPanel.add(feedBackLabel, null); 
     124        //jToggleButton.setBounds(new Rectangle(5, 7, 104, 22)); 
     125        //jToggleButton.setMargin(new Insets(0,0,0,0)); 
     126 
     127        messagesLeft = new JPanel(); 
     128        messagesLeft.add(jToggleButton, null); 
     129        messagesLeft.add(feedBackLabel, null); 
     130 
     131        messagesRight = new JPanel(); 
     132        messagesRight.add( progressOff ); 
     133 
     134        messagesPanel.add(messagesLeft, BorderLayout.WEST); 
     135        messagesPanel.add(messagesRight, BorderLayout.EAST); 
     136         
    117137        jToggleButton.addActionListener(new ActionListener(){ 
    118138            public void actionPerformed(ActionEvent e) { 
     
    152172//      } 
    153173 
     174 
    154175        //jTabbedPane.setVisible(false); 
    155176        jTabbedPane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 
     
    164185        this.getFinishButton().setText(ctx.getInstaller().getFinishButtonText()); 
    165186        this.getFinishButton().setVisible(true); 
     187        this.getFinishButton().addActionListener( 
     188            new ActionListener() { 
     189                public void actionPerformed( ActionEvent e ) { 
     190                    messagesRight.removeAll(); 
     191                    messagesRight.add( progressOn ); 
     192                } 
     193            } 
     194        ); 
     195 
    166196    } 
    167197 
     
    202232    public void updateDefaultValues() { 
    203233    } 
     234 
     235    /** Returns an ImageIcon, or null if the path was invalid. */ 
     236    protected static ImageIcon createImageIcon(String path) { 
     237        java.net.URL imgURL = org.tp23.antinstaller.Installer.class.getResource(path); 
     238        if (imgURL != null) { 
     239            return new ImageIcon(imgURL); 
     240        } else { 
     241            System.err.println("Couldn't find file: " + path); 
     242            return null; 
     243        } 
     244    } 
     245 
     246    public void stopPage() { 
     247        messagesRight.removeAll(); 
     248        messagesRight.add( progressOff ); 
     249    } 
     250 
    204251} 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java

    r17517 r17578  
    175175    } 
    176176 
     177    public void stopPage() {} 
     178 
    177179    private void setImage(String resource) throws Exception{ 
    178180        if(resource == null){ 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/runtime/SwingRunner.java

    r17517 r17578  
    341341        renderer.getFinishButton().requestFocus(); 
    342342        renderer.getTitleLabel().setText(org.tp23.antinstaller.Installer.langPack.getString("complete")); 
     343        renderer.stopPage(); 
    343344        ctx.getAntOutputRenderer().getErr().flush(); 
    344345        ctx.getAntOutputRenderer().getOut().flush(); 
     
    356357            renderer.getFinishButton().setEnabled(true); 
    357358            renderer.getFinishButton().requestFocus(); 
     359            renderer.stopPage(); 
    358360            renderer.getTitleLabel().setText(org.tp23.antinstaller.Installer.langPack.getString("failed")); 
    359361        }