Changeset 17517

Show
Ignore:
Timestamp:
10.10.2008 15:06:43 (11 years ago)
Author:
oranfry
Message:

fixes to the last change and made the selectinput render more nicely

Location:
release-kits/shared/ant-installer
Files:
9 modified

Legend:

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

    r17514 r17517  
    4444    public String getDisplayText() { 
    4545        if( org.tp23.antinstaller.Installer.langPack != null){ 
    46             return org.tp23.antinstaller.Installer.langPack.getString(getProperty() + ".displayText"); 
     46            try { 
     47                String r = org.tp23.antinstaller.Installer.langPack.getString(getProperty() + ".displayText"); 
     48                return r; 
     49            } catch (MissingResourceException e) {} 
    4750        } 
    4851        return displayText; 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/input/SelectInput.java

    r17516 r17517  
    7171        public String getText() { 
    7272            if( org.tp23.antinstaller.Installer.langPack != null ) { 
    73                 String r = org.tp23.antinstaller.Installer.langPack.getString( getProperty() + "." + idx + ".displayText" ); 
    74                 if ( r != null ) return r; 
     73                try { 
     74                    String r = org.tp23.antinstaller.Installer.langPack.getString( getProperty() + "." + idx + ".displayText" ); 
     75                    return r; 
     76                } catch ( java.util.MissingResourceException mre ) {} 
    7577            } 
    7678            return text; 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/LicensePageRenderer.java

    r17514 r17517  
    5353    } 
    5454 
     55    public void reInstanceInit() { 
     56        getNextButton().setText( org.tp23.antinstaller.Installer.langPack.getString( "license.next.text" ) ); 
     57        getCancelButton().setText( org.tp23.antinstaller.Installer.langPack.getString( "license.cancel.text" ) ); 
     58    } 
     59 
    5560    public void instanceInit() throws Exception { 
     61 
    5662        String resource = ((LicensePage)page).getResource(); 
    5763        InputStream licensein = this.getClass().getResourceAsStream(resource); 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/ProgressPageRenderer.java

    r17514 r17517  
    8383    } 
    8484 
    85  
    8685    /** 
    8786     * instanceInit 
    8887     */ 
     88    public void reInstanceInit() { 
     89        feedBackLabel.setText(org.tp23.antinstaller.Installer.langPack.getString("click")+" "+ctx.getInstaller().getFinishButtonText()+" "+org.tp23.antinstaller.Installer.langPack.getString("toContinue")); 
     90        jToggleButton.setText(org.tp23.antinstaller.Installer.langPack.getString("showDetails")); 
     91 
     92        jTabbedPane.removeAll(); 
     93        jTabbedPane.add(org.tp23.antinstaller.Installer.langPack.getString("output"), outPanel); 
     94        jTabbedPane.add(org.tp23.antinstaller.Installer.langPack.getString("errors"), errPanel); 
     95    } 
     96 
    8997    public void instanceInit() { 
    9098        showTargets = ((ProgressPage)page).isShowTargets(); 
     
    152160        //jTabbedPane.setBounds(new Rectangle(4, MESSAGE_PANEL_HEIGHT, PAGE_WIDTH-12, 214)); 
    153161 
    154         this.getNextButton().setEnabled(false); 
     162        this.getNextButton().setVisible(false); 
    155163        this.getFinishButton().setText(ctx.getInstaller().getFinishButtonText()); 
    156         this.getFinishButton().setEnabled(true); 
     164        this.getFinishButton().setVisible(true); 
    157165    } 
    158166 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SelectInputRenderer.java

    r17514 r17517  
    1616package org.tp23.antinstaller.renderer.swing; 
    1717 
     18import java.awt.BorderLayout; 
     19import javax.swing.BoxLayout; 
    1820import java.awt.event.ItemEvent; 
    1921import java.awt.event.ItemListener; 
     
    105107    } 
    106108    public int addSelf(JPanel content,GBCF cf,  int row,boolean overflow) { 
    107         content.add(fieldLabel,cf.getCell(row, 0)); 
     109 
     110        JPanel superContainer = new JPanel(new BorderLayout()); 
     111 
     112        JPanel container = new JPanel(); 
     113        container.setLayout(new BoxLayout(container, BoxLayout.Y_AXIS)); 
     114 
     115        if ( !fieldLabel.getText().equals("") ) { 
     116            container.add(fieldLabel); 
     117        } 
     118 
    108119        Enumeration enumeration = optionGroup.getElements(); 
    109120        // there should be at least two 
    110121        enumeration.hasMoreElements(); 
    111122        AIRadioButton jrb = (AIRadioButton)enumeration.nextElement(); 
    112         content.add(jrb,cf.getCell(row++, 1)); 
    113         if(overflow) { 
     123        container.add(jrb); 
     124        if( overflow ) { 
    114125            jrb.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); 
    115126        } 
     
    117128        while(enumeration.hasMoreElements()){ 
    118129            jrb = (AIRadioButton)enumeration.nextElement(); 
    119             content.add(empty,cf.getCell(row, 0)); 
    120             content.add(jrb,cf.getCell(row++, 1)); 
     130            //content.add(empty,cf.getCell(row, 0)); 
     131            container.add(jrb); 
    121132            if(overflow) { 
    122133                jrb.setOverflow(SizeConstants.OVERFLOW_FIELD_SIZE); 
    123134            } 
    124135        } 
     136        container.add(empty); 
     137        superContainer.add(BorderLayout.WEST,container); 
     138        content.add(superContainer); 
     139 
    125140        return row; 
    126141    } 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SimpleInputPageRenderer.java

    r17516 r17517  
    9898    } 
    9999 
     100    public void reInstanceInit() {} 
     101 
    100102    public void instanceInit() throws Exception { 
    101103        ToolTipManager.sharedInstance().setInitialDelay(0); 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/renderer/swing/SwingPageRenderer.java

    r17516 r17517  
    5454     
    5555    // holds the next back buttons etc 
    56     private JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,20,3)); 
     56    private JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,12,3)); 
    5757 
    5858    private JButton backButton = new JButton(); 
     
    161161        nextButton.setText(org.tp23.antinstaller.Installer.langPack.getString("nextButton"));// "Next >>"); 
    162162        finishButton.setText(ctx.getInstaller().getFinishButtonText()); 
    163         finishButton.setEnabled(false); 
     163        finishButton.setVisible(false); 
    164164        setEventListeners(); 
    165165        setIcons(); 
    166166    } 
    167167    public abstract void instanceInit() throws Exception ; 
     168    public abstract void reInstanceInit(); 
    168169    public abstract void updateInputFields(); 
    169170    public abstract void updateDefaultValues(); 
  • release-kits/shared/ant-installer/src/org/tp23/antinstaller/runtime/SwingRunner.java

    r17516 r17517  
    285285 
    286286    protected void renderNext(SwingPageRenderer renderer) throws ClassNotFoundException, InstallException { 
    287         try { 
    288             renderer.instanceInit(); 
    289             renderer.reInit(); 
    290         } catch ( Exception e ) { 
    291             System.err.println( "Couldn't initialise a page" ); 
    292             System.exit(1); 
    293         } 
    294  
     287        renderer.reInit(); 
     288        renderer.reInstanceInit(); 
    295289 
    296290        renderer.updateDefaultValues();