You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(99) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Stig T. <jw...@us...> - 2005-03-20 20:37:25
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/contacts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/contacts Modified Files: ContactCard.java ContactPanel.java ContactTable.java Log Message: Index: ContactCard.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/contacts/ContactCard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContactCard.java 3 Apr 2004 07:56:51 -0000 1.1 --- ContactCard.java 20 Mar 2005 20:36:46 -0000 1.2 *************** *** 484,492 **** gg.scale(0.7, 0.7); ! System.out.println(g.getClipBounds()); ! System.out.println(pf.getWidth() + pf.getHeight()); ! System.out.println("paper width" + pf.getPaper().getWidth()); paint(gg); --- 484,492 ---- gg.scale(0.7, 0.7); ! //System.out.println(g.getClipBounds()); ! //System.out.println(pf.getWidth() + pf.getHeight()); ! //System.out.println("paper width" + pf.getPaper().getWidth()); paint(gg); Index: ContactPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/contacts/ContactPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContactPanel.java 3 Apr 2004 07:56:51 -0000 1.1 --- ContactPanel.java 20 Mar 2005 20:36:46 -0000 1.2 *************** *** 376,380 **** public void dragEnter(DropTargetDragEvent e) { ! System.out.println("contact panel drag entered"); } --- 376,380 ---- public void dragEnter(DropTargetDragEvent e) { ! //System.out.println("contact panel drag entered"); } *************** *** 382,386 **** public void dragExit(DropTargetEvent e) { ! System.out.println("contact panel drag exited"); } --- 382,386 ---- public void dragExit(DropTargetEvent e) { ! //System.out.println("contact panel drag exited"); } *************** *** 475,479 **** comm.addMailAddress(o); ! System.out.println(o.toString()); contact.setCommunications(comm); --- 475,479 ---- comm.addMailAddress(o); ! //System.out.println(o.toString()); contact.setCommunications(comm); Index: ContactTable.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/contacts/ContactTable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContactTable.java 3 Apr 2004 07:56:51 -0000 1.1 --- ContactTable.java 20 Mar 2005 20:36:46 -0000 1.2 *************** *** 125,129 **** public boolean isCellEditable(EventObject o) { ! System.out.println("celledit is cell editable" + o); return super.isCellEditable(o); --- 125,129 ---- public boolean isCellEditable(EventObject o) { ! //System.out.println("celledit is cell editable" + o); return super.isCellEditable(o); *************** *** 133,137 **** public boolean shouldSelectCell(EventObject e) { ! System.out.println("celledit should select cell" + e); return super.shouldSelectCell(e); --- 133,137 ---- public boolean shouldSelectCell(EventObject e) { ! //System.out.println("celledit should select cell" + e); return super.shouldSelectCell(e); |
From: Stig T. <jw...@us...> - 2005-03-20 20:37:24
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/task In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/task Modified Files: TaskTableView.java TaskComparator.java TaskViewer.java Log Message: Index: TaskComparator.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/task/TaskComparator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TaskComparator.java 3 Apr 2004 07:56:44 -0000 1.1 --- TaskComparator.java 20 Mar 2005 20:36:45 -0000 1.2 *************** *** 96,101 **** s2 = "--"; ! System.out.println(s1); ! System.out.println(s2); if (s1.length() > s2.length()) { --- 96,101 ---- s2 = "--"; ! //System.out.println(s1); ! //System.out.println(s2); if (s1.length() > s2.length()) { *************** *** 109,115 **** } ! System.out.println(s1); ! System.out.println(s2); ! System.out.println("-------"); int result = s1.compareToIgnoreCase(s2); --- 109,115 ---- } ! //System.out.println(s1); ! //System.out.println(s2); ! //System.out.println("-------"); int result = s1.compareToIgnoreCase(s2); Index: TaskTableView.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/task/TaskTableView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TaskTableView.java 3 Apr 2004 07:56:44 -0000 1.1 --- TaskTableView.java 20 Mar 2005 20:36:45 -0000 1.2 *************** *** 403,407 **** addRow(taskss[i], this, c, gridbag, -1); ! //System.out.println(taskss[i].getSummary()); } --- 403,407 ---- addRow(taskss[i], this, c, gridbag, -1); ! ////System.out.println(taskss[i].getSummary()); } *************** *** 575,579 **** Rectangle r = new Rectangle(point, d); ! //System.out.println("fill rect" + r); g.setColor(rowBackgrounds[i]); --- 575,579 ---- Rectangle r = new Rectangle(point, d); ! ////System.out.println("fill rect" + r); g.setColor(rowBackgrounds[i]); *************** *** 953,957 **** date = ((Task) objects[i]).getEndDate(); ! System.out.println(date + " " + today + " " + cutDate); if (date != null --- 953,957 ---- date = ((Task) objects[i]).getEndDate(); ! //System.out.println(date + " " + today + " " + cutDate); if (date != null *************** *** 959,963 **** && date.before(cutDate)) { ! System.out.println("date is between "); temp.add(objects[i]); --- 959,963 ---- && date.before(cutDate)) { ! //System.out.println("date is between "); temp.add(objects[i]); *************** *** 979,983 **** public void setWithin(int period) { ! System.out.println("setperiod " + period); this.period = period; --- 979,983 ---- public void setWithin(int period) { ! //System.out.println("setperiod " + period); this.period = period; Index: TaskViewer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/task/TaskViewer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TaskViewer.java 3 Apr 2004 07:56:44 -0000 1.1 --- TaskViewer.java 20 Mar 2005 20:36:45 -0000 1.2 *************** *** 224,228 **** ownerField = new JTextField(14); ! System.out.println(task.getDescription().getAuthor()); ownerField.setText(task.getDescription().getAuthor().getAlias()); --- 224,228 ---- ownerField = new JTextField(14); ! //System.out.println(task.getDescription().getAuthor()); ownerField.setText(task.getDescription().getAuthor().getAlias()); *************** *** 932,936 **** public void actionPerformed(ActionEvent e) { ! System.out.println("new task action called"); Task t = tasklist.createTask(); --- 932,936 ---- public void actionPerformed(ActionEvent e) { ! //System.out.println("new task action called"); Task t = tasklist.createTask(); *************** *** 979,983 **** } ! System.out.println("show task id = " + id); Task[] tasks = tasklist.getTasks(); --- 979,983 ---- } ! //System.out.println("show task id = " + id); Task[] tasks = tasklist.getTasks(); *************** *** 991,996 **** if (ptask.getID() == id) { ! System.out.println( ! "found task with id" + ptask.getID()); showTask(ptask); --- 991,996 ---- if (ptask.getID() == id) { ! //System.out.println( ! // "found task with id" + ptask.getID()); showTask(ptask); |
From: Stig T. <jw...@us...> - 2005-03-20 20:37:01
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/dbsettings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/dbsettings Modified Files: DBSettingsUI.java Log Message: Index: DBSettingsUI.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/dbsettings/DBSettingsUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DBSettingsUI.java 3 Apr 2004 07:56:54 -0000 1.1 --- DBSettingsUI.java 20 Mar 2005 20:36:50 -0000 1.2 *************** *** 72,76 **** public DBSettingsUI(File settingsFile) { ! //System.out.println(homeDir); this.settings = new DBSettings(); --- 72,76 ---- public DBSettingsUI(File settingsFile) { ! ////System.out.println(homeDir); this.settings = new DBSettings(); *************** *** 301,305 **** chooseFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ! System.out.println("\"" + textField.getText() + "\""); if (!textField.getText().equals("") || textField.getText() == null) { --- 301,305 ---- chooseFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ! //System.out.println("\"" + textField.getText() + "\""); if (!textField.getText().equals("") || textField.getText() == null) { *************** *** 393,397 **** chooseFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ! System.out.println("\"" + textField.getText() + "\""); if (!textField.getText().equals("") || textField.getText() == null) { --- 393,397 ---- chooseFile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ! //System.out.println("\"" + textField.getText() + "\""); if (!textField.getText().equals("") || textField.getText() == null) { |
From: Stig T. <jw...@us...> - 2005-03-20 20:37:01
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/yellow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/yellow Modified Files: YellowMenuItemUI.java YellowComboBoxUI.java Log Message: Index: YellowMenuItemUI.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/yellow/YellowMenuItemUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** YellowMenuItemUI.java 3 Apr 2004 07:56:51 -0000 1.1 --- YellowMenuItemUI.java 20 Mar 2005 20:36:50 -0000 1.2 *************** *** 66,70 **** g.fillRect(0,0, menuWidth, menuHeight); if(selectionBorder != null) { ! System.out.println("selectionborder != null"); selectionBorder.paintBorder(menuItem, g, 0,0,menuWidth,menuHeight); } --- 66,70 ---- g.fillRect(0,0, menuWidth, menuHeight); if(selectionBorder != null) { ! //System.out.println("selectionborder != null"); selectionBorder.paintBorder(menuItem, g, 0,0,menuWidth,menuHeight); } *************** *** 77,81 **** if(isSelected && selectionBorder != null) { ! //System.out.println("selectionborder != null"); selectionBorder.paintBorder(menuItem, g, 0,0,menuWidth,menuHeight); } --- 77,81 ---- if(isSelected && selectionBorder != null) { ! ////System.out.println("selectionborder != null"); selectionBorder.paintBorder(menuItem, g, 0,0,menuWidth,menuHeight); } *************** *** 95,99 **** g.fillRect(0,0, menuWidth, menuHeight); if(selectionBorder != null) { ! //System.out.println("selectionborder != null"); selectionBorder.paintBorder(menuItem, g, 0,0,menuWidth,menuHeight); } --- 95,99 ---- g.fillRect(0,0, menuWidth, menuHeight); if(selectionBorder != null) { ! ////System.out.println("selectionborder != null"); selectionBorder.paintBorder(menuItem, g, 0,0,menuWidth,menuHeight); } Index: YellowComboBoxUI.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/yellow/YellowComboBoxUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** YellowComboBoxUI.java 3 Apr 2004 07:56:51 -0000 1.1 --- YellowComboBoxUI.java 20 Mar 2005 20:36:50 -0000 1.2 *************** *** 63,67 **** public void installUI(JComponent c) { ! System.out.println("install ui combobox"); c.setBorder(new BevelBorder(BevelBorder.LOWERED)); --- 63,67 ---- public void installUI(JComponent c) { ! //System.out.println("install ui combobox"); c.setBorder(new BevelBorder(BevelBorder.LOWERED)); |
From: Stig T. <jw...@us...> - 2005-03-20 20:36:59
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/sample Modified Files: SampleMenuHandler.java SampleGui.java Log Message: Index: SampleMenuHandler.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/sample/SampleMenuHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SampleMenuHandler.java 3 Apr 2004 07:56:54 -0000 1.1 --- SampleMenuHandler.java 20 Mar 2005 20:36:49 -0000 1.2 *************** *** 68,72 **** try { ! System.out.println(value); if(value.equals("true")) isFrameMenu = true; --- 68,72 ---- try { ! //System.out.println(value); if(value.equals("true")) isFrameMenu = true; *************** *** 108,112 **** for(int i = 0; i < c.length; i++) { ! System.out.println(c[i]); try { --- 108,112 ---- for(int i = 0; i < c.length; i++) { ! //System.out.println(c[i]); try { *************** *** 116,120 **** for(int j = 0; j < cc.length; j++) { ! System.out.println(cc[i]); } --- 116,120 ---- for(int j = 0; j < cc.length; j++) { ! //System.out.println(cc[i]); } Index: SampleGui.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/sample/SampleGui.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SampleGui.java 3 Apr 2004 07:56:54 -0000 1.1 --- SampleGui.java 20 Mar 2005 20:36:50 -0000 1.2 *************** *** 415,419 **** } ! //System.out.println(divider1 + " " + divider2); stream.close(); --- 415,419 ---- } ! ////System.out.println(divider1 + " " + divider2); stream.close(); *************** *** 485,489 **** public void requestView(int type, JComponent c) { ! System.out.println("request view view "); if (type == DefaultGui.TOOLBAR_VIEW) { --- 485,489 ---- public void requestView(int type, JComponent c) { ! //System.out.println("request view view "); if (type == DefaultGui.TOOLBAR_VIEW) { *************** *** 516,520 **** if (type == DefaultGui.TREE_VIEW) { ! //System.out.println("request view treeview" + c); int index = treeview.indexOfComponent(c); --- 516,520 ---- if (type == DefaultGui.TREE_VIEW) { ! ////System.out.println("request view treeview" + c); int index = treeview.indexOfComponent(c); |
From: Stig T. <jw...@us...> - 2005-03-20 20:36:59
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/options In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/mail/options Modified Files: AdvancedInformationPanel.java ServerInformationPanel.java Log Message: Index: AdvancedInformationPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/options/AdvancedInformationPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AdvancedInformationPanel.java 3 Apr 2004 07:56:53 -0000 1.1 --- AdvancedInformationPanel.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 203,207 **** //JCheckBox usesslCheckbox; ! System.out.println("calling advanced apply"); try { --- 203,207 ---- //JCheckBox usesslCheckbox; ! //System.out.println("calling advanced apply"); try { Index: ServerInformationPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/options/ServerInformationPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerInformationPanel.java 3 Apr 2004 07:56:53 -0000 1.1 --- ServerInformationPanel.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 197,201 **** usernameout = dialog.getUsername(); ! //System.out.println("dialog get username = " + dialog.getUsername()); passwordout = dialog.getPassword(); --- 197,201 ---- usernameout = dialog.getUsername(); ! ////System.out.println("dialog get username = " + dialog.getUsername()); passwordout = dialog.getPassword(); *************** *** 255,259 **** maccount.setUserName(usernamefield.getText()); ! System.out.println(new String(passwordfield.getPassword())); if (rememberPassword.isSelected()) { --- 255,259 ---- maccount.setUserName(usernamefield.getText()); ! //System.out.println(new String(passwordfield.getPassword())); if (rememberPassword.isSelected()) { *************** *** 282,290 **** ! System.out.println("setting smtp server settings"); if (maccount.getSmtpAccount() == null) { ! System.out.println("set new smtp"); SmtpAccount smtp = --- 282,290 ---- ! //System.out.println("setting smtp server settings"); if (maccount.getSmtpAccount() == null) { ! //System.out.println("set new smtp"); SmtpAccount smtp = *************** *** 305,309 **** } else { ! System.out.println("changing old smtp account"); SmtpAccount smtp = maccount.getSmtpAccount(); --- 305,309 ---- } else { ! //System.out.println("changing old smtp account"); SmtpAccount smtp = maccount.getSmtpAccount(); *************** *** 321,325 **** if (usernameout != null) { ! System.out.println("set username smtp " + usernameout); smtp.setUserName(usernameout); --- 321,325 ---- if (usernameout != null) { ! //System.out.println("set username smtp " + usernameout); smtp.setUserName(usernameout); *************** *** 327,336 **** } else { ! System.out.println("usernameout == null"); } if (passwordout != null) { ! System.out.println("set password smtp " + usernameout); smtp.setPassword(passwordout); --- 327,336 ---- } else { ! //System.out.println("usernameout == null"); } if (passwordout != null) { ! //System.out.println("set password smtp " + usernameout); smtp.setPassword(passwordout); |
From: Stig T. <jw...@us...> - 2005-03-20 20:36:58
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/wizard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/wizard Modified Files: ChooseDirectoryDialog.java NewUserWizard.java Log Message: Index: ChooseDirectoryDialog.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/wizard/ChooseDirectoryDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChooseDirectoryDialog.java 3 Apr 2004 07:56:45 -0000 1.1 --- ChooseDirectoryDialog.java 20 Mar 2005 20:36:49 -0000 1.2 *************** *** 218,222 **** if (e.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) { ! System.out.println("choose file"); File file = l.chooser.getSelectedFile(); --- 218,222 ---- if (e.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) { ! //System.out.println("choose file"); File file = l.chooser.getSelectedFile(); Index: NewUserWizard.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/wizard/NewUserWizard.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NewUserWizard.java 3 Apr 2004 07:56:45 -0000 1.1 --- NewUserWizard.java 20 Mar 2005 20:36:49 -0000 1.2 *************** *** 409,413 **** } else if (e.getActionCommand() == "Finish") { ! System.out.println("finish pressed"); if(finishListener != null) --- 409,413 ---- } else if (e.getActionCommand() == "Finish") { ! //System.out.println("finish pressed"); if(finishListener != null) |
From: Stig T. <jw...@us...> - 2005-03-20 20:36:58
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/event Modified Files: SaveAction.java Log Message: Index: SaveAction.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/event/SaveAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SaveAction.java 3 Apr 2004 07:56:45 -0000 1.1 --- SaveAction.java 20 Mar 2005 20:36:49 -0000 1.2 *************** *** 104,108 **** /* * public void keyTyped(KeyEvent e) { ! * System.out.println("keypressed"); * if(e.getKeyCode() == KeyEvent.VK_PLUS) { * zoom(10); --- 104,108 ---- /* * public void keyTyped(KeyEvent e) { ! * //System.out.println("keypressed"); * if(e.getKeyCode() == KeyEvent.VK_PLUS) { * zoom(10); |
From: Stig T. <jw...@us...> - 2005-03-20 20:36:57
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/calendar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/calendar Modified Files: CalendarTableModel.java DayView.java DayTableModel.java Log Message: Index: DayView.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/calendar/DayView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DayView.java 3 Apr 2004 07:56:54 -0000 1.1 --- DayView.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 325,329 **** Event[] events = model.getEntries(); ! //System.out.println("events " + events.length); boolean exists = false; --- 325,329 ---- Event[] events = model.getEntries(); ! ////System.out.println("events " + events.length); boolean exists = false; *************** *** 359,363 **** ids[i] = events[i].getID(); ! //System.out.println("events " + events.length); model.setEntries(events); } else { --- 359,363 ---- ids[i] = events[i].getID(); ! ////System.out.println("events " + events.length); model.setEntries(events); } else { *************** *** 461,465 **** column); ! //System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); if (value != null) --- 461,465 ---- column); ! ////System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); if (value != null) *************** *** 469,473 **** this.value = ""; ! System.out.println(this.value); textField.setText(this.value); --- 469,473 ---- this.value = ""; ! //System.out.println(this.value); textField.setText(this.value); *************** *** 476,480 **** public Object getCellEditorValue() { ! //System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); return textField.getText(); //value; } --- 476,480 ---- public Object getCellEditorValue() { ! ////System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); return textField.getText(); //value; } *************** *** 489,500 **** /*public boolean shouldSelectCell(EventObject anEvent) { ! //System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); return true; } public boolean stopCellEditing() { ! //System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); ! System.out.println("cellediting stopped " + textField.getText()); return true; --- 489,500 ---- /*public boolean shouldSelectCell(EventObject anEvent) { ! ////System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); return true; } public boolean stopCellEditing() { ! ////System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); ! //System.out.println("cellediting stopped " + textField.getText()); return true; *************** *** 503,507 **** /*public void cancelCellEditing() { ! //System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); }*/ --- 503,507 ---- /*public void cancelCellEditing() { ! ////System.out.println("l�kjadf�alfhjkkldjafkdjafk�lkadjflk�adhfjk�alfj"); }*/ Index: CalendarTableModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/calendar/CalendarTableModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CalendarTableModel.java 3 Apr 2004 07:56:54 -0000 1.1 --- CalendarTableModel.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 47,51 **** firstdayinmonth = calendar.get(Calendar.DAY_OF_WEEK); ! //System.out.println("maxdays " + maxdays + " firstdayinmonth " + firstdayinmonth); } --- 47,51 ---- firstdayinmonth = calendar.get(Calendar.DAY_OF_WEEK); ! ////System.out.println("maxdays " + maxdays + " firstdayinmonth " + firstdayinmonth); } *************** *** 127,131 **** public String getColumnName(int column) { ! System.out.println("column calendar " + column); DateFormatSymbols engformat = new DateFormatSymbols(Locale.getDefault()); --- 127,131 ---- public String getColumnName(int column) { ! //System.out.println("column calendar " + column); DateFormatSymbols engformat = new DateFormatSymbols(Locale.getDefault()); *************** *** 164,176 **** public void setMonth(int month) { ! System.out.println("model setmonth" + month); calendar.set(Calendar.MONTH, month); ! System.out.println("model setmonth " + calendar.get(Calendar.YEAR)); maxdays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); ! System.out.println("actual maximum " + maxdays); //adjustment because of strange behaivour - setting day to 0 and month to 0 changes year!? --- 164,176 ---- public void setMonth(int month) { ! //System.out.println("model setmonth" + month); calendar.set(Calendar.MONTH, month); ! //System.out.println("model setmonth " + calendar.get(Calendar.YEAR)); maxdays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); ! //System.out.println("actual maximum " + maxdays); //adjustment because of strange behaivour - setting day to 0 and month to 0 changes year!? Index: DayTableModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/calendar/DayTableModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DayTableModel.java 3 Apr 2004 07:56:54 -0000 1.1 --- DayTableModel.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 150,154 **** */ public void setValueAt(Object aValue, int row, int column) { ! System.out.println("set value at" + aValue); /*if (column == 0) { return; --- 150,154 ---- */ public void setValueAt(Object aValue, int row, int column) { ! //System.out.println("set value at" + aValue); /*if (column == 0) { return; *************** *** 200,204 **** for(int i = 0; i < ev.length; i++) { ! System.out.println(ev[i].getSubject()); if(ev[i].getHour() > 8 && ev[i].getHour() < 20) --- 200,204 ---- for(int i = 0; i < ev.length; i++) { ! //System.out.println(ev[i].getSubject()); if(ev[i].getHour() > 8 && ev[i].getHour() < 20) |
From: Stig T. <jw...@us...> - 2005-03-20 20:36:57
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/search In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791/net/sf/mailsomething/gui/search Modified Files: GoogleStyleMatchHandler.java FonyResourceManager.java SearchPanel.java Log Message: Index: FonyResourceManager.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/search/FonyResourceManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FonyResourceManager.java 3 Apr 2004 07:56:54 -0000 1.1 --- FonyResourceManager.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 40,44 **** public Action getAction(Object key) { ! System.out.println("getaction, listcount = " + list.getResultCount()); return new OpenAction(list); --- 40,44 ---- public Action getAction(Object key) { ! //System.out.println("getaction, listcount = " + list.getResultCount()); return new OpenAction(list); Index: SearchPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/search/SearchPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SearchPanel.java 12 Mar 2005 15:30:51 -0000 1.2 --- SearchPanel.java 20 Mar 2005 20:36:48 -0000 1.3 *************** *** 474,478 **** descrip = descrip.replaceAll("\n", " "); ! //System.out.println("insert index = " + index); if (index == 54) { --- 474,478 ---- descrip = descrip.replaceAll("\n", " "); ! ////System.out.println("insert index = " + index); if (index == 54) { *************** *** 568,580 **** public void actionPerformed(ActionEvent e) { ! System.out.println("search again"); if (!search.isRunning()) { ! System.out.println("search again clear results"); clearResults(); ! System.out.println(field.getText()); SearchDefinition searchobject = --- 568,580 ---- public void actionPerformed(ActionEvent e) { ! //System.out.println("search again"); if (!search.isRunning()) { ! //System.out.println("search again clear results"); clearResults(); ! //System.out.println(field.getText()); SearchDefinition searchobject = *************** *** 617,621 **** public Action getAction(Object key) { ! System.out.println( "getaction, listcount = " + list.getResultCount()); --- 617,621 ---- public Action getAction(Object key) { ! //System.out.println( "getaction, listcount = " + list.getResultCount()); Index: GoogleStyleMatchHandler.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/search/GoogleStyleMatchHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GoogleStyleMatchHandler.java 12 Mar 2005 15:30:51 -0000 1.1 --- GoogleStyleMatchHandler.java 20 Mar 2005 20:36:48 -0000 1.2 *************** *** 275,279 **** descrip = descrip.replaceAll("\n", " "); ! //System.out.println("insert index = " + index); if (index == 54) { --- 275,279 ---- descrip = descrip.replaceAll("\n", " "); ! ////System.out.println("insert index = " + index); if (index == 54) { *************** *** 369,381 **** public void actionPerformed(ActionEvent e) { ! System.out.println("search again"); if (!search.isRunning()) { ! System.out.println("search again clear results"); clearResults(); ! System.out.println(field.getText()); SearchDefinition searchobject = --- 369,381 ---- public void actionPerformed(ActionEvent e) { ! //System.out.println("search again"); if (!search.isRunning()) { ! //System.out.println("search again clear results"); clearResults(); ! //System.out.println(field.getText()); SearchDefinition searchobject = |
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30967/net/sf/mailsomething/gui Modified Files: WrappedEditorPane.java StatusPanel.java InternalJPanel.java TransparentMenu.java CustomSplitPane.java TableSorter.java FileExplorer.java WrappedEditor.java FileSystemModel.java SimpleInterfaceImpl.java GuiUser.java TreeModelSupport.java BasicHyperlinkListener.java StatusBar.java NotePad.java GuiToolbar.java OverviewPanel.java InternalJScrollPane.java EnviromentPanel.java FontHandler.java Log Message: Index: TableSorter.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/TableSorter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TableSorter.java 3 Apr 2004 07:56:47 -0000 1.1 --- TableSorter.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 122,126 **** } else if (type == java.util.Date.class) { ! //System.out.println("Sort by date from column: " + column); Date d1 = (Date) data.getValueAt(row1, column); --- 122,126 ---- } else if (type == java.util.Date.class) { ! ////System.out.println("Sort by date from column: " + column); Date d1 = (Date) data.getValueAt(row1, column); *************** *** 222,226 **** protected synchronized void reallocateIndexesRemoved(int removed) { ! /*System.out.println("reallocateindexesremoved " + removed); for (int i = 0; i < indexes.length; i++) { --- 222,226 ---- protected synchronized void reallocateIndexesRemoved(int removed) { ! /*//System.out.println("reallocateindexesremoved " + removed); for (int i = 0; i < indexes.length; i++) { *************** *** 249,257 **** indexes[i] = allocated[i]; ! //System.out.println("reallocateindexesremoved2"); ! //System.out.println("reallocateindexesremoved3"); //expanded = false; --- 249,257 ---- indexes[i] = allocated[i]; ! ////System.out.println("reallocateindexesremoved2"); ! ////System.out.println("reallocateindexesremoved3"); //expanded = false; *************** *** 265,269 **** protected void reallocateIndexesRemoveTS(int from, int to) { ! //System.out.println("indexes set"); indexes = new int[collapsed.length]; --- 265,269 ---- protected void reallocateIndexesRemoveTS(int from, int to) { ! ////System.out.println("indexes set"); indexes = new int[collapsed.length]; *************** *** 280,286 **** int rowCount = model.getRowCount(); ! System.out.println("from = " + from); ! System.out.println("to = " + to); ! System.out.println("rowcount = " + rowCount); if (!expanded) { --- 280,286 ---- int rowCount = model.getRowCount(); ! //System.out.println("from = " + from); ! //System.out.println("to = " + to); ! //System.out.println("rowcount = " + rowCount); if (!expanded) { *************** *** 346,350 **** ! //System.out.println("Sorter: tableChanged"); if (isTreeStyle) { --- 346,350 ---- ! ////System.out.println("Sorter: tableChanged"); if (isTreeStyle) { *************** *** 364,368 **** if (e.getType() == TableModelEvent.DELETE) { ! System.out.println("type == delete"); fireTableRowsDeleted(e.getFirstRow(), e.getLastRow()); --- 364,368 ---- if (e.getType() == TableModelEvent.DELETE) { ! //System.out.println("type == delete"); fireTableRowsDeleted(e.getFirstRow(), e.getLastRow()); *************** *** 430,434 **** // qsort(0, indexes.length-1); shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length); ! //System.out.println("Compares: "+compares); } --- 430,434 ---- // qsort(0, indexes.length-1); shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length); ! ////System.out.println("Compares: "+compares); } *************** *** 532,536 **** public int getIndexAt(int aRow) { ! //System.out.println("indexes called"); if(aRow >= indexes.length) --- 532,536 ---- public int getIndexAt(int aRow) { ! ////System.out.println("indexes called"); if(aRow >= indexes.length) *************** *** 571,575 **** int column = tableView.convertColumnIndexToModel(viewColumn); if (e.getClickCount() == 1 && column != -1) { ! //System.out.println("Sorting ..."); int shiftPressed = e.getModifiers() & InputEvent.SHIFT_MASK; boolean ascending = (shiftPressed == 0); --- 571,575 ---- int column = tableView.convertColumnIndexToModel(viewColumn); if (e.getClickCount() == 1 && column != -1) { ! ////System.out.println("Sorting ..."); int shiftPressed = e.getModifiers() & InputEvent.SHIFT_MASK; boolean ascending = (shiftPressed == 0); Index: StatusBar.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/StatusBar.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusBar.java 3 Apr 2004 07:56:47 -0000 1.1 --- StatusBar.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 96,100 **** public void workStarted(int length) { ! System.out.println("Progressbar workstarted" + length); setMaximum(length); --- 96,100 ---- public void workStarted(int length) { ! //System.out.println("Progressbar workstarted" + length); setMaximum(length); Index: FileSystemModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/FileSystemModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemModel.java 3 Apr 2004 07:56:46 -0000 1.1 --- FileSystemModel.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 189,193 **** public SimpleDirectoryNode addSimpleDirectoryNode(File file) { ! System.out.println(file.getPath()); SimpleDirectoryNode node = new SimpleDirectoryNode(file); --- 189,193 ---- public SimpleDirectoryNode addSimpleDirectoryNode(File file) { ! //System.out.println(file.getPath()); SimpleDirectoryNode node = new SimpleDirectoryNode(file); Index: InternalJPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/InternalJPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InternalJPanel.java 3 Apr 2004 07:56:47 -0000 1.1 --- InternalJPanel.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 118,122 **** public void mouseMoved(MouseEvent e) { ! //System.out.println("mousemoved"); Point p = e.getPoint(); --- 118,122 ---- public void mouseMoved(MouseEvent e) { ! ////System.out.println("mousemoved"); Point p = e.getPoint(); *************** *** 135,139 **** if (closeRect.contains(p)) { if (closeButtonVisible == false) { ! //System.out.println("closebutton was invisible"); closeButtonVisible = true; if (closeRect != null) --- 135,139 ---- if (closeRect.contains(p)) { if (closeButtonVisible == false) { ! ////System.out.println("closebutton was invisible"); closeButtonVisible = true; if (closeRect != null) *************** *** 160,164 **** if (printRect.contains(p)) { if (!printButtonVisible) { ! //System.out.println("closebutton was invisible"); printButtonVisible = true; if (printRect != null) --- 160,164 ---- if (printRect.contains(p)) { if (!printButtonVisible) { ! ////System.out.println("closebutton was invisible"); printButtonVisible = true; if (printRect != null) *************** *** 355,359 **** public void dispatchListeners(Component c) { ! //System.out.println("dispatchlisteners internal panel" + c); c.addMouseMotionListener(this); --- 355,359 ---- public void dispatchListeners(Component c) { ! ////System.out.println("dispatchlisteners internal panel" + c); c.addMouseMotionListener(this); *************** *** 484,492 **** gg.scale(0.7,0.7); ! System.out.println(g.getClipBounds()); ! System.out.println(pf.getWidth() + " " +pf.getHeight()); ! System.out.println("paper width" + pf.getPaper().getWidth());*/ --- 484,492 ---- gg.scale(0.7,0.7); ! //System.out.println(g.getClipBounds()); ! //System.out.println(pf.getWidth() + " " +pf.getHeight()); ! //System.out.println("paper width" + pf.getPaper().getWidth());*/ Index: GuiUser.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/GuiUser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GuiUser.java 3 Apr 2004 07:56:47 -0000 1.1 --- GuiUser.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 289,293 **** public void windowLostFocus(WindowEvent e) { ! System.out.println(e.getNewState()); iframe.hide(); --- 289,293 ---- public void windowLostFocus(WindowEvent e) { ! //System.out.println(e.getNewState()); iframe.hide(); *************** *** 315,319 **** public void windowLostFocus(WindowEvent e) { ! //System.out.println(e.getNewState()); iframe.hide(); --- 315,319 ---- public void windowLostFocus(WindowEvent e) { ! ////System.out.println(e.getNewState()); iframe.hide(); Index: OverviewPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/OverviewPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OverviewPanel.java 3 Apr 2004 07:56:47 -0000 1.1 --- OverviewPanel.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 438,442 **** isEntered = true; isExited = false; ! //System.out.println("mouseentered"); } --- 438,442 ---- isEntered = true; isExited = false; ! ////System.out.println("mouseentered"); } *************** *** 446,450 **** isEntered = false; isExited = true; ! //System.out.println("mouseexited"); } --- 446,450 ---- isEntered = false; isExited = true; ! ////System.out.println("mouseexited"); } Index: WrappedEditorPane.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/WrappedEditorPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WrappedEditorPane.java 3 Apr 2004 07:56:46 -0000 1.1 --- WrappedEditorPane.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 96,100 **** Mailsomething.getUser().getIntegerProperty("Viewer.bodywidth"); ! //System.out.println("wrappededitorpane bodywith = " + bodywidth); if (bodywidth == -1) --- 96,100 ---- Mailsomething.getUser().getIntegerProperty("Viewer.bodywidth"); ! ////System.out.println("wrappededitorpane bodywith = " + bodywidth); if (bodywidth == -1) *************** *** 121,125 **** bodywidth = 150; ! //System.out.println("wrappededitorpane bodywith = " + bodywidth); //leftmargin = Mailsomething.getUser().getIntegerProperty("Editor.leftmargin"); --- 121,125 ---- bodywidth = 150; ! ////System.out.println("wrappededitorpane bodywith = " + bodywidth); //leftmargin = Mailsomething.getUser().getIntegerProperty("Editor.leftmargin"); *************** *** 161,165 **** if(scrollpane != null) { ! System.out.println("horizontal never"); scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); } --- 161,165 ---- if(scrollpane != null) { ! //System.out.println("horizontal never"); scrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); } *************** *** 223,227 **** if (p != null) { ! //System.out.println("vertical scrollbar " + p.getWidth()); con.width -= p.getWidth(); --- 223,227 ---- if (p != null) { ! ////System.out.println("vertical scrollbar " + p.getWidth()); con.width -= p.getWidth(); *************** *** 263,267 **** if (p != null) { ! //System.out.println("vertical scrollbar " + p.getWidth()); bodywidth -= p.getWidth(); } --- 263,267 ---- if (p != null) { ! ////System.out.println("vertical scrollbar " + p.getWidth()); bodywidth -= p.getWidth(); } *************** *** 285,289 **** if (p != null) { ! //System.out.println("vertical scrollbar " + p.getWidth()); con.width -= p.getWidth(); } --- 285,289 ---- if (p != null) { ! ////System.out.println("vertical scrollbar " + p.getWidth()); con.width -= p.getWidth(); } *************** *** 295,299 **** //testcounter++; ! //System.out.println("wrappededitorpane resizing"); super.setPreferredSize(null); //con.width --- 295,299 ---- //testcounter++; ! ////System.out.println("wrappededitorpane resizing"); super.setPreferredSize(null); //con.width *************** *** 378,382 **** public void actionPerformed(ActionEvent e) { ! System.out.println("actionperformed"); } --- 378,382 ---- public void actionPerformed(ActionEvent e) { ! //System.out.println("actionperformed"); } *************** *** 446,450 **** }*/ ! //System.out.println("printmarginline"); } else if (showMargenLine) { --- 446,450 ---- }*/ ! ////System.out.println("printmarginline"); } else if (showMargenLine) { Index: InternalJScrollPane.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/InternalJScrollPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InternalJScrollPane.java 3 Apr 2004 07:56:46 -0000 1.1 --- InternalJScrollPane.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 166,170 **** public void mouseMoved(MouseEvent e) { ! ////System.out.println("mousemoved - scroll"); Point p = e.getPoint(); --- 166,170 ---- public void mouseMoved(MouseEvent e) { ! //////System.out.println("mousemoved - scroll"); Point p = e.getPoint(); *************** *** 209,213 **** if (printRect.contains(p)) { if (!printButtonVisible) { ! //System.out.println("closebutton was invisible"); printButtonVisible = true; if (printRect != null) --- 209,213 ---- if (printRect.contains(p)) { if (!printButtonVisible) { ! ////System.out.println("closebutton was invisible"); printButtonVisible = true; if (printRect != null) *************** *** 335,339 **** lastEvent = e; ! //System.out.println("internaljscrollpane mousepressed"); Point p = e.getPoint(); --- 335,339 ---- lastEvent = e; ! ////System.out.println("internaljscrollpane mousepressed"); Point p = e.getPoint(); *************** *** 497,501 **** public void dispatchListeners(Component c) { ! ////System.out.println("dispatchlisteners internal jscrollpane"); c.addMouseMotionListener(this); --- 497,501 ---- public void dispatchListeners(Component c) { ! //////System.out.println("dispatchlisteners internal jscrollpane"); c.addMouseMotionListener(this); *************** *** 587,591 **** protected void processMouseMotionEvent(MouseEvent e) { ! System.out.println("processmousemotionevent"); //e.consume(); --- 587,591 ---- protected void processMouseMotionEvent(MouseEvent e) { ! //System.out.println("processmousemotionevent"); //e.consume(); *************** *** 630,634 **** pf.setOrientation(PageFormat.PORTRAIT); ! /*System.out.println("imageablex" + pf.getPaper().getImageableX()); pf.getPaper().setImageableArea( --- 630,634 ---- pf.setOrientation(PageFormat.PORTRAIT); ! /*//System.out.println("imageablex" + pf.getPaper().getImageableX()); pf.getPaper().setImageableArea( Index: FileExplorer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/FileExplorer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileExplorer.java 3 Apr 2004 07:56:47 -0000 1.1 --- FileExplorer.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 759,763 **** TreePath[] paths = getSelectionPaths(); ! System.out.println("paths selected + " + paths.length); --- 759,763 ---- TreePath[] paths = getSelectionPaths(); ! //System.out.println("paths selected + " + paths.length); Index: GuiToolbar.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/GuiToolbar.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GuiToolbar.java 3 Apr 2004 07:56:47 -0000 1.1 --- GuiToolbar.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 163,167 **** PixelGrabber grab = new PixelGrabber(image.getImage(), 0, 0, 1, image.getIconHeight(), pixels, 0, 1); //PixelGrabber grab = new PixelGrabber(image.getImage(), 0, image.getIconHeight() - d.height, 1, d.height, pixels, 0, 1); ! //System.out.println("" + menu.getBounds() + composeMail.getBounds()); --- 163,167 ---- PixelGrabber grab = new PixelGrabber(image.getImage(), 0, 0, 1, image.getIconHeight(), pixels, 0, 1); //PixelGrabber grab = new PixelGrabber(image.getImage(), 0, image.getIconHeight() - d.height, 1, d.height, pixels, 0, 1); ! ////System.out.println("" + menu.getBounds() + composeMail.getBounds()); *************** *** 173,177 **** //for(int j = 0; j < pixels.length; j++) ! //System.out.println("pixel nr " + j + " " + pixels[j]); for (int j = 0; j < buttons.size(); j++) { --- 173,177 ---- //for(int j = 0; j < pixels.length; j++) ! ////System.out.println("pixel nr " + j + " " + pixels[j]); for (int j = 0; j < buttons.size(); j++) { *************** *** 203,207 **** //if(image != null) { ! //System.out.println("setimage image er ikke null"); tracker = new MediaTracker(this); --- 203,207 ---- //if(image != null) { ! ////System.out.println("setimage image er ikke null"); tracker = new MediaTracker(this); Index: NotePad.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/NotePad.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NotePad.java 3 Apr 2004 07:56:47 -0000 1.1 --- NotePad.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 272,276 **** } catch (UnsupportedLookAndFeelException f) { ! System.out.println("unsupported look and feel"); } --- 272,276 ---- } catch (UnsupportedLookAndFeelException f) { ! //System.out.println("unsupported look and feel"); } Index: CustomSplitPane.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/CustomSplitPane.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CustomSplitPane.java 3 Apr 2004 07:56:47 -0000 1.1 --- CustomSplitPane.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 674,678 **** } else { ! System.out.println("customsplitpane is visible"); } --- 674,678 ---- } else { ! //System.out.println("customsplitpane is visible"); } Index: SimpleInterfaceImpl.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/SimpleInterfaceImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleInterfaceImpl.java 3 Apr 2004 07:56:46 -0000 1.1 --- SimpleInterfaceImpl.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 33,37 **** } ! System.out.println("source is NOT mailservice"); --- 33,37 ---- } ! //System.out.println("source is NOT mailservice"); Index: TreeModelSupport.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/TreeModelSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeModelSupport.java 3 Apr 2004 07:56:47 -0000 1.1 --- TreeModelSupport.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 66,70 **** TreeModelListener listener = (TreeModelListener) listeners.nextElement(); listener.treeNodesInserted(e); ! //System.out.println("treenodesinserted"); } } --- 66,70 ---- TreeModelListener listener = (TreeModelListener) listeners.nextElement(); listener.treeNodesInserted(e); ! ////System.out.println("treenodesinserted"); } } *************** *** 95,99 **** TreeModelListener listener = (TreeModelListener) listeners.nextElement(); listener.treeStructureChanged(e); ! //System.out.println("treestructurechanged"); } } --- 95,99 ---- TreeModelListener listener = (TreeModelListener) listeners.nextElement(); listener.treeStructureChanged(e); ! ////System.out.println("treestructurechanged"); } } Index: TransparentMenu.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/TransparentMenu.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TransparentMenu.java 3 Apr 2004 07:56:47 -0000 1.1 --- TransparentMenu.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 215,219 **** line.setMenuLabel( (String) line.getAction().getValue(AbstractAction.NAME)); ! //System.out.println("action nr " + i); menuLines.add(line); --- 215,219 ---- line.setMenuLabel( (String) line.getAction().getValue(AbstractAction.NAME)); ! ////System.out.println("action nr " + i); menuLines.add(line); *************** *** 297,301 **** public void addToComponent(Component c) { ! //System.out.println("transp menu add "); c.addMouseListener(new PopupListener()); --- 297,301 ---- public void addToComponent(Component c) { ! ////System.out.println("transp menu add "); c.addMouseListener(new PopupListener()); *************** *** 398,402 **** public void paint(Graphics g) { ! //System.out.println("transparent menu painting"); isPainting = true; --- 398,402 ---- public void paint(Graphics g) { ! ////System.out.println("transparent menu painting"); isPainting = true; *************** *** 551,555 **** public void mouseReleased(MouseEvent e) { ! System.out.println("transparent menu mousereleased"); if (!isPopping) { --- 551,555 ---- public void mouseReleased(MouseEvent e) { ! //System.out.println("transparent menu mousereleased"); if (!isPopping) { *************** *** 568,572 **** if (e.isPopupTrigger()) { ! System.out.println("ispopuptrigger"); if (source != null) { --- 568,572 ---- if (e.isPopupTrigger()) { ! //System.out.println("ispopuptrigger"); if (source != null) { *************** *** 582,586 **** if (actionMap != null) { ! System.out.println("actionmap != null"); Object[] keys = actionMap.keys(); --- 582,586 ---- if (actionMap != null) { ! //System.out.println("actionmap != null"); Object[] keys = actionMap.keys(); *************** *** 642,646 **** new Rectangle(p.x, p.y, menuWidth, menuHeight); ! System.out.println("" + rect1); if (painter.isVisible(rect1, (JComponent) e.getSource())) { --- 642,646 ---- new Rectangle(p.x, p.y, menuWidth, menuHeight); ! //System.out.println("" + rect1); if (painter.isVisible(rect1, (JComponent) e.getSource())) { *************** *** 825,829 **** * */ ! System.out.println("mouseclicked transparent menu" + e.getPoint()); Point p = e.getPoint(); --- 825,829 ---- * */ ! //System.out.println("mouseclicked transparent menu" + e.getPoint()); Point p = e.getPoint(); *************** *** 849,854 **** loop : for (int i = 0; i < menuLines.size() + 1; i++) { ! System.out.println( ! p.y + " " + (i * itemHeight + " " + (i + 1) * itemHeight)); if (p.y > i * itemHeight && p.y < (i + 1) * itemHeight) { --- 849,854 ---- loop : for (int i = 0; i < menuLines.size() + 1; i++) { ! //System.out.println( ! // p.y + " " + (i * itemHeight + " " + (i + 1) * itemHeight)); if (p.y > i * itemHeight && p.y < (i + 1) * itemHeight) { *************** *** 880,884 **** } ! System.out.println("actionCOmmand = " + actionCommand); ActionEvent f = --- 880,884 ---- } ! //System.out.println("actionCOmmand = " + actionCommand); ActionEvent f = *************** *** 908,912 **** for (int j = 0; j < actionListeners.size(); j++) { ! //System.out.println("calling actionperformed + " + j); ActionListener listener = --- 908,912 ---- for (int j = 0; j < actionListeners.size(); j++) { ! ////System.out.println("calling actionperformed + " + j); ActionListener listener = *************** *** 1143,1147 **** public void actionPerformed(ActionEvent e) { ! System.out.println("actionperformed called"); } }; --- 1143,1147 ---- public void actionPerformed(ActionEvent e) { ! //System.out.println("actionperformed called"); } }; *************** *** 1153,1157 **** public void actionPerformed(ActionEvent e) { ! System.out.println("actionperformed 2 called"); } }; --- 1153,1157 ---- public void actionPerformed(ActionEvent e) { ! //System.out.println("actionperformed 2 called"); } }; Index: EnviromentPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/EnviromentPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EnviromentPanel.java 3 Apr 2004 07:56:46 -0000 1.1 --- EnviromentPanel.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 143,147 **** if (e.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) { ! System.out.println("choose file"); File file = l.chooser.getSelectedFile(); --- 143,147 ---- if (e.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) { ! //System.out.println("choose file"); File file = l.chooser.getSelectedFile(); Index: WrappedEditor.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/WrappedEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WrappedEditor.java 3 Apr 2004 07:56:47 -0000 1.1 --- WrappedEditor.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 217,221 **** repaint(); ! //System.out.println("printmarginline"); } else if (showMargenLine) { --- 217,221 ---- repaint(); ! ////System.out.println("printmarginline"); } else if (showMargenLine) { Index: BasicHyperlinkListener.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/BasicHyperlinkListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicHyperlinkListener.java 3 Apr 2004 07:56:47 -0000 1.1 --- BasicHyperlinkListener.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 39,43 **** ! //System.out.println("hyperlinkupdate"); if(event.getEventType().equals(HyperlinkEvent.EventType.ENTERED)) { --- 39,43 ---- ! ////System.out.println("hyperlinkupdate"); if(event.getEventType().equals(HyperlinkEvent.EventType.ENTERED)) { *************** *** 51,55 **** status.setText(event.getURL().toExternalForm()); ! //System.out.println("entered"); //lib.gui.event.StandardGuiActions.MailSettings --- 51,55 ---- status.setText(event.getURL().toExternalForm()); ! ////System.out.println("entered"); //lib.gui.event.StandardGuiActions.MailSettings *************** *** 78,82 **** String t = event.getURL().toString(); ! System.out.println(t); //should have some other handling (internal) of mailto-links --- 78,82 ---- String t = event.getURL().toString(); ! //System.out.println(t); //should have some other handling (internal) of mailto-links *************** *** 120,124 **** } catch (IOException f) { ! System.out.println(f.getMessage()); f.printStackTrace(); } --- 120,124 ---- } catch (IOException f) { ! //System.out.println(f.getMessage()); f.printStackTrace(); } Index: StatusPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/StatusPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusPanel.java 3 Apr 2004 07:56:47 -0000 1.1 --- StatusPanel.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 279,283 **** if(progressBar.getPercentComplete() == 0 || workLength == 0) { ! //System.out.println("statuspanel displayaction"); displayAction(600); --- 279,283 ---- if(progressBar.getPercentComplete() == 0 || workLength == 0) { ! ////System.out.println("statuspanel displayaction"); displayAction(600); *************** *** 327,331 **** if (barVisible == false) { ! //System.out.println("barvisible = false in method statuschanged:statuspanel"); progressBar.setForeground(Color.orange); --- 327,331 ---- if (barVisible == false) { ! ////System.out.println("barvisible = false in method statuschanged:statuspanel"); progressBar.setForeground(Color.orange); *************** *** 337,341 **** } ! //System.out.println(status + " " + length); progressBar.setMaximum(length); --- 337,341 ---- } ! ////System.out.println(status + " " + length); progressBar.setMaximum(length); Index: FontHandler.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/FontHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FontHandler.java 3 Apr 2004 07:56:47 -0000 1.1 --- FontHandler.java 20 Mar 2005 20:23:36 -0000 1.2 *************** *** 132,138 **** public Font getFont() { ! if(font != null) ! System.out.println( ! "" + font.getSize() + font.getFamily() + font.getFontName()); return font; --- 132,138 ---- public Font getFont() { ! //if(font != null) ! //System.out.println( ! // "" + font.getSize() + font.getFamily() + font.getFontName()); return font; *************** *** 196,200 **** for (int i = 0; i < fonts.length; i++) { ! //System.out.println(familynames[i]); if (fonts[i].getFamily().equalsIgnoreCase("batang")) { --- 196,200 ---- for (int i = 0; i < fonts.length; i++) { ! ////System.out.println(familynames[i]); if (fonts[i].getFamily().equalsIgnoreCase("batang")) { |
From: Stig T. <jw...@us...> - 2005-03-20 17:43:42
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24294/net/sf/mailsomething/mail/parsers Modified Files: ImapSession.java ImapController.java Log Message: Index: ImapController.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/ImapController.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImapController.java 20 Mar 2005 15:09:07 -0000 1.3 --- ImapController.java 20 Mar 2005 17:43:22 -0000 1.4 *************** *** 1626,1630 **** listCommand = mailboxPath; ! System.out.println("selectcommand" + listCommand); return listCommand; --- 1626,1630 ---- listCommand = mailboxPath; ! //System.out.println("selectcommand" + listCommand); return listCommand; Index: ImapSession.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/ImapSession.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImapSession.java 3 Apr 2004 07:56:49 -0000 1.1 --- ImapSession.java 20 Mar 2005 17:43:22 -0000 1.2 *************** *** 3,6 **** --- 3,8 ---- import net.sf.mailsomething.util.*; import net.sf.mailsomething.mail.*; + import net.sf.mailsomething.mail.imap.ImapCommand; + import net.sf.mailsomething.mail.imap.ImapResponse; import java.io.*; *************** *** 117,120 **** --- 119,160 ---- } + + + protected synchronized ImapResponse doCommand(ImapCommand iCommand) throws IOException { + + Vector buffer = new Vector(); + + iCommand.setTag(getNextTag()); + + String command = iCommand.generateCommand(); + + notifyTo(command); + + writeLine(command); + + String line; + //String response; + + while ((line = reader.readLine()) != null) { + + buffer.add(line); + + notifyFrom(line); + + if (line.indexOf(tag) != -1) { + //response = line; + break; + } + + } + + ImapResponse response = iCommand.getResponseInstance(); + + response.buildResponse((String[])buffer.toArray(new String[]{})); + + return response; + } + + /** * Sets the mailbox attribute of the ImapSession object |
From: Stig T. <jw...@us...> - 2005-03-20 17:43:16
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24120/net/sf/mailsomething/mail/actions Modified Files: GetMessagesAction.java Log Message: Index: GetMessagesAction.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions/GetMessagesAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GetMessagesAction.java 20 Mar 2005 15:08:33 -0000 1.1 --- GetMessagesAction.java 20 Mar 2005 17:43:08 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- import java.util.Vector; + import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailService; *************** *** 17,20 **** --- 18,22 ---- import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.ObjectHandler; + import net.sf.mailsomething.mail.PopAccount; import net.sf.mailsomething.mail.parsers.ImapController; import net.sf.mailsomething.mail.parsers.PopController; *************** *** 66,70 **** */ public void invoke() { ! // TODO Auto-generated method stub } --- 68,80 ---- */ public void invoke() { ! ! if (mailAccount instanceof PopAccount) { ! ! pop3Invoke(); ! } else if(mailAccount instanceof ImapAccount) { ! ! imapInvoke(); ! ! } } *************** *** 414,417 **** --- 424,434 ---- int exists = imapControll.getExists(); + + if(mailbox instanceof Mailbox) { + + ((Mailbox)mailbox).setExists(exists); + ((Mailbox)mailbox).setRecent(imapControll.getRecent()); + + } String[] sequenceNumbers = new String[exists]; |
From: Stig T. <jw...@us...> - 2005-03-20 17:43:06
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23927/net/sf/mailsomething/mail/imap Added Files: ImapCommand.java ImapSelectResponse.java ImapListResponse.java ImapResponse.java ImapFetchCommand.java ImapSelectCommand.java ImapCommands.java Log Message: --- NEW FILE: ImapSelectCommand.java --- package net.sf.mailsomething.mail.imap; /** * @author Stig tanggaard * @since 2005-03-20 * **/ public class ImapSelectCommand extends ImapCommand { private String mailboxPath; /** * * @param path the path to the mailbox. */ public ImapSelectCommand(String path) { mailboxPath = path; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.imap.ImapCommand#generateCommand() */ public String generateCommand() { String command = getTag() + " "; String commandMailboxPath = doSelect(mailboxPath); if (commandMailboxPath.indexOf(" ") != -1) { command += "SELECT " + '"' + commandMailboxPath + '"'; } else { command += "SELECT " + commandMailboxPath; } return command; } public String getCommand() { return ImapCommands.SELECT; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.imap.ImapCommand#getResponseInstance() */ public ImapResponse getResponseInstance() { ImapSelectResponse response = new ImapSelectResponse(); response.setCommand(this); return response; } public static String doSelect(String mailboxPath) { String listCommand = ""; if (mailboxPath.equals("")) { return listCommand; } if (mailboxPath.charAt(0) == '/') { mailboxPath = mailboxPath.substring(1); } listCommand = mailboxPath; return listCommand; } } --- NEW FILE: ImapSelectResponse.java --- package net.sf.mailsomething.mail.imap; /** * @author Stig Tanggaard * @since 18-03-2005 * */ public class ImapSelectResponse extends ImapResponse { private int exists, recent, unseen, uidvalidity, uidnext; private int flags; public ImapSelectResponse() { } /* (non-Javadoc) * @see net.sf.mailsomething.mail.imap.ImapResponse#buildResponse(java.lang.String[]) */ public void buildResponse(String[] replyLines) { // TODO Auto-generated method stub super.buildResponse(replyLines); /* example C: A142 SELECT INBOX S: * 172 EXISTS S: * 1 RECENT S: * OK [UNSEEN 12] Message 12 is first unseen S: * OK [UIDVALIDITY 3857529045] UIDs valid S: * OK [UIDNEXT 4392] Predicted next UID S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) S: * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited S: A142 OK [READ-WRITE] SELECT completed */ } } --- NEW FILE: ImapResponse.java --- package net.sf.mailsomething.mail.imap; /** * Simple imap response, can be extended, is used for commands: * DELETE, CREATE, RENAME * * * @author Stig Tanggaard * @since 18-03-2005 * */ public class ImapResponse { public static final int OK = 1; public static final int NO = 2; public static final int BAD = 4; private int type; private ImapCommand command; public int getResponseType() { return type; } /** * Returns the command which this response is a response * to. * * @return */ public ImapCommand getCommand() { return command; } /** * Method for 'building' the response, ie parsing the * reply lines from the server into a ImapResponse. * This standard method checks for the status of the * reponse: OK, NO or BAD. * Can be called by subclasses. * * * @param replyLines */ public void buildResponse(String[] replyLines) { for(int i = 0; i < replyLines.length; i++) { if(replyLines[i].indexOf(command.getTag()) != -1) { if(replyLines[i].indexOf("OK") != -1) { type = ImapResponse.OK; } else if(replyLines[i].indexOf("BAD") != -1) { type = ImapResponse.BAD; } if(replyLines[i].indexOf("NO") != -1) { type = ImapResponse.NO; } } } } /** * @param command The command to set. */ public void setCommand(ImapCommand command) { this.command = command; } } --- NEW FILE: ImapCommand.java --- package net.sf.mailsomething.mail.imap; /** * @author Stig Tanggaard * @since 18-03-2005 * */ public class ImapCommand { private String command, tag; /** * @return Returns the tag. */ public String getTag() { return tag; } /** * @param tag The tag to set. */ public void setTag(String tag) { this.tag = tag; } /** * Generates a command line which can be issued to a server. * A command line contains as a minimum a tag, a command, * and perhabs a list of parameters (depending on the specific * command) * * @return */ public String generateCommand() { return null; } /** * If a subclass of ImapCommand needs/uses a specific * subclass of ImapResponse, this method should be overridden. * For example, ImapSelectCommand will return an instance of * ImapSelectResponse. * * @return */ public ImapResponse getResponseInstance() { return new ImapResponse(); } } --- NEW FILE: ImapFetchCommand.java --- package net.sf.mailsomething.mail.imap; /** * @author Stig Tanggaard * @since 18-03-2005 * */ public class ImapFetchCommand extends ImapCommand { //public static final int UID_FLAG = 1; //public static final int RFC822_SIZE_FLAG = 2; } --- NEW FILE: ImapListResponse.java --- package net.sf.mailsomething.mail.imap; import java.util.Vector; /** * @author Stig Tanggaard * @since 18-03-2005 * */ public class ImapListResponse extends ImapResponse { private Vector listEntries = new Vector(); /* (non-Javadoc) * @see net.sf.mailsomething.mail.imap.ImapResponse#buildResponse(java.lang.String[]) */ public void buildResponse(String[] replyLines) { // TODO Auto-generated method stub super.buildResponse(replyLines); for(int i = 0; i < replyLines.length; i++) { if(!replyLines[i].startsWith(getCommand().getTag())) { listEntries.add(getEntry(replyLines[i])); } } } public ImapListResponseEntry[] getEntries() { return (ImapListResponseEntry[]) listEntries.toArray(new ImapListResponseEntry[]{}); } public ImapListResponseEntry getEntry(String responseLine) { ImapListResponseEntry entry = new ImapListResponseEntry(); //consider making the responseline lowercase and //ignore case when checking for the flags if(responseLine.indexOf("\\Marked") != -1) { entry.Marked = true; } else { entry.Marked = false; } if(responseLine.indexOf("\\HasChildren") != -1) { entry.HasChildren = true; } else { entry.HasChildren = false; } if(responseLine.indexOf("\\HasNoChildren") != -1) { entry.HasNoChildren = true; } else { entry.HasNoChildren = false; } if(responseLine.indexOf("\\Noselect") != -1) { entry.Noselect = true; } else { entry.Noselect = false; } //TODO name attribute //should be checked for ?- instances and decoded if //it contains those (modified base 64 encoding) return null; } public class ImapListResponseEntry { boolean Marked = false; boolean HasChildren = false; boolean HasNoChildren = false; boolean Noselect = false; String name; } } --- NEW FILE: ImapCommands.java --- package net.sf.mailsomething.mail.imap; /** * @author Stig Tanggaard * @since 18-03-2005 * */ public interface ImapCommands { public static final String SELECT = "SELECT"; public static final String CREATE = "CREATE"; public static final String DELETE = "DELETE"; public static final String RENAME = "RENAME"; public static final String LIST = "LIST"; public static final String STATUS = "STATUS"; public static final String FETCH = "FETCH"; public static final String STORE = "STORE"; } |
From: Stig T. <jw...@us...> - 2005-03-20 17:42:55
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23879/net/sf/mailsomething/mail/imap Log Message: Directory /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/imap added to the repository |
From: Stig T. <jw...@us...> - 2005-03-20 17:42:41
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23702/net/sf/mailsomething/mail Modified Files: Mailbox.java Log Message: Index: Mailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Mailbox.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mailbox.java 20 Mar 2005 15:07:40 -0000 1.3 --- Mailbox.java 20 Mar 2005 17:42:32 -0000 1.4 *************** *** 110,118 **** public static final int SENT = 2; ! ! //fields defining standard mailbox types ! //maybe those should actually be placed in the mailbox class, would ! //make more sence public static final int DRAFTS = 1; /** --- 110,119 ---- public static final int SENT = 2; ! public static final int DRAFTS = 1; + + private transient int exists, recent; + + /** *************** *** 120,123 **** --- 121,128 ---- */ public Mailbox() { + + exists = 0; + recent = 0; + messages = new Vector(); mailboxes = new Vector(); *************** *** 1340,1344 **** * @return int */ ! public int getSize() { int size = 0; --- 1345,1349 ---- * @return int */ ! /*public int getSize() { int size = 0; *************** *** 1354,1358 **** return size; ! } --- 1359,1363 ---- return size; ! }*/ *************** *** 1505,1507 **** --- 1510,1536 ---- } + /** + * @return Returns the exists. + */ + public int getExists() { + return exists; + } + /** + * @param exists The exists to set. + */ + public void setExists(int exists) { + this.exists = exists; + } + /** + * @return Returns the recent. + */ + public int getRecent() { + return recent; + } + /** + * @param recent The recent to set. + */ + public void setRecent(int recent) { + this.recent = recent; + } } |
From: Stig T. <jw...@us...> - 2005-03-20 15:09:17
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21214/net/sf/mailsomething/mail/parsers Modified Files: ImapController.java PopController.java Log Message: Index: ImapController.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/ImapController.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImapController.java 14 Mar 2005 20:12:50 -0000 1.2 --- ImapController.java 20 Mar 2005 15:09:07 -0000 1.3 *************** *** 1613,1617 **** } ! private String doSelect(String mailboxPath) { String listCommand = ""; --- 1613,1617 ---- } ! public static String doSelect(String mailboxPath) { String listCommand = ""; *************** *** 1737,1741 **** *@return Description of the Returned Value */ ! private String doPath(String mailboxPath) { String listCommand = ""; --- 1737,1741 ---- *@return Description of the Returned Value */ ! public static String doPath(String mailboxPath) { String listCommand = ""; *************** *** 1765,1769 **** *@return Description of the Returned Value */ ! private String[] parseSearch(String[] reply) { Vector num = new Vector(); --- 1765,1769 ---- *@return Description of the Returned Value */ ! private static String[] parseSearch(String[] reply) { Vector num = new Vector(); *************** *** 1791,1806 **** } ! public ImapMailboxFlags getFlags(String path) { ! ! selectMailbox(path); ! ! //logger.info("imapcontroller exists " + exists + " recent " + recent); ! /*int x = selectMailbox(path) ! * if x == 0; ! * do a noop ! */ ! return new ImapMailboxFlags(exists, recent); ! ! } class NoopTimer implements ActionListener { --- 1791,1795 ---- } ! class NoopTimer implements ActionListener { *************** *** 2101,2104 **** --- 2090,2099 ---- } + + + + + + } Index: PopController.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/PopController.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PopController.java 3 Apr 2004 07:56:49 -0000 1.1 --- PopController.java 20 Mar 2005 15:09:07 -0000 1.2 *************** *** 12,24 **** /** ! * Right now some of the methods which invokes methods on the session is ! * synchronized. It will probably be better just to synchronize the methods in ! * the sessionclass. The PopController should implement a BasicMailChecker ! * Interface. ! * ! *@author stig ! *@created October 3, 2001 ! *@version 0.1 [...1198 lines suppressed...] ! * Some servers close connection when APOP authentication fails, so we have ! * to close the socket and try to reconnect. ! */ private void reconnect() { logof(); ! connect(session, account); } ! public boolean useSSL() { ! return account.useSSL(); ! } + ! ! } \ No newline at end of file |
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20946/net/sf/mailsomething/mail/actions Added Files: AppendMessageAction.java MoveMailboxAction.java AbstractMailAction.java UpdateMailboxesAction.java DeleteMessageAction.java GetMessagesAction.java GetMessageBodyAction.java RenameMailboxAction.java DeleteMailboxAction.java StoreMessageAction.java MoveMessageAction.java CopyMessageAction.java CreateMailboxAction.java Log Message: --- NEW FILE: GetMessagesAction.java --- package net.sf.mailsomething.mail.actions; import java.text.DateFormat; import java.text.FieldPosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.Vector; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailService; import net.sf.mailsomething.mail.MailUtils; import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageConstants; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.ObjectHandler; import net.sf.mailsomething.mail.parsers.ImapController; import net.sf.mailsomething.mail.parsers.PopController; /** * @author Stig tanggaard * @since 2005-03-19 * **/ public class GetMessagesAction extends AbstractMailAction { // for getting unseen messages public static final int UNSEEN = 1; //for getting recent messages public static final int RECENT = 2; //to get messages based on messageid-comparision public static final int MESSAGEID = 3; //to get messages based on date, ie, all mails since the last we have recieved public static final int DATE = 4; //to get all messages. This probably shouldnt be used. public static final int ALL = 5; //neither this public static final int SYNC = 6; //for using the default mechanisme (first time: date search, and after: unseen). public static final int DEFAULT = 7; private MailAccount mailAccount; private PopController controller; private MessageHolder mailbox; private ImapController imapControll; private int type; /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { // TODO Auto-generated method stub } protected void pop3Invoke() { //if (r.getFlag() == 6) // return; controller.clearUidBuffer(); MessageHolder mailbox = mailAccount.getStandardMailbox(Mailbox.INBOX); PopController.UIDMarker[] uids = controller.searchUid(); if (uids == null) return; Vector nmessages = new Vector(); int max = mailAccount.getMaxMessagesToFetch(); int startfrom = 0; /** * We dont call either notifyMessagesFound since we dont know * how many NEW messages is actually found. */ if (max < uids.length) { startfrom = uids.length - max; notifyWorkStarted(max); } else notifyWorkStarted(uids.length); int[] sizes = null; for (int i = startfrom; i < uids.length; i++) { if (uids[i] != null) { //problem here. if (!mailbox.existsUid(uids[i].getUID())) { //dont get the message sizes untill we have a new message if (sizes == null) sizes = controller.getSizeList(); //int size = controller.getMessageSize(uids[i].getIndex()); if (sizes[uids[i].getIndex() - 1] > mailAccount.getMaxMessageSize()) { Message m = MailService.createMessage(); m.setUID(uids[i].getUID()); m.setField(MessageConstants.SUBJECT, "unknown"); m.setField(MessageConstants.FROM, "unknown"); String message = "The size of this message is bigger than limit," + "either change sizelimit or ignore this message" + "completely. Some time in future it will be possible" + "to fetch the message anyways"; m.setObject(message.getBytes()); m.setRemote(true); m.setSize(sizes[uids[i].getIndex() - 1]); mailbox.addMessage(m); nmessages.add(m); //notifyMessagesFetched(mailbox, new Message[] { m }); } else { Message m = controller.getMessage(uids[i].getIndex()); m.setRemote(true); m.setUID(uids[i].getUID()); m.setBodyFetched(true); m.setSize(sizes[uids[i].getIndex() - 1]); mailbox.addMessage(m); nmessages.add(m); //notifyMessagesFetched(mailbox, new Message[] { m }); } } } notifyWorkProgress(i - startfrom + 1); } notifyWorkStopped(); controller.logof(); } protected void imapInvoke() { String path = mailbox.getPath(); String[] seqenceNumbers = null; /** * This is a special situation where we just ignore any * request specification. Reason - this way of getting all * sequencenumbers should be stable with all server implementations * and furthermore its the fastest of them all (when we havent * got any messages yet). * * */ if (mailbox.getMessageCount() == 0) { seqenceNumbers = getSequencesBySelection(path); } else { /** * The reason not all the types are equivalent with controller-methods * is a design issue. * FetchUnseen & FetchRecent are natural controller methods, * while fetchDate or fetchMessageid * isnt.... or maybe they are, but they dont fetch messages. */ switch (type) { case UNSEEN : seqenceNumbers = imapControll.searchUnseen(path); /*checkedMailboxes.put( path, new Integer(controller.getExists()));*/ break; case RECENT : seqenceNumbers = imapControll.searchRecent(path); /*checkedMailboxes.put( path, new Integer(controller.getExists()));*/ break; case MESSAGEID : synchronizeMessages(mailbox); return; case DATE : //this is wrong... the search command doesnt returns uid´s //but message sequence numbers seqenceNumbers = getSequencesByDate(mailbox, path); /*checkedMailboxes.put( path, new Integer(controller.getExists()));*/ break; case ALL : synchronizeMessages(mailbox); return; //This should be called default, instead, but I dont wanna //disturb serializing right now. case SYNC : synchronizeMessages(mailbox); return; } } getMessages(mailbox, seqenceNumbers); } /** * * Synchronizes the specific mailbox. Currently that means that we * fetch any messages in the mailbox we dont have allready, based * on uids of messages. Secondly, if we have some messages locally * which doesnt exists at server we mark them as local. We dont * delete them automaticly, I think that should be a useroption. * * @param mailbox */ protected void synchronizeMessages(MessageHolder mailbox) { //to get a fresh exists count imapControll.searchUnseen(mailbox.getPath()); //first make sure we select the right mailbox //There is an issue here, when the selected mailbox is the //same as the one currently selected, then we dont get an update //of the exists count, ie if some messages has been deleted //we will get a higher exists count. Because of the controller //implementation. SOlution - do a controller.getUnseen first //see above. String[] seqenceNumbers = getSequencesBySelection(mailbox.getPath()); //get the exists value, then we have sequence 0 to exists int endIndex = imapControll.getExists(); //get all uids for this sequence (which is all uids available) String[] uids = imapControll.fetchUID(1, endIndex); Vector buffer = new Vector(); //check if the uid exists for (int i = 0; i < uids.length; i++) { if (!mailbox.existsUid(uids[i])) { buffer.add("" + (i+1)); } } //get those messages we dont have. getMessages(mailbox, (String[])buffer.toArray(new String[]{})); //next is to check for all local messages, if they exists or //not at server, and delete them if not. This means, that a //locally created message should be marked with a flag if it //had been appended or not, if this flag is set to not, it should //ofcourse not be deleted, but appended. Message[] messages = mailbox.getMessages(); for(int i = 0; i < messages.length; i++) { String uid = messages[i].getUID(); if(uid != null) { boolean isRemote = false; for(int j = 0; j < uids.length; j++) { if(uids[j].equals(uid)) { isRemote = true; break; } } if(!isRemote) { messages[i].setRemote(false); //if this message does not exists at server and its //marked for delition, then we can just remove it. //actually the message dont need to be marked deleted //to be removed, this is just a choice I have made //so far. Maybe it should be a useroption. if(messages[i].isMarkedDeleted()) { mailbox.removeMessage(messages[i]); } } else { if(messages[i].isMarkedDeleted()) { //here theres 2 possibilities 1. request the //message to be deleted, or 2. unmark the deletion. //I will choose the last and let it be up to the //user to delete it again. //int flags = //messages[i].setFlag() //doesnt seem to be possible :) } } } } } protected String[] getSequencesBySelection(String path) { imapControll.selectMailbox(path); int exists = imapControll.getExists(); String[] sequenceNumbers = new String[exists]; for (int i = 0; i < exists; i++) { sequenceNumbers[i] = "" + (i + 1); } return sequenceNumbers; } /** * To get all messages by date. I have been using this to get * all messages of a mailbox the first time a connection is * made. Also to get all the messages since last connection (by * searching by the date of the last message). * I wont use it to get all the message anymore. Turns out some * servers dont like a * search 01-01-1970 * Instead use getMessagesBySelection * * @param m * @param path * @return */ protected String[] getSequencesByDate(MessageHolder m, String path) { String[] sequenceNumbers; Message mm = MailUtils.getLastMessage(m.getMessages()); Date date; if (mm == null || mm.getDate() == null) { long l = 1000; date = new Date(l); } else date = mm.getDate(); SimpleDateFormat format = new SimpleDateFormat("dd-MMM-yyyy", Locale.ENGLISH); StringBuffer buffer = format.format( date, new StringBuffer(), new FieldPosition(DateFormat.FULL)); //System.out.println(buffer.toString()); sequenceNumbers = imapControll.searchDate(path, buffer.toString()); //if length is 0 just return the empty array. if (sequenceNumbers.length == 0) return sequenceNumbers; /** * TODO: This is BAD design. The idea by returning sequencenumbers * is to actually return those we dont have. So instead of * just returning the last ones, we should furthermore check * if we allready have those. * * Okay im changing it now, with no garanties it will work * properly. It should though. * */ try { int startIndex = Integer.parseInt(sequenceNumbers[0]); int endIndex = Integer.parseInt(sequenceNumbers[sequenceNumbers.length - 1]); String[] uids = imapControll.fetchUID(startIndex, endIndex); //some error have happened return empty array if (uids == null) return new String[] { }; Vector temp = new Vector(); for (int i = 0; i < uids.length; i++) { //System.out.println("uids found " + uids[i]); if (!m.existsUid(uids[i])) { temp.add(sequenceNumbers[i]); } } return (String[]) temp.toArray(new String[] { }); } catch (NumberFormatException f) { //TODO: better errorhandling here return new String[] { }; } } /** * I have extracted this into its own method. Seems more appropiate, * and the updatemessages method was getting to big. * * * @param mailbox * @param seqenceNumbers */ protected void getMessages( MessageHolder mailbox, String[] seqenceNumbers) { if (seqenceNumbers == null) { //System.out.println("notifying progress imapaccount"); //this is a hack to display some false activity. notifyWorkStarted(0); //notifyWorkProgress(); notifyWorkStopped(); return; } int max = mailAccount.getMaxMessagesToFetch(); int startfrom = 0; /** * We dont call either notifyMessagesFound since we dont know * how many NEW messages is actually found. */ if (max < seqenceNumbers.length) { startfrom = seqenceNumbers.length - max; notifyWorkStarted(max); } else notifyWorkStarted(seqenceNumbers.length); //Vector nmessages = new Vector(); //notifyWorkStarted(uid.length+1); /** * TODO * The following is wrong. We need to look at the sequence * numbers first, to determine if the are in the right order, * and those in the right order should be fetched (header/body) * at same time. Which means we need to supply a new method * in the imapcontroller taking and startindex and an endindex. * Its very likely (for many instances) that all sequence numbers * are in the same row. * * */ int[] numbers = new int[seqenceNumbers.length]; if (numbers.length == 0) { notifyWorkStopped(); return; } for (int i = 0; i < seqenceNumbers.length; i++) { try { numbers[i] = Integer.parseInt(seqenceNumbers[i]); System.out.print(" " + numbers[i]); } catch (NumberFormatException f) { } } int[][] sequences = getSequences(numbers); // create a handler HeaderFetchedHandler handler = new HeaderFetchedHandler((Mailbox) mailbox); for (int i = 0; i < sequences.length; i++) { //get the messages imapControll.getHeader( handler, mailbox.getPath(), sequences[i][0], sequences[i][sequences[i].length - 1]); } handler.start(); notifyWorkStopped(); } /** * * Method for traversing a sequence number array (where the sequences * may have 'jumps' at more than 1) and putting those numbers into * arrays containing numbers which follows on a row by 1 as jump. Ie, * an argument of 2,3,4,7,8,9,10,12,13,14 would return 3 arrays of * 2,3,4 * 7,8,9,10 * 12,13,14 * * @param sequenceNumbers * @return a 2 dimensionel array with each array containing a sequence of * numbers */ public int[][] getSequences(int[] sequenceNumbers) { Vector temp = new Vector(); int lastNumber = sequenceNumbers[0]; int startIndex = 0; for (int i = 1; i < sequenceNumbers.length; i++) { if (sequenceNumbers[i] != lastNumber + 1) { int[] array = new int[i - startIndex]; int index = 0; for(int j = startIndex; j < i; j++) { array[index] = sequenceNumbers[j]; index++; } temp.add(array); startIndex = i; } lastNumber = sequenceNumbers[i]; } if (startIndex < sequenceNumbers.length) { int[] array = new int[sequenceNumbers.length - startIndex]; int index = 0; for (int j = startIndex; j < sequenceNumbers.length; j++) { array[index] = sequenceNumbers[j]; index++; } temp.add(array); } int[][] seqs = new int[temp.size()][]; for(int i = 0; i < temp.size(); i++) { int[] array = (int[])temp.elementAt(i); seqs[i] = new int[array.length]; for(int j = 0; j < array.length; j++) { seqs[i][j] = array[j]; } } return seqs; } class HeaderFetchedHandler extends Thread implements ObjectHandler { Vector fetchedMessages = new Vector(); Mailbox mailbox; int index = 0; int indexOfMessageLoaded = 0; //boolean public HeaderFetchedHandler(Mailbox mailbox) { this.mailbox = mailbox; //Runtime.getRuntime().addShutdownHook(this); } /** * After being called this fires a messagefetchedevent. Which * means the class/method using the HeaderFetchedHandler should * not do this too. * * @see net.sf.mailsomething.mail.ObjectHandler#handle(java.lang.Object) */ public void handle(Object o) { if (o == null) return; Message message = (Message) o; message.setRemote(true); message.setBodyFetched(false); index++; //because the messageid havent been parsed yet it is not //possible to check if message exists based on messageid, //which means we need to check for UID. if (mailbox.existsUid(message.getUID())) { notifyWorkProgress(index); return; } if (message.getField(MessageConstants.MESSAGE_ID) == null) message.setField( MessageConstants.MESSAGE_ID, MailUtils.getUniqeID()); fetchedMessages.add(message); notifyWorkProgress(index); } public void run() { int pause = 0; if (fetchedMessages.size() > 20) { mailbox.disableListeners(true); } while (indexOfMessageLoaded < fetchedMessages.size()) { //pause++; Message m = (Message) fetchedMessages.elementAt(indexOfMessageLoaded); if (!m.isLoaded()) m.load(); mailbox.addMessage(m); //notifyMessagesFetched(mailbox, new Message[] { (Message) fetchedMessages // .elementAt(indexOfMessageLoaded) }); indexOfMessageLoaded++; } //moved this here to have a better firing of events. //notifyMessagesFetched(mailbox, (Message[])fetchedMessages.toArray(new Message[] {})); if (fetchedMessages.size() > 20) { mailbox.disableListeners(false); } } } /** * @param mailbox The mailbox to set. */ public void setMailbox(MessageHolder mailbox) { this.mailbox = mailbox; } /** * @param type The type to set. */ public void setType(int type) { this.type = type; } } --- NEW FILE: MoveMessageAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageHolder; /** * @author Stig tanggaard * @since 2005-03-20 * **/ public class MoveMessageAction extends CopyMessageAction { public MoveMessageAction(MessageHolder srcMailbox, MessageHolder destMailbox, Message message) { super(srcMailbox, destMailbox, message); } /* (non-Javadoc) * @see net.sf.mailsomething.mail.actions.CopyMessageAction#invoke() */ public void invoke() { // TODO Auto-generated method stub super.invoke(); srcMailbox.removeMessage(message); } } --- NEW FILE: GetMessageBodyAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-19 * **/ public class GetMessageBodyAction extends AbstractMailAction { MessageHolder mailbox; Message message; ImapAccount mailAccount; public GetMessageBodyAction(MessageHolder mailbox, Message message) { this.mailbox = mailbox; this.message = message; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { if (message.isBodyFetched()) return; mailAccount.getController().selectMailbox(mailbox.getPath()); /** * The following - get index of message could just as well * be implemented in the getbody method. * */ int index = mailAccount.getController().getIndexOfMessage(message.getUID()); if (index == -1) { System.out.println("fetch body index = -1"); return; } mailAccount.getController().getBody(null, index, message, getProgressListener()); message.setBodyFetched(true); } /** * @return */ private ProgressListener getProgressListener() { if(progressListeners.size() > 0 ) return (ProgressListener)progressListeners.elementAt(0); return null; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } --- NEW FILE: CreateMailboxAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.Hierachy; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.parsers.ImapController; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-17 * **/ public class CreateMailboxAction implements MailAction { private Hierachy mailbox; private MailAccount mailAccount; private ImapController controller; public CreateMailboxAction(Hierachy mailbox) { this.mailbox = mailbox; } public void addProgressListener(ProgressListener l) { } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { if (mailbox.isRemote() == false && mailAccount instanceof ImapAccount) { if (mailbox.isRemote() == false) { if (controller.createMailbox(mailbox.getPath())) mailbox.setRemote(true); } } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount() */ public void setMailAccount(MailAccount account) { } } --- NEW FILE: AbstractMailAction.java --- package net.sf.mailsomething.mail.actions; import java.util.Vector; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-19 * */ public abstract class AbstractMailAction implements MailAction { protected Vector progressListeners; /** * To add a progresslistener to the mailaccount. A progresslistener recieves * notification of 'work' happening, but with no details about the actual * sort of work. * * @param l */ public void addProgressListener(ProgressListener l) { if (progressListeners == null) progressListeners = new Vector(); progressListeners.add(l); } /** * Use this to notify progresslisteners that work is starting, and the * estimated length of the work happening. * * @param length */ protected void notifyWorkStarted(int length) { if (progressListeners != null) for (int i = 0; i < progressListeners.size(); i++) { ProgressListener l = (ProgressListener) progressListeners .elementAt(i); l.workStarted(length); } } /** * Use this to notify progresslistener of the progress in work happening. * Use notifyWorkStarted before calling this, and notifyWorkedStopped when * the work is finished. * * @param index */ protected void notifyWorkProgress(int index) { if (progressListeners != null) for (int i = 0; i < progressListeners.size(); i++) { ProgressListener l = (ProgressListener) progressListeners .elementAt(i); l.workProgress(index); } } protected void notifyWorkProgress(int index, int length) { if (progressListeners != null) for (int i = 0; i < progressListeners.size(); i++) { ProgressListener l = (ProgressListener) progressListeners .elementAt(i); l.workProgress(index, length); } } /** * To notify progresslistener that the work is stopped. */ protected void notifyWorkStopped() { if (progressListeners != null) for (int i = 0; i < progressListeners.size(); i++) { ProgressListener l = (ProgressListener) progressListeners .elementAt(i); l.workStopped(); } } } --- NEW FILE: CopyMessageAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.PopAccount; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-20 * **/ public class CopyMessageAction implements MailAction { MessageHolder srcMailbox, destMailbox; Message message; ImapAccount mailAccount; PopAccount popAccount; public CopyMessageAction(MessageHolder srcMailbox, MessageHolder destMailbox, Message message) { this.srcMailbox = srcMailbox; this.destMailbox = destMailbox; this.message = message; } public void invoke() { if(mailAccount != null) imapInvoke(); else if(popAccount != null) popInvoke(); } public void popInvoke() { Message clone = (Message) message.clone(); destMailbox.addMessage(clone); //System.out.println("popaccount: clone isremote " + clone.isRemote()); } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void imapInvoke() { //copy the message mailAccount.getController().copyMessage(message.getUID(), srcMailbox.getPath(), destMailbox.getPath()); //clone the message Message copiedMessage = (Message) message.clone(); destMailbox.addMessage(copiedMessage); //in order to change the uid of the message //(since its changed when moved to another mailbox). mailAccount.getController().selectMailbox(destMailbox.getPath()); //this is maybe a bad way to do this, and currently im not //sure the uid value is used at all. int exists = mailAccount.getController().getExists(); String uid = mailAccount.getController().getUid(exists); copiedMessage.setUID(uid); } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { if(account instanceof ImapAccount) mailAccount = (ImapAccount)account; else if(account instanceof PopAccount) popAccount = (PopAccount)account; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } --- NEW FILE: StoreMessageAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-19 * **/ public class StoreMessageAction implements MailAction { private ImapAccount mailAccount; private Message message; private MessageHolder mailbox; public StoreMessageAction(MessageHolder mailbox, Message message) { this.mailbox = mailbox; this.message = message; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { if (message.isRemote()) { mailAccount.getController().deleteMessage(mailbox.getPath(), message.getUID()); message.setRemote(false); } mailAccount.getController().appendMessage(message, mailbox.getPath()); message.setRemote(true); } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { if(account instanceof ImapAccount) mailAccount = (ImapAccount)account; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } --- NEW FILE: DeleteMailboxAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.MailboxHolder; import net.sf.mailsomething.mail.PopAccount; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-19 * **/ public class DeleteMailboxAction implements MailAction { Mailbox mailbox; MailboxHolder parent; ImapAccount mailAccount; PopAccount popAccount; public DeleteMailboxAction(MailboxHolder parent, Mailbox todelete) { } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { if(mailAccount != null) imapInvoke(); else if(popAccount != null) popInvoke(); } public void popInvoke() { if (mailbox.getParent() != null) { if (mailbox.getParent().equals("")) { popAccount.removeMailbox(mailbox); } else { MailboxHolder parent = mailbox.getParentMailbox(); parent.removeMailbox(mailbox); } } else { String path = mailbox.getPath(); Mailbox parent = popAccount.getMailbox( mailbox.getPath().substring( 0, mailbox.getPath().lastIndexOf( popAccount.getDelimiter()))); parent.removeMailbox(mailbox); } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void imapInvoke() { if (mailbox.isRemote() == true) { //we only delete the mailbox if the command returns true if (mailAccount.getController().deleteMailbox(mailbox.getPath())) { mailbox.setRemote(false); parent.removeMailbox(mailbox); } } else { if (parent != null) //maybe one could do a checkup here, to see if there exists //a mailbox with that name at server (which means remote //is actual true. parent.removeMailbox(mailbox); } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { if(account instanceof ImapAccount) { mailAccount = (ImapAccount)account; } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } --- NEW FILE: DeleteMessageAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.mail.PopAccount; import net.sf.mailsomething.mail.parsers.ImapController; import net.sf.mailsomething.mail.parsers.PopController; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-17 * */ public class DeleteMessageAction implements MailAction { private MailAccount mailAccount; private MessageHolder mailbox; private Message message; private ImapController controller; private PopController popControll; /** * */ public DeleteMessageAction(MessageHolder mailbox, Message message) { this.mailbox = mailbox; this.message = message; // TODO Auto-generated constructor stub } /* * (non-Javadoc) * * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { if (mailAccount instanceof PopAccount) { pop3Invoke(); } else if(mailAccount instanceof ImapAccount) { imapInvoke(); } } /* * (non-Javadoc) * * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see net.sf.mailsomething.mail.MailAction#setMailAccount() */ public void setMailAccount(MailAccount account) { mailAccount = account; if(account instanceof PopAccount) { popControll = ((PopAccount)account).getController(); } else if(account instanceof ImapAccount) { controller = ((ImapAccount)account).getController(); } } public void addProgressListener(ProgressListener l) { } private void imapInvoke() { if (message.isRemote()) { controller.deleteMessage(mailbox.getPath(), message.getUID()); message.setRemote(false); mailbox.removeMessage(message); if(mailAccount.getStandardMailbox(Mailbox.TRASH) != null && mailAccount.getStandardMailbox(Mailbox.TRASH) != mailbox) { message.clearFlag(Message.DELETED); mailAccount.getStandardMailbox(Mailbox.TRASH).addMessage(message); } } else { //this should never be called, since this method is called //as a response to a request by a mailbox. The mailbox should //not send such a request if the message is not remote. mailbox.removeMessage(message); } } private void pop3Invoke() { //this is a stupid way to decide this. if (!mailbox.isRemote()) { MessageHolder trash = mailAccount.getStandardMailbox(Mailbox.TRASH); if (trash == null) return; //should have a public field TRASH with name of mailbox //and a boolean value: deleteFully if (mailbox.equals(trash)) { //here should be a check, if the setting //deleteWhenDeletedFromTrash //is true, and if so, check if the message exists //at server, and then delete it. return; } else { trash.addMessage(message); return; } } else { String myUID = message.getUID(); //get the uid-markers (uidmarker = uid + index) PopController.UIDMarker[] uids = popControll.searchUid(); for (int i = 0; i < uids.length; i++) { //System.out.println(uids[i]); if (uids[i] != null) { if (uids[i].getUID().equals(myUID)) popControll.deleteMessage(uids[i].getIndex()); } } message.setRemote(false); mailbox.removeMessage(message); MessageHolder trash = mailAccount.getStandardMailbox(Mailbox.TRASH); if (trash != null) trash.addMessage(message); } } } --- NEW FILE: UpdateMailboxesAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.MailboxHolder; import net.sf.mailsomething.mail.parsers.ImapController; /** * @author Stig tanggaard * @since 2005-03-20 * **/ public class UpdateMailboxesAction extends AbstractMailAction { private MailboxHolder rootMailbox; private ImapAccount mailAccount; private int workProgress; /** * */ public UpdateMailboxesAction(MailboxHolder root) { rootMailbox = root; // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { updateMailboxes(rootMailbox); notifyWorkStopped(); } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void updateMailboxes(MailboxHolder mailbox) { if (workProgress == 0) notifyWorkStarted(-1); String[] mailboxNames; ImapController.MailboxListResult result = mailAccount.getController().listMailboxes(mailbox.getPath()); /**for synchronization purposes; first set all to local, then get * all at server, * and if a mailbox isnt at server it keeps the local value */ Mailbox[] currentMailboxes = mailbox.getMailboxes(); /** * This just seem like plain bad design. Maybe we should * check the mailboxes against the mailboxnames recieved * from server, instead. * */ if (currentMailboxes != null) { for (int i = 0; i < currentMailboxes.length; i++) { boolean exists = false; for (int j = 0; j < result.getMailboxNames().length; j++) { if (result .getMailboxNames()[j] .equals(currentMailboxes[i].getName())) { exists = true; break; } } //if the mailbox allready exists, based on name //comparison, set it to remote (just to be sure) if (exists) currentMailboxes[i].setRemote(true); //if it doesnt exists, try create it else { if (mailAccount.getController() .createMailbox(currentMailboxes[i].getPath())) currentMailboxes[i].setRemote(true); else currentMailboxes[i].setRemote(false); } } } workProgress += result.getMailboxNames().length; notifyWorkProgress(workProgress); //notify for (int i = 0; i < result.getMailboxNames().length; i++) { //this is a check for the returned name. I am doing this //here coz I have some problem with an imapd which returns //the name of the mailbox and a delimiter from a listcommand, ie //C: LIST "" mailboxname/% //S: LIST (\NoSelect) "/" mailboxname/ //which I just dont understand :) if (result.getMailboxNames()[i].trim().equals("") || result.getMailboxNames()[i].trim().equals("/")) continue; //System.out.println("+" + result.getMailboxNames()[i] + "+"); if (mailbox.getMailbox(result.getMailboxNames()[i]) == null) { //System.out.println(mailboxNames[i]); Mailbox n = new Mailbox(result.getMailboxNames()[i], mailAccount); n = mailbox.addMailbox(n); if (n != null) { n.setRemote(true); //if the mailboxname starts with a . we assume its hidden //and we wont get the mailboxes in this mailbox. if (result.getMailboxNames()[i].startsWith(".")) { n.setState(n.getState() | Mailbox.HIDDEN); } else { /** * If this mailbox has children we create a * request to update this new mailbox. * */ if (result.hasChildren(i)) { /*Request rr = new Request(Request.UPDATE_MAILBOXES, n, null); rr.setDismissable(r.isDismissable());*/ updateMailboxes(n); } } } } } //notifyWorkStopped(); } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // No implementation here, u cannot redo an update } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { if(account instanceof ImapAccount) mailAccount = (ImapAccount)account; } } --- NEW FILE: MoveMailboxAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.MailboxHolder; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-19 * **/ public class MoveMailboxAction implements MailAction { private char delimiter = '/'; Mailbox toMove; MailboxHolder target; ImapAccount mailAccount; /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { MailboxHolder source = toMove.getParentMailbox(); if (toMove.isRemote()) { if (mailAccount.getController() .renameMailbox( toMove.getPath(), target.getPath() + delimiter + toMove.getName())) { toMove.setParent(target.getPath()); source.removeMailbox(toMove); } else { source.removeMailbox(toMove); } } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } --- NEW FILE: RenameMailboxAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-20 * **/ public class RenameMailboxAction implements MailAction { Mailbox mailbox; String nPath, nName; ImapAccount mailAccount; public RenameMailboxAction(Mailbox mailbox, String nName) { this.mailbox = mailbox; this.nName = nName; this.nPath = mailbox.getParentMailbox().getPath() + '/' + nName; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { int selectResult = mailAccount.getController().selectMailbox(mailbox.getPath()); /** * Check if we can select the old mailbox. If we cant * select it, there is something wrong (mailbox doesnt * exists or similar). * */ if (selectResult == -1) { selectResult = mailAccount.getController().selectMailbox(nPath); if (selectResult == 1) { //we can select the new mailbox, everything is //then fine return; } //we cant select the new, we cant select the old //we have a problem... TODO return; } selectResult = mailAccount.getController().selectMailbox(nPath); if (selectResult == 1) { //we can select the old mailbox, and we can //select the new mailbox, ie, a rename cant be done /*String oldname = oldpath.substring(oldpath.lastIndexOf(delimiter) + 1); m.rename(oldname);*/ //TODO: should fetch the new mailbox. Or check if it //allready exists. return; } //if theres an error renaming, we revert the name. if (mailAccount.getController().renameMailbox(mailbox.getPath(), nPath)) { mailbox.rename(nName); } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } --- NEW FILE: AppendMessageAction.java --- package net.sf.mailsomething.mail.actions; import net.sf.mailsomething.mail.ImapAccount; import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailAction; import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageHolder; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-19 * **/ public class AppendMessageAction implements MailAction { private Message message; private MessageHolder mailbox; private ImapAccount mailAccount; /** * */ public AppendMessageAction(MessageHolder mailbox, Message message) { this.mailbox = mailbox; this.message = message; } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#invoke() */ public void invoke() { //Message message = mailbox.getMessage(messageid); if (message != null) { message.setRemote(true); mailAccount.getController().appendMessage(message, mailbox.getPath()); } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#undo() */ public void undo() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#setMailAccount(net.sf.mailsomething.mail.MailAccount) */ public void setMailAccount(MailAccount account) { if(account instanceof ImapAccount) { mailAccount = (ImapAccount)account; } } /* (non-Javadoc) * @see net.sf.mailsomething.mail.MailAction#addProgressListener(net.sf.mailsomething.util.ProgressListener) */ public void addProgressListener(ProgressListener l) { // TODO Auto-generated method stub } } |
From: Stig T. <jw...@us...> - 2005-03-20 15:08:28
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20881/net/sf/mailsomething/mail/actions Log Message: Directory /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/actions added to the repository |
From: Stig T. <jw...@us...> - 2005-03-20 15:07:56
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20549/net/sf/mailsomething/mail Modified Files: TransparentMailbox.java RequestHandler.java NntpAccount.java Mailbox.java ImapAccount.java MessageHolder.java MailService.java MailAccount.java MailboxHolder.java PopAccount.java Log Message: Index: ImapAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/ImapAccount.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImapAccount.java 14 Mar 2005 20:27:52 -0000 1.3 --- ImapAccount.java 20 Mar 2005 15:07:40 -0000 1.4 *************** *** 1,4 **** ! package net.sf.mailsomething.mail; import net.sf.mailsomething.mail.parsers.*; --- 1,8 ---- ! package net.sf.mailsomething.mail; + import net.sf.mailsomething.mail.actions.CreateMailboxAction; + import net.sf.mailsomething.mail.actions.DeleteMailboxAction; + import net.sf.mailsomething.mail.actions.GetMessagesAction; [...1894 lines suppressed...] if(tempRequest.getErrorCount() > 3) --- 556,560 ---- * */ ! /*if (tempRequest != null) { if(tempRequest.getErrorCount() > 3) *************** *** 2118,2122 **** } ! } /** --- 569,573 ---- } ! }*/ /** Index: NntpAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/NntpAccount.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NntpAccount.java 3 Apr 2004 07:56:48 -0000 1.1 --- NntpAccount.java 20 Mar 2005 15:07:39 -0000 1.2 *************** *** 18,22 **** public class NntpAccount extends MailAccount ! implements Runnable, Serializable { public static final int FETCH_ALL = 1; --- 18,22 ---- public class NntpAccount extends MailAccount ! implements Serializable { public static final int FETCH_ALL = 1; *************** *** 69,72 **** --- 69,78 ---- } + + + public void addAction(MailAction action) { + + + } public void init() { *************** *** 302,316 **** * @see lib.mail.Hierachy#setFlags(Flags) */ ! public void setFlags(Flags flags) { ! } /** * @see lib.mail.Hierachy#getFlags() */ ! public Flags getFlags() { return null; ! } ! public void handleRequest(Request r) { System.out.println("parserequest"); --- 308,322 ---- * @see lib.mail.Hierachy#setFlags(Flags) */ ! ///public void setFlags(Flags flags) { ! //} /** * @see lib.mail.Hierachy#getFlags() */ ! /*public Flags getFlags() { return null; ! }*/ ! /*public void handleRequest(Request r) { System.out.println("parserequest"); *************** *** 321,327 **** else parseRequest(r); ! } ! protected void parseRequest(Request r) { System.out.println("handlerequest"); --- 327,333 ---- else parseRequest(r); ! }*/ ! /*protected void parseRequest(Request r) { System.out.println("handlerequest"); *************** *** 387,393 **** } ! } ! public void run() { while (1 > 0) { --- 393,399 ---- } ! }*/ ! /*public void run() { while (1 > 0) { *************** *** 421,425 **** * * ! */ Request r = stack.pop(); --- 427,431 ---- * * ! * Request r = stack.pop(); *************** *** 432,436 **** } ! } /** --- 438,442 ---- } ! }*/ /** *************** *** 439,443 **** * */ ! private void updateMessages(Request r) { //System.out.println("update messages nntp account"); --- 445,449 ---- * */ ! /*private void updateMessages(Request r) { //System.out.println("update messages nntp account"); *************** *** 458,462 **** else mailbox.addMessage(messages[i]); ! }*/ if (messages != null) --- 464,468 ---- else mailbox.addMessage(messages[i]); ! }* if (messages != null) *************** *** 468,472 **** } ! } /** --- 474,478 ---- } ! }*/ /** *************** *** 475,479 **** * */ ! private void updateMailboxes(Request r) { if (groupfile == null) { --- 481,485 ---- * */ ! /*private void updateMailboxes(Request r) { if (groupfile == null) { *************** *** 504,508 **** } ! } private String getLastMessageId(String groupname) { --- 510,514 ---- } ! }*/ private String getLastMessageId(String groupname) { Index: RequestHandler.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/RequestHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RequestHandler.java 3 Apr 2004 07:56:48 -0000 1.1 --- RequestHandler.java 20 Mar 2005 15:07:39 -0000 1.2 *************** *** 10,14 **** ! public void handleRequest(Request r); --- 10,17 ---- ! //public void handleRequest(Request r); ! ! ! public void addAction(MailAction action); Index: MailAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAccount.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MailAccount.java 14 Mar 2005 20:27:52 -0000 1.2 --- MailAccount.java 20 Mar 2005 15:07:40 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- import net.sf.mailsomething.util.event.*; + import net.sf.mailsomething.mail.actions.CreateMailboxAction; import net.sf.mailsomething.mail.parsers.SessionHandler; *************** *** 25,29 **** *@created March 24, 2002 */ ! public abstract class MailAccount extends Account implements MailboxHolder, RequestHandler, Serializable { static final long serialVersionUID = 5168002350209084194L; --- 26,32 ---- *@created March 24, 2002 */ ! public abstract class MailAccount extends Account ! implements MailboxHolder, RequestHandler, Serializable, ! Runnable { static final long serialVersionUID = 5168002350209084194L; *************** *** 55,59 **** // the stack of commands waiting. ! protected RequestStack stack; //an alias, being used for the name used for sender, when sending mails... not appropiate for this I guess. --- 58,64 ---- // the stack of commands waiting. ! //protected RequestStack stack; ! ! protected transient Vector actions = new Vector(); //an alias, being used for the name used for sender, when sending mails... not appropiate for this I guess. *************** *** 110,113 **** --- 115,120 ---- + // is the thread running. + protected boolean runthread = true; /** *************** *** 123,127 **** listeners = new Vector(); ! stack = new RequestStack(); } --- 130,134 ---- listeners = new Vector(); ! //stack = new RequestStack(); } *************** *** 142,145 **** --- 149,166 ---- + public void addAction(MailAction action) { + + if (shouldRun()) + actions.add(action); + + else { + + action.setMailAccount(this); + action.invoke(); + } + + } + + /** * returns the mailaddress related to this mailaccount. *************** *** 537,546 **** //some field for read/write access.... if (!mailbox.isRemote() && !mailbox.getName().equals("")) { ! Request r = new Request(Request.CREATE_MAILBOX, this, mailbox.getName()); r.setDismissable(false); ! stack.add(r); } --- 558,571 ---- //some field for read/write access.... if (!mailbox.isRemote() && !mailbox.getName().equals("")) { + + CreateMailboxAction cma = new CreateMailboxAction(mailbox); ! addAction(cma); ! ! /*Request r = new Request(Request.CREATE_MAILBOX, this, mailbox.getName()); r.setDismissable(false); ! stack.add(r);*/ } *************** *** 1202,1205 **** --- 1227,1280 ---- return updateInterval; } + + + /** + * Main processing method for the ImapAccount object + */ + public void run() { + + //make sure this is set. If someone starts the account as a + //thread without calling init (which should only be done (can only) + //once, we need to make sure the thread doesnt stop imediately. + runthread = true; + + /**this is a stupid solution to following problem: request which changes mailbox/messages + * and gui-components which arent initialized proberly. + * Instead there should be some global variable or similar. Eg. wait for a go-signal from the + * main gui-initializer. (SampleGui). + */ + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + } + + //if(controller == null) controller = new ImapController(this); + + while (1 > 0) { + + if (!runthread) { + break; + } + + if (actions.isEmpty()) { + + //controller.hasServerMessages(); + + try { + Thread.sleep(200); + } catch (InterruptedException e) { + } + } else { + MailAction action = (MailAction)actions.remove(0); + + action.setMailAccount(this); + + action.invoke(); + + } + + } + + } Index: MessageHolder.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MessageHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MessageHolder.java 3 Apr 2004 07:56:48 -0000 1.1 --- MessageHolder.java 20 Mar 2005 15:07:40 -0000 1.2 *************** *** 45,49 **** *@param messageid Description of Parameter */ ! public void removeMessage(String messageid); --- 45,49 ---- *@param messageid Description of Parameter */ ! //public void removeMessage(String messageid); *************** *** 57,63 **** /** ! * No need for the old version where inputargument was message and not messageid. One ! * must asume that a message with an equal messageid is the same. This should be removed. ! * or changed with existsUid. If one wants to find/search for a message with a specific field * one should use a search method (which isnt done yet). * --- 57,66 ---- /** ! * No need for the old version where inputargument ! * was message and not messageid. One ! * must asume that a message with an equal messageid ! * is the same. This should be removed. ! * or changed with existsUid. If one wants to ! * find/search for a message with a specific field * one should use a search method (which isnt done yet). * Index: TransparentMailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/TransparentMailbox.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TransparentMailbox.java 12 Mar 2005 15:31:30 -0000 1.2 --- TransparentMailbox.java 20 Mar 2005 15:07:38 -0000 1.3 *************** *** 63,67 **** //for specific session-consistent flags. ! transient Flags flags = null; private int state = 0; --- 63,67 ---- //for specific session-consistent flags. ! //transient Flags flags = null; private int state = 0; *************** *** 224,228 **** *@return The childCount value */ ! public int getChildCount() { if (messages != null) { --- 224,228 ---- *@return The childCount value */ ! /*public int getChildCount() { if (messages != null) { *************** *** 231,235 **** return 0; ! } /** --- 231,235 ---- return 0; ! }*/ /** *************** *** 239,243 **** *@return The child value */ ! public Object getChild(int index) { if (messages != null && index < messages.size()) { --- 239,243 ---- *@return The child value */ ! /*public Object getChild(int index) { if (messages != null && index < messages.size()) { *************** *** 246,250 **** return null; ! } /** --- 246,250 ---- return null; ! }*/ /** *************** *** 253,257 **** *@return The children value */ ! public Object[] getChildren() { if(messages != null) --- 253,257 ---- *@return The children value */ ! /*public Object[] getChildren() { if(messages != null) *************** *** 259,263 **** return new Object[]{}; ! } /** --- 259,263 ---- return new Object[]{}; ! }*/ /** *************** *** 571,575 **** } ! public Flags getFlags() { return flags; } --- 571,575 ---- } ! /*public Flags getFlags() { return flags; } *************** *** 577,581 **** public void setFlags(Flags flags) { this.flags = flags; ! } /** --- 577,581 ---- public void setFlags(Flags flags) { this.flags = flags; ! }*/ /** Index: MailboxHolder.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailboxHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxHolder.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailboxHolder.java 20 Mar 2005 15:07:40 -0000 1.2 *************** *** 47,57 **** ! /** ! * Description of the Method ! * ! *@param mailboxname Description of Parameter ! */ ! public void removeMailbox(String mailboxname); ! /** --- 47,51 ---- ! /** Index: PopAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/PopAccount.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PopAccount.java 14 Mar 2005 20:27:52 -0000 1.2 --- PopAccount.java 20 Mar 2005 15:07:40 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- + import net.sf.mailsomething.mail.actions.GetMessagesAction; import net.sf.mailsomething.mail.parsers.*; *************** *** 24,28 **** */ ! public class PopAccount extends MailAccount implements Serializable, Runnable { static final long serialVersionUID = 8715676360363527320L; --- 25,29 ---- */ ! public class PopAccount extends MailAccount implements Serializable { static final long serialVersionUID = 8715676360363527320L; *************** *** 41,45 **** //is the thread running. ! private boolean runthread = true; //should be transient. --- 42,46 ---- //is the thread running. ! //private boolean runthread = true; //should be transient. *************** *** 183,317 **** } ! /** ! * Handles a request. Normally a client class will not use this, but it ! * is possible to construct a request and call this directly. ! */ ! public void handleRequest(Request r) { ! ! if (shouldRun()) ! stack.add(r); ! ! else ! parseRequest(r); ! ! } ! ! /** ! * Parses and handles a request, dont use this, but handleRequest, it ! * will be protected sooner or later. ! * ! */ ! public void parseRequest(Request r) { ! ! if (controller == null) { ! controller = new PopController(this); ! ! } ! ! if (controller.isConnected()) { ! ! int scheme = r.getAction(); ! ! //System.out.println("popaccount scheme " + scheme); ! ! switch (scheme) { ! case 1 : ! deleteMessage(r); ! break; ! case 2 : ! { ! //deleteMailbox(r); ! ! Mailbox mbox = (Mailbox) r.getObject(); ! ! if (mbox.getParent() != null) { ! ! System.out.println("????" + mbox.getParent()); ! ! if (mbox.getParent().equals("")) { ! ! removeMailbox(mbox); ! ! } else { ! ! Mailbox parent = getMailbox(mbox.getParent()); ! ! parent.removeMailbox(mbox); ! ! } ! ! } else { ! ! String path = mbox.getPath(); ! ! Mailbox parent = ! getMailbox( ! mbox.getPath().substring( ! 0, ! mbox.getPath().lastIndexOf( ! getDelimiter()))); ! ! parent.removeMailbox(mbox); ! ! } ! ! break; ! ! } ! case 3 : ! //createMailbox(r); ! break; ! case 4 : ! //updateMailboxes(r); ! break; ! case 5 : { ! ! ! ! getAllMessages(r); ! ! //clear the timer, this is done basicly if the user ! //or someone else calls this request and at same time ! //the timer is running, so we wont have an update ! //imediately after. ! if(timer != null) { ! ! timer.restart(); ! } ! ! break; ! ! ! } ! case 6 : ! //in case someone calls update all messages ! //getAllMessages(r); ! break; ! case 7 : ! //updateAll(r); ! break; ! case 8 : ! //moveMailbox(r); ! break; ! case 9 : ! //renameMailbox(r); ! break; ! case 11 : ! //this isnt really needed, since u can just do an add (and delete). ! copyMessage(r); ! break; ! case 12 : ! moveMessage(r); ! break; ! } ! } else { ! ! /*should probably popup some menu, eventually asking wether to keep trying ! *to connect. And interval. ! */ ! ! } ! ! } /** --- 184,189 ---- } ! ! /** *************** *** 324,372 **** } ! public void run() { ! ! while (1 > 0) { ! ! //this get reset every time the thread is restarted (which can happen several times) ! if (runthread == false) { ! break; ! } ! ! suspended = false; ! ! //this is set from userinput, and wont get changed automaticly. ! if (suspended) ! break; ! ! if (stack.isEmpty()) { ! //System.out.println("stack is empty"); ! try { ! Thread.sleep(200); ! } catch (InterruptedException e) { ! } ! } else { ! ! /** ! * After changing the delete method to not logoff after deleting ! * it works fast. But, that requires other methods to update ! * uid-list... Instead im thinking that this thread should ! * check stack for several delete requests, and then call a single ! * method which deletes all at once. And then clear uids-list. ! * It would require and improve stack, ie, for searching for ! * several requests of same type. ! * ! * ! * ! */ ! ! Request r = stack.pop(); ! ! parseRequest(r); ! ! } ! ! } ! ! } /** --- 196,200 ---- } ! /** *************** *** 420,424 **** if (m != null) { ! m.updateMessages(ImapAccount.DEFAULT); } --- 248,252 ---- if (m != null) { ! m.updateMessages(GetMessagesAction.DEFAULT); } *************** *** 440,685 **** } ! private void copyMessage(Request r) { ! ! //System.out.println("popaccount copymessage"); ! ! MessageHolder oldmailbox = (MessageHolder) r.getSource(); ! ! MessageHolder nmailbox = (MessageHolder) r.getObject(); ! ! Message clone = (Message) r.getMessage().clone(); ! ! nmailbox.addMessage(clone); ! ! System.out.println("popaccount: clone isremote " + clone.isRemote()); ! } ! ! private void moveMessage(Request r) { ! ! copyMessage(r); ! ! MessageHolder srcMailbox = (MessageHolder) r.getSource(); ! ! Message org = (Message) r.getMessage(); ! ! //System.out.println("popaccount: original isremote " + org.getRemote()); ! ! srcMailbox.removeMessage(r.getMessage()); ! ! } ! ! /** Changed but I have no possibilty of testing online at the moment. ! * See mailbox removeMessage. ! * Ive tried to change it to allow local removing without remote removing, which means that the ! * action of removing the message remote (at server) should be saved in case the program cant ! * connect to server. The old implementation meant, that deleting of non-local messages was impossible ! * which from a designpoint seems logical but from a user-perspective isnt that cool. This changed imple ! * mentation could be called lazy-serverhandling.... It requires 1 thing (especially for imap): that the stack ! * requests are executed sequentially, first in first out. ! * Specifically this is changed, so the mailbox removes the message (from mailbox), and this method dont. ! * This method just handles the server-action, based upon remote/nonremote, and if a message is remote ! * it will stay remote, when its not deleted, even though it appears in another mailbox. This means, u can ! * delete a message, it will be removed to deleted items (and not deleted at server) and then u can delete ! * it at local mailbox (deleted items). The message will still exists though, through the reference in the ! * request. Since the choosing of this method is the mailbox.isremote and not message, the second delete- ! * request will change nothing, because the second delete has a local-mailbox in request. ! */ ! private void deleteMessage(Request r) { ! ! MessageHolder mailbox = (MessageHolder) r.getSource(); ! ! Message message = r.getMessage(); ! ! //this is a stupid way to decide this. ! if (!mailbox.isRemote()) { ! ! MessageHolder trash = getStandardMailbox(Mailbox.TRASH); ! ! if (trash == null) ! return; ! ! //should have a public field TRASH with name of mailbox ! //and a boolean value: deleteFully ! if (mailbox.equals(trash)) { ! ! //here should be a check, if the setting ! //deleteWhenDeletedFromTrash ! //is true, and if so, check if the message exists ! //at server, and then delete it. ! ! return; ! ! } else { ! ! trash.addMessage(message); ! ! return; ! ! } ! ! } else { ! ! String myUID = message.getUID(); ! ! //get the uid-markers (uidmarker = uid + index) ! PopController.UIDMarker[] uids = controller.searchUid(); ! ! for (int i = 0; i < uids.length; i++) { ! //System.out.println(uids[i]); ! if (uids[i] != null) { ! ! if (uids[i].getUID().equals(myUID)) ! controller.deleteMessage(uids[i].getIndex()); ! ! } ! } ! ! message.setRemote(false); ! ! mailbox.removeMessage(message); ! ! MessageHolder trash = getStandardMailbox(Mailbox.TRASH); ! ! if (trash != null) ! trash.addMessage(message); ! ! } ! ! //controller.logof(); ! ! } ! ! /** Searches for uids and compares to current uids at mailbox. And gets those messages ! * that doesnt exists in mailbox. Which means, that if a message gets moved and not deleted ! * for some reason, it will be fetched again. But a move should delete it. ! */ ! private void updateMessages(Request r) { ! ! /*this should probably call a stat, get the difference between first stat ! * and this. and then get those messages. ! * Which will mean that the running thread should always start with a ! * getAllMessages and then a stat ! */ ! } ! ! private void getAllMessages(Request r) { ! ! if (r.getFlag() == 6) ! return; ! ! controller.clearUidBuffer(); ! ! MessageHolder mailbox = getStandardMailbox(Mailbox.INBOX); ! ! PopController.UIDMarker[] uids = controller.searchUid(); ! ! if (uids == null) ! return; ! ! Vector nmessages = new Vector(); ! ! int max = getMaxMessagesToFetch(); ! ! int startfrom = 0; ! ! /** ! * We dont call either notifyMessagesFound since we dont know ! * how many NEW messages is actually found. ! */ ! if (max < uids.length) { ! ! startfrom = uids.length - max; ! ! notifyWorkStarted(max); ! } else ! notifyWorkStarted(uids.length); ! ! int[] sizes = null; ! ! for (int i = startfrom; i < uids.length; i++) { ! ! if (uids[i] != null) { ! //problem here. ! if (!mailbox.existsUid(uids[i].getUID())) { ! ! //dont get the message sizes untill we have a new message ! if (sizes == null) ! sizes = controller.getSizeList(); ! ! //int size = controller.getMessageSize(uids[i].getIndex()); ! ! if (sizes[uids[i].getIndex() - 1] > getMaxMessageSize()) { ! ! Message m = MailService.createMessage(); ! ! m.setUID(uids[i].getUID()); ! ! m.setField(MessageConstants.SUBJECT, "unknown"); ! ! m.setField(MessageConstants.FROM, "unknown"); ! ! String message = ! "The size of this message is bigger than limit," ! + "either change sizelimit or ignore this message" ! + "completely. Some time in future it will be possible" ! + "to fetch the message anyways"; ! ! m.setObject(message.getBytes()); ! ! m.setRemote(true); ! ! m.setSize(sizes[uids[i].getIndex() - 1]); ! ! mailbox.addMessage(m); ! ! nmessages.add(m); ! ! notifyMessagesFetched(mailbox, new Message[] { m }); ! ! //continue; ! ! } else { ! ! Message m = controller.getMessage(uids[i].getIndex()); ! ! m.setRemote(true); ! ! m.setUID(uids[i].getUID()); ! ! m.setBodyFetched(true); ! ! m.setSize(sizes[uids[i].getIndex() - 1]); ! ! mailbox.addMessage(m); ! ! nmessages.add(m); ! ! notifyMessagesFetched(mailbox, new Message[] { m }); ! ! } ! } ! } ! ! notifyWorkProgress(i - startfrom + 1); ! ! } ! ! notifyWorkStopped(); ! ! //int extensions = controller.getExtension(); ! ! //System.out.println("controller supports: " + extensions); ! ! controller.logof(); ! ! //if(nmessages.size() > 0) ! //notifyMessagesFetched(mailbox, (Message[])nmessages.toArray(new Message[]{})); ! ! - } /** --- 268,290 ---- } ! ! ! ! /** ! * @return Returns the controller. ! */ ! public PopController getController() { ! return controller; } ! ! ! ! public void addAction(MailAction action) { ! //TODO } + + /** *************** *** 726,735 **** } ! public void setFlags(Flags flags) { } public Flags getFlags() { return null; ! } public int validateAccount() { --- 331,340 ---- } ! /*public void setFlags(Flags flags) { } public Flags getFlags() { return null; ! }*/ public int validateAccount() { Index: MailService.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailService.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailService.java 14 Mar 2005 20:27:52 -0000 1.3 --- MailService.java 20 Mar 2005 15:07:40 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- import net.sf.mailsomething.core.*; + import net.sf.mailsomething.mail.actions.GetMessagesAction; import net.sf.mailsomething.mail.parsers.*; *************** *** 1346,1350 **** account[i].getStandardMailbox(Mailbox.INBOX); ! inbox.updateMessages(ImapAccount.DEFAULT); } else if (account[i].getProtocol() == MailAccount.IMAP) { --- 1347,1351 ---- account[i].getStandardMailbox(Mailbox.INBOX); ! inbox.updateMessages(GetMessagesAction.DEFAULT); } else if (account[i].getProtocol() == MailAccount.IMAP) { *************** *** 1360,1364 **** //we only update none-hidden mailboxes, ofcourse if ((mm.getState() & Mailbox.HIDDEN) != Mailbox.HIDDEN) ! all[j].updateMessages(ImapAccount.DEFAULT); } catch (ClassCastException f) { --- 1361,1365 ---- //we only update none-hidden mailboxes, ofcourse if ((mm.getState() & Mailbox.HIDDEN) != Mailbox.HIDDEN) ! all[j].updateMessages(GetMessagesAction.DEFAULT); } catch (ClassCastException f) { *************** *** 1366,1370 **** //unlikely to happen ! all[j].updateMessages(ImapAccount.DEFAULT); } --- 1367,1371 ---- //unlikely to happen ! all[j].updateMessages(GetMessagesAction.DEFAULT); } Index: Mailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Mailbox.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mailbox.java 14 Mar 2005 20:27:52 -0000 1.2 --- Mailbox.java 20 Mar 2005 15:07:40 -0000 1.3 *************** *** 6,9 **** --- 6,19 ---- import java.util.Vector; + import net.sf.mailsomething.mail.actions.AppendMessageAction; + import net.sf.mailsomething.mail.actions.CopyMessageAction; + import net.sf.mailsomething.mail.actions.CreateMailboxAction; + import net.sf.mailsomething.mail.actions.DeleteMailboxAction; + import net.sf.mailsomething.mail.actions.DeleteMessageAction; + import net.sf.mailsomething.mail.actions.GetMessagesAction; + import net.sf.mailsomething.mail.actions.MoveMessageAction; + import net.sf.mailsomething.mail.actions.RenameMailboxAction; + import net.sf.mailsomething.mail.actions.UpdateMailboxesAction; + /** * Class implementing a mailbox. The class is build on the request/request *************** *** 89,93 **** //for specific session-consistent flags. ! transient Flags flags = null; private int state = 0; --- 99,103 ---- //for specific session-consistent flags. ! //transient Flags flags = null; private int state = 0; *************** *** 159,188 **** } ! //public void setPath(); /** ! * Sets the name attribute of the Mailbox object * *@param name The new name value */ public void setName(String name) { ! ! System.out.println("setname mailbox " + name); ! ! String oldpath = getPath(); ! ! this.name = name; ! if (remote == true) { ! Request r = new Request(Request.RENAME_MAILBOX, this, oldpath); ! r.setDismissable(false); ! handler.handleRequest(r); } ! MailboxEvent e = new MailboxEvent(this, this, 0); for (int i = 0; i < mailboxListeners.size(); i++) { ((MailboxListener) mailboxListeners.elementAt(i)).mailboxRenamed(e); ! } } --- 169,206 ---- } ! /** ! * Sets the name attribute of the Mailbox object. In case ! * the mailbox is remote this will fire a mailaction to ! * rename the mailbox at server, and the actual local ! * renaming will not happen until the the mailaction ! * is invoked. This means that visual components maybe ! * have to show a 'false' name for the mailbox as long ! * as the renaming isnt finished. * *@param name The new name value */ public void setName(String name) { ! ! if (remote) { ! ! RenameMailboxAction rma = ! new RenameMailboxAction(this, name); ! ! addAction(rma); ! ! } else { ! ! rename(name); ! } ! /*MailboxEvent e = new MailboxEvent(this, this, 0); for (int i = 0; i < mailboxListeners.size(); i++) { ((MailboxListener) mailboxListeners.elementAt(i)).mailboxRenamed(e); ! }*/ } *************** *** 369,373 **** *@return The childCount value */ ! public int getChildCount() { if (messages != null) { --- 387,391 ---- *@return The childCount value */ ! /*public int getChildCount() { if (messages != null) { *************** *** 376,380 **** return mailboxes.size(); ! } /** --- 394,398 ---- return mailboxes.size(); ! }*/ /** *************** *** 384,388 **** *@return The child value */ ! public Object getChild(int index) { if (index < mailboxes.size()) { --- 402,406 ---- *@return The child value */ ! /*public Object getChild(int index) { if (index < mailboxes.size()) { *************** *** 397,401 **** return null; ! } /** --- 415,419 ---- return null; ! }*/ /** *************** *** 404,408 **** *@return The children value */ ! public Object[] getChildren() { Vector all = new Vector(mailboxes); --- 422,426 ---- *@return The children value */ ! /*public Object[] getChildren() { Vector all = new Vector(mailboxes); *************** *** 415,419 **** return buffer; ! } /** --- 433,437 ---- return buffer; ! }*/ /** *************** *** 570,577 **** messages.add(message); //TODO: use the constructor which takes the message //as argument ! Request r = new Request( Request.APPEND_MESSAGE, --- 588,598 ---- messages.add(message); + + AppendMessageAction ama = + new AppendMessageAction(this, message); //TODO: use the constructor which takes the message //as argument ! /*Request r = new Request( Request.APPEND_MESSAGE, *************** *** 579,583 **** message.getField(MessageConstants.MESSAGE_ID)); ! r.setDismissable(false); if (!disableListeners) { --- 600,604 ---- message.getField(MessageConstants.MESSAGE_ID)); ! r.setDismissable(false);*/ if (!disableListeners) { *************** *** 602,606 **** } ! handler.handleRequest(r); } } else { --- 623,629 ---- } ! handler.addAction(ama); ! ! //handler.handleRequest(r); } } else { *************** *** 730,738 **** if (name.equals("") == false) { ! Request r = new Request(Request.CREATE_MAILBOX, this, name); r.setDismissable(false); ! handler.handleRequest(r); } --- 753,765 ---- if (name.equals("") == false) { + + CreateMailboxAction cma = new CreateMailboxAction(mailbox); ! addAction(cma); ! ! /*Request r = new Request(Request.CREATE_MAILBOX, this, name); r.setDismissable(false); ! handler.handleRequest(r);*/ } *************** *** 791,800 **** *@param mailboxname Description of Parameter */ ! public synchronized void removeMailbox(String mailboxname) { Mailbox mailbox = getMailbox(mailboxname); removeMailbox(mailbox); ! } /** --- 818,827 ---- *@param mailboxname Description of Parameter */ ! /*public synchronized void removeMailbox(String mailboxname) { Mailbox mailbox = getMailbox(mailboxname); removeMailbox(mailbox); ! }*/ /** *************** *** 824,830 **** if (message.isRemote()) { ! ! Request r = new Request( this, --- 851,858 ---- if (message.isRemote()) { ! DeleteMessageAction dma = ! new DeleteMessageAction(this, message); ! /*Request r = new Request( this, *************** *** 837,841 **** r.setDismissable(false); ! handler.handleRequest(r); } else { --- 865,869 ---- r.setDismissable(false); ! handler.handleRequest(r);*/ } else { *************** *** 869,878 **** *@param messageid Description of Parameter */ ! public void removeMessage(String messageid) { if (exists(messageid) == false) { return; } removeMessage(getMessage(messageid)); ! } /** --- 897,906 ---- *@param messageid Description of Parameter */ ! /*public void removeMessage(String messageid) { if (exists(messageid) == false) { return; } removeMessage(getMessage(messageid)); ! }*/ /** *************** *** 916,919 **** --- 944,948 ---- */ public Mailbox addMailbox(Mailbox mailbox) { + for (int i = 0; i < mailboxes.size(); i++) { if (mailbox *************** *** 926,940 **** String parent = mailbox.getParent(); ! if (parent == null) { ! mailbox.setParent(getParent() + getDelimiter() + getName()); ! mailbox.setRoot(rootName); ! mailbox.setRequestHandler(handler); ! mailboxes.add(mailbox); ! Request r = new Request(Request.CREATE_MAILBOX, this, mailbox.getName()); r.setDismissable(false); --- 955,973 ---- String parent = mailbox.getParent(); ! //if (parent == null) { ! mailbox.setParent(getParent() + getDelimiter() + getName()); ! mailbox.setRoot(rootName); ! mailbox.setRequestHandler(handler); ! mailboxes.add(mailbox); ! CreateMailboxAction a = new CreateMailboxAction(mailbox); ! ! handler.addAction(a); ! ! /* Request r = new Request(Request.CREATE_MAILBOX, this, mailbox.getName()); r.setDismissable(false); *************** *** 950,954 **** handler.handleRequest(r); ! } MailboxEvent e = new MailboxEvent(this, mailbox, mailboxes.size()); --- 983,987 ---- handler.handleRequest(r); ! }*/ MailboxEvent e = new MailboxEvent(this, mailbox, mailboxes.size()); *************** *** 989,997 **** */ public void updateMailboxes() { ! Request r = new Request(Request.UPDATE_MAILBOXES, this, null); r.setDismissable(true); ! handler.handleRequest(r); } --- 1022,1035 ---- */ public void updateMailboxes() { + + UpdateMailboxesAction uma = + new UpdateMailboxesAction(this); + + handler.addAction(uma); ! /*Request r = new Request(Request.UPDATE_MAILBOXES, this, null); r.setDismissable(true); ! handler.handleRequest(r);*/ } *************** *** 1042,1052 **** */ public void updateMessages(int flag) { ! Request r = null; r = new Request(Request.FETCH, flag, this, RequestStack.URGENT, null); r.setDismissable(true); ! handler.handleRequest(r); } --- 1080,1099 ---- */ public void updateMessages(int flag) { + + GetMessagesAction a = new GetMessagesAction(); + + a.setMailbox(this); + a.setType(flag); + ! /*Request r = null; r = new Request(Request.FETCH, flag, this, RequestStack.URGENT, null); r.setDismissable(true); ! handler.handleRequest(r);*/ ! ! handler.addAction(a); ! } *************** *** 1126,1135 **** */ public void delete() { ! Request r = new Request(Request.DELETE_MAILBOX, this, getPath()); r.setDismissable(false); ! r.setUrgent(true); ! handler.handleRequest(r); } --- 1173,1184 ---- */ public void delete() { + + DeleteMailboxAction dma = new DeleteMailboxAction(getParentMailbox(), this); ! /*Request r = new Request(Request.DELETE_MAILBOX, this, getPath()); r.setDismissable(false); ! r.setUrgent(true);*/ ! handler.addAction(dma); } *************** *** 1145,1159 **** /** ! * This is for strictly copying. A better implementation than for just adding a message to the new mailbox. ! * Warning: A mailbox.copyMessage followed by a mailbox.removeMessage is dangerous. Because of sync. ! * It could happen that the deleteMessage is executed before the copy. To avoid this scenario use the * moveMessage method if thats whats wanted. * *@param message Description of Parameter ! *@param nMailbox Description of Parameter */ ! public void copyMessage(Message message, MessageHolder nMailbox) { ! Request r = new Request( this, --- 1194,1216 ---- /** ! * This is for strictly copying. A better implementation than ! * for just adding a message to the new mailbox. ! * Warning: A mailbox.copyMessage followed by a mailbox.removeMessage ! * is dangerous. Because of sync. ! * It could happen that the deleteMessage is ! * executed before the copy. To avoid this scenario use the * moveMessage method if thats whats wanted. * *@param message Description of Parameter ! *@param destMailbox the destination mailbox */ ! public void copyMessage(Message message, MessageHolder destMailbox) { ! ! CopyMessageAction cma ! = new CopyMessageAction(this, destMailbox, message); ! ! handler.addAction(cma); ! /*Request r = new Request( this, *************** *** 1166,1175 **** r.setUrgent(true); ! handler.handleRequest(r); } ! public void moveMessage(Message message, MessageHolder nMailbox) { ! Request r = new Request( this, --- 1223,1237 ---- r.setUrgent(true); ! handler.handleRequest(r);*/ } ! public void moveMessage(Message message, MessageHolder destMailbox) { ! ! MoveMessageAction mma ! = new MoveMessageAction(this, destMailbox, message); ! ! handler.addAction(mma); ! /*Request r = new Request( this, *************** *** 1182,1186 **** r.setUrgent(true); ! handler.handleRequest(r); } --- 1244,1248 ---- r.setUrgent(true); ! handler.handleRequest(r);*/ } *************** *** 1189,1193 **** //if(allreadySynchronized == true) { ! Request r = new Request( this, --- 1251,1255 ---- //if(allreadySynchronized == true) { ! /*Request r = new Request( this, *************** *** 1200,1207 **** r.setUrgent(true); ! handler.handleRequest(r); } ! public Flags getFlags() { return flags; } --- 1262,1269 ---- r.setUrgent(true); ! handler.handleRequest(r);*/ } ! /*public Flags getFlags() { return flags; } *************** *** 1209,1213 **** public void setFlags(Flags flags) { this.flags = flags; ! } public void setRequestHandler(RequestHandler handler) { --- 1271,1275 ---- public void setFlags(Flags flags) { this.flags = flags; ! }*/ public void setRequestHandler(RequestHandler handler) { *************** *** 1229,1238 **** * */ ! public void handleRequest(Request r) { if (handler != null) handler.handleRequest(r); ! } /** --- 1291,1303 ---- * */ ! /*public void handleRequest(Request r) { if (handler != null) handler.handleRequest(r); ! }*/ ! ! ! /** *************** *** 1290,1293 **** --- 1355,1369 ---- } + + + + + public void addAction(MailAction action) { + + if(handler != null) + handler.addAction(action); + + } + /** *************** *** 1323,1327 **** public void setState(int state) { ! if ((this.state & HIDDEN) != HIDDEN && (state & HIDDEN) == HIDDEN) { Request r = --- 1399,1403 ---- public void setState(int state) { ! /*if ((this.state & HIDDEN) != HIDDEN && (state & HIDDEN) == HIDDEN) { Request r = *************** *** 1338,1342 **** handleRequest(r); ! } this.state = state; --- 1414,1418 ---- handleRequest(r); ! }*/ this.state = state; *************** *** 1348,1352 **** * @param message */ ! public void store(Message message) { System.out.println("calling store on message"); --- 1424,1428 ---- * @param message */ ! /*public void store(Message message) { System.out.println("calling store on message"); *************** *** 1366,1370 **** handler.handleRequest(r); ! } /** --- 1442,1446 ---- handler.handleRequest(r); ! }*/ /** *************** *** 1381,1385 **** * @param disable */ ! protected void disableListeners(boolean disable) { disableListeners = disable; --- 1457,1461 ---- * @param disable */ ! public void disableListeners(boolean disable) { disableListeners = disable; *************** *** 1417,1421 **** * @param name */ ! protected void rename(String name) { this.name = name; --- 1493,1497 ---- * @param name */ ! public void rename(String name) { this.name = name; |
From: Stig T. <jw...@us...> - 2005-03-20 15:07:35
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20472/net/sf/mailsomething/mail Added Files: MailAction.java Log Message: --- NEW FILE: MailAction.java --- package net.sf.mailsomething.mail; import net.sf.mailsomething.util.ProgressListener; /** * @author Stig tanggaard * @since 2005-03-17 * **/ public interface MailAction { public void invoke(); public void undo(); public void setMailAccount(MailAccount account); public void addProgressListener(ProgressListener l); } |
From: Stig T. <jw...@us...> - 2005-03-20 15:07:01
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20165/net/sf/mailsomething/mail Removed Files: Request.java Log Message: --- Request.java DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-20 15:06:28
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19923/net/sf/mailsomething/mail Removed Files: RequestStack.java Log Message: --- RequestStack.java DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-20 15:06:17
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19869/net/sf/mailsomething/mail Removed Files: MailSender.java Log Message: --- MailSender.java DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-20 15:05:55
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19608/net/sf/mailsomething/mail Removed Files: ImapMailboxFlags.java Log Message: --- ImapMailboxFlags.java DELETED --- |