1 package org.columba.addressbook.gui.tree; 19 20 import javax.swing.JComponent ; 21 import javax.swing.tree.TreePath ; 22 23 import org.columba.addressbook.folder.AbstractFolder; 24 import org.columba.addressbook.gui.focus.FocusManager; 25 import org.columba.addressbook.gui.focus.FocusOwner; 26 import org.columba.addressbook.gui.frame.AddressbookFrameController; 27 28 33 public class TreeController implements FocusOwner { 34 35 TreeView view; 36 37 AddressbookFrameController frameController; 38 39 42 public TreeController(AddressbookFrameController frameController) { 43 super(); 44 this.frameController = frameController; 45 46 view = new TreeView(frameController); 47 48 FocusManager.getInstance().registerComponent(this); 50 } 51 52 55 public TreeView getView() { 56 return view; 57 } 58 59 62 public AddressbookFrameController getFrameController() { 63 return frameController; 64 } 65 66 public AbstractFolder getSelectedFolder() { 67 return (AbstractFolder) getView().getLastSelectedPathComponent(); 68 } 69 70 public void setSelectedFolder(AbstractFolder folder) { 71 getView().clearSelection(); 72 73 TreePath path = new TreePath (folder.getPath()); 74 75 getView().setSelectionPath(path); 76 } 77 78 79 80 83 public void copy() { 84 85 } 86 87 90 public void cut() { 91 92 } 93 94 97 public void delete() { 98 99 } 100 101 104 public JComponent getComponent() { 105 return getView(); 106 } 107 108 111 public boolean isCopyActionEnabled() { 112 113 return false; 114 } 115 116 119 public boolean isCutActionEnabled() { 120 121 return false; 122 } 123 124 127 public boolean isDeleteActionEnabled() { 128 129 return false; 130 } 131 132 135 public boolean isPasteActionEnabled() { 136 137 return false; 138 } 139 140 143 public boolean isRedoActionEnabled() { 144 145 return false; 146 } 147 148 151 public boolean isSelectAllActionEnabled() { 152 153 return false; 154 } 155 156 159 public boolean isUndoActionEnabled() { 160 161 return false; 162 } 163 164 167 public void paste() { 168 169 } 170 171 174 public void redo() { 175 176 } 177 178 181 public void selectAll() { 182 183 } 184 185 188 public void undo() { 189 190 } 191 } | Popular Tags |