Changeset 4797

Show
Ignore:
Timestamp:
06/09/08 07:21:27 (6 months ago)
Author:
jonas.granvik@…
Message:

Caption is set ok, if mail is read in new window.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • incubator/imap-portlet/src/com/itmill/toolkit/incubator/imapportlet/ImapPortlet.java

    r4787 r4797  
    9999 
    100100    ExpandLayout mainLayout; 
    101     Window writeWin; 
     101    Window writeWin, readMailWin; 
    102102 
    103103    // Initializing buttons 
     
    644644    private boolean closeMail() { 
    645645        mailLayout.removeAllComponents(); 
     646        if (isPortlet && portletWindowState == WindowState.NORMAL) { 
     647            main.removeWindow(readMailWin); 
     648        } 
    646649        return true; 
    647650    } 
     
    890893                    // if portlet with normal window state, redefine where 
    891894                    // mailLayout is. It should be in new window. 
    892                     Window readMailWin = new Window(); 
     895                    readMailWin = new Window(); 
     896                    readMailWin.setCaption(mailTable.getItem(target) 
     897                            .getItemProperty( 
     898                                    ImapPortletConstants.PROPERTY_SUBJECT) 
     899                            .toString()); 
    893900                    main.addWindow(readMailWin); 
    894901                    readMailWin.addComponent(mailLayout); 
     
    933940    public void buttonClick(ClickEvent event) { 
    934941        Component tab = event.getButton().getParent().getParent(); 
    935         // if (closeButtons.contains(event.getButton())) { 
    936         // // close the tab (and mail) 
    937         // if (closeMail(tab)) { 
    938         // // remove close button from list 
    939         // closeButtons.remove(event.getButton()); 
    940         // // remove reply button from ArrayList 
    941         // Iterator it = ((OrderedLayout) event.getButton().getParent()) 
    942         // .getComponentIterator(); 
    943         // while (it.hasNext()) { 
    944         // Object ob = it.next(); 
    945         // if (ob instanceof Button 
    946         // && ((Button) ob).getCaption().equals("Reply")) { 
    947         // // if correct component found 
    948         // replyButtons.remove(ob); 
    949         // } 
    950         // } 
    951         // } 
     942 
    952943        if (event.getButton() == closeButton) { 
    953944            closeMail(); 
     
    978969                loggedIn = true; 
    979970            } 
    980             buildFullView(); 
     971            buildView(); 
    981972 
    982973        } else if (event.getButton() == cancelLoginButton) { 
     
    993984            mailFolder = null; 
    994985            buildView(); 
    995             // resetLoginForm(); 
    996986 
    997987        } else if (event.getButton() == writeButton) {