1 19 20 package org.netbeans.modules.tasklist.bugs; 21 22 import java.util.Date ; 23 24 25 import org.netbeans.modules.tasklist.core.*; 26 import org.netbeans.modules.tasklist.core.filter.FilterAction; 27 import org.netbeans.modules.tasklist.core.filter.RemoveFilterAction; 28 import org.openide.util.NbBundle; 29 import org.openide.util.Utilities; 30 import org.openide.util.actions.SystemAction; 31 import org.openide.nodes.Node; 32 33 34 37 public class BugsView extends TaskListView implements TaskListener { 38 39 private static final long serialVersionUID = 1; 40 41 final static String CATEGORY = "bugs"; 43 public BugsView() { 44 this(null); 45 } 46 47 55 public BugsView(BugQuery inQuery) { 56 super( 57 CATEGORY, NbBundle.getMessage(BugsView.class, "ViewName"), Utilities.loadImage( 62 "org/netbeans/modules/tasklist/bugs/bugsView.gif"), 63 true, 64 BugList.getDefault(inQuery)); 65 } 66 67 static final String PROP_BUG_ID = "bugId"; static final String PROP_BUG_SYNOPSIS = "bugSynopsis"; static final String PROP_BUG_PRIO = "bugPrio"; static final String PROP_BUG_TYPE = "bugType"; static final String PROP_BUG_COMP = "bugComp"; static final String PROP_BUG_SUBCOMP = "bugSubComp"; static final String PROP_BUG_CREATED = "bugCreated"; static final String PROP_BUG_KEYWORDS = "bugKeywords"; static final String PROP_BUG_ASSIGNED = "bugAssigned"; static final String PROP_BUG_REPORTEDBY = "bugReported"; static final String PROP_BUG_STATUS = "bugStatus"; static final String PROP_BUG_TARGET = "bugTarget"; static final String PROP_BUG_VOTES = "bugVotes"; 81 82 public ColumnProperty getSummaryColumn(int width) { 83 return new ColumnProperty( 86 0, PROP_TASK_SUMMARY, 88 NbBundle.getMessage(BugsView.class, "Summary"), NbBundle.getMessage(BugsView.class, "Summary"), true, 91 width 92 ); 93 } 94 95 96 public ColumnProperty getSynopsisColumn(boolean visible, int width) { 97 return new ColumnProperty( 98 1, PROP_BUG_SYNOPSIS, 100 String .class, 101 NbBundle.getMessage(BugsView.class, "Synopsis"), NbBundle.getMessage(BugsView.class, "SynopsisHint"), true, 104 visible, 105 width 106 ); 107 } 108 109 110 111 public ColumnProperty getPriorityColumn(boolean visible, int width) { 112 return new ColumnProperty( 113 2, PROP_BUG_PRIO, 115 Integer.TYPE, 116 NbBundle.getMessage(BugsView.class, "Priority"), NbBundle.getMessage(BugsView.class, "PriorityHint"), true, 119 visible, 120 width 121 ); 122 } 123 124 public ColumnProperty getBugIdColumn(boolean visible, int width) { 125 return new ColumnProperty( 126 3, PROP_BUG_ID, 128 String .class, 129 NbBundle.getMessage(BugsView.class, "BugId"), NbBundle.getMessage(BugsView.class, "BugIdHint"), true, 132 visible, 133 width 134 ); 135 } 136 137 public ColumnProperty getTypeColumn(boolean visible, int width) { 138 return new ColumnProperty( 139 4, PROP_BUG_TYPE, 141 String .class, 142 NbBundle.getMessage(BugsView.class, "Type"), NbBundle.getMessage(BugsView.class, "TypeHint"), true, 145 visible, 146 width 147 ); 148 } 149 150 public ColumnProperty getComponentColumn(boolean visible, int width) { 151 return new ColumnProperty( 152 5, PROP_BUG_COMP, 154 String .class, 155 NbBundle.getMessage(BugsView.class, "Component"), NbBundle.getMessage(BugsView.class, "ComponentHint"), true, 158 visible, 159 width 160 ); 161 } 162 163 public ColumnProperty getSubComponentColumn(boolean visible, int width) { 164 return new ColumnProperty( 165 6, PROP_BUG_SUBCOMP, 167 String .class, 168 NbBundle.getMessage(BugsView.class, "SubComponent"), NbBundle.getMessage(BugsView.class, "SubComponentHint"), true, 171 visible, 172 width 173 ); 174 } 175 176 public ColumnProperty getDateColumn(boolean visible, int width) { 177 return new ColumnProperty( 178 7, PROP_BUG_CREATED, 180 Date .class, 181 NbBundle.getMessage(BugsView.class, "Created"), NbBundle.getMessage(BugsView.class, "CreatedHint"), true, 184 visible, 185 width 186 ); 187 } 188 189 public ColumnProperty getKeywordsColumn(boolean visible, int width) { 190 return new ColumnProperty( 191 8, PROP_BUG_KEYWORDS, 193 String .class, 194 NbBundle.getMessage(BugsView.class, "Keywords"), NbBundle.getMessage(BugsView.class, "KeywordsHint"), true, 197 visible, 198 width 199 ); 200 } 201 202 public ColumnProperty getAssignedToColumn(boolean visible, int width) { 203 return new ColumnProperty( 204 9, PROP_BUG_ASSIGNED, 206 String .class, 207 NbBundle.getMessage(BugsView.class, "Assigned"), NbBundle.getMessage(BugsView.class, "AssignedHint"), true, 210 visible, 211 width 212 ); 213 } 214 215 public ColumnProperty getReportedByColumn(boolean visible, int width) { 216 return new ColumnProperty( 217 10, PROP_BUG_REPORTEDBY, 219 String .class, 220 NbBundle.getMessage(BugsView.class, "ReportedBy"), NbBundle.getMessage(BugsView.class, "ReportedByHint"), true, 223 visible, 224 width 225 ); 226 } 227 228 public ColumnProperty getStatusColumn(boolean visible, int width) { 229 return new ColumnProperty( 230 11, PROP_BUG_STATUS, 232 String .class, 233 NbBundle.getMessage(BugsView.class, "Status"), NbBundle.getMessage(BugsView.class, "StatusHint"), true, 236 visible, 237 width 238 ); 239 } 240 241 public ColumnProperty getTargetColumn(boolean visible, int width) { 242 return new ColumnProperty( 243 12, PROP_BUG_TARGET, 245 String .class, 246 NbBundle.getMessage(BugsView.class, "Target"), NbBundle.getMessage(BugsView.class, "TargetHint"), true, 249 visible, 250 width 251 ); 252 } 253 254 public ColumnProperty getVotesColumn(boolean visible, int width) { 255 return new ColumnProperty( 256 13, PROP_BUG_VOTES, 258 Integer.TYPE, 259 NbBundle.getMessage(BugsView.class, "Votes"), NbBundle.getMessage(BugsView.class, "VotesHint"), true, 262 visible, 263 width 264 ); 265 } 266 267 268 269 protected ColumnProperty[] createColumns() { 270 return new ColumnProperty[] { 274 getSummaryColumn(800), 275 276 getBugIdColumn(false, 150), 277 getTypeColumn(false, 100), 278 getComponentColumn(false, 200), 279 getSubComponentColumn(false, 200), 280 getSynopsisColumn(false, 800), 281 getDateColumn(false, 200), 282 getKeywordsColumn(false, 200), 283 getAssignedToColumn(false, 200), 284 getReportedByColumn(false, 200), 285 getStatusColumn(true, 150), 286 getTargetColumn(false, 200), 287 getVotesColumn(false, 100), 288 289 getPriorityColumn(true, 100) 290 291 292 }; 293 }; 294 295 304 305 306 protected Node createRootNode() { 307 return new TaskListNode(getModel()); 308 } 309 310 public org.netbeans.modules.tasklist.core.filter.Filter createFilter() { 311 return null; } 313 314 protected SystemAction[] getToolBarActions() { 315 return new SystemAction[] { 316 SystemAction.get(RefreshAction.class), 317 SystemAction.get(ViewBugAction.class), 318 }; 321 } 322 323 } 324 | Popular Tags |