Lines 175-180
Link Here
|
175 |
}); |
175 |
}); |
176 |
} |
176 |
} |
177 |
|
177 |
|
|
|
178 |
/** |
179 |
* Create MarkSeenAction for supplied nodes. |
180 |
* |
181 |
* <p>If one of the nodes does not support Status Handling, the action |
182 |
* is not created and null is returned!</p> |
183 |
* |
184 |
* @param nodes |
185 |
* @return |
186 |
*/ |
178 |
static MarkSeenAction createAction(TreeListNode... nodes) { |
187 |
static MarkSeenAction createAction(TreeListNode... nodes) { |
179 |
List<IssueImpl> tasks = new ArrayList<IssueImpl>(); |
188 |
List<IssueImpl> tasks = new ArrayList<IssueImpl>(); |
180 |
for (TreeListNode n : nodes) { |
189 |
for (TreeListNode n : nodes) { |
Lines 184-197
Link Here
|
184 |
return null; |
193 |
return null; |
185 |
} |
194 |
} |
186 |
} |
195 |
} |
|
|
196 |
boolean statusSupported = true; |
187 |
boolean setAsSeen = false; |
197 |
boolean setAsSeen = false; |
188 |
for (IssueImpl issue : tasks) { |
198 |
for (IssueImpl issue : tasks) { |
|
|
199 |
if (!issue.hasStatus()) { |
200 |
statusSupported = false; |
201 |
} |
189 |
if (!issue.getStatus().equals(IssueStatusProvider.Status.SEEN)) { |
202 |
if (!issue.getStatus().equals(IssueStatusProvider.Status.SEEN)) { |
190 |
setAsSeen = true; |
203 |
setAsSeen = true; |
191 |
} |
204 |
} |
192 |
} |
205 |
} |
|
|
206 |
if(! statusSupported) { |
207 |
return null; |
208 |
} else { |
193 |
return new MarkSeenAction(setAsSeen, tasks); |
209 |
return new MarkSeenAction(setAsSeen, tasks); |
194 |
} |
210 |
} |
|
|
211 |
} |
195 |
|
212 |
|
196 |
private ProgressHandle getProgress() { |
213 |
private ProgressHandle getProgress() { |
197 |
return ProgressHandleFactory.createHandle(NbBundle.getMessage(Actions.class, setAsSeen ? "LBL_MarkSeenAllProgress" : "LBL_MarkUnseenAllProgress"), new Cancellable() { |
214 |
return ProgressHandleFactory.createHandle(NbBundle.getMessage(Actions.class, setAsSeen ? "LBL_MarkSeenAllProgress" : "LBL_MarkUnseenAllProgress"), new Cancellable() { |
Lines 407-413
Link Here
|
407 |
setCategoryAction.setEnabled(false); |
424 |
setCategoryAction.setEnabled(false); |
408 |
} |
425 |
} |
409 |
|
426 |
|
410 |
actions.add(getScheduleAction(taskNodes)); |
427 |
Action scheduleAction = getScheduleAction(taskNodes); |
|
|
428 |
if(scheduleAction != null) { |
429 |
actions.add(scheduleAction); |
430 |
} |
411 |
//actions.add(new NotificationTaskAction(taskNodes)); |
431 |
//actions.add(new NotificationTaskAction(taskNodes)); |
412 |
return actions; |
432 |
return actions; |
413 |
} |
433 |
} |
Lines 471-477
Link Here
|
471 |
} |
491 |
} |
472 |
} |
492 |
} |
473 |
|
493 |
|
|
|
494 |
/** |
495 |
* Create action for changing scheduling info for supplied nodes. |
496 |
* |
497 |
* <p> |
498 |
* If one of the nodes does not support schedule handling, the action is not |
499 |
* created and null is returned!</p> |
500 |
* |
501 |
* @param nodes |
502 |
* @return |
503 |
*/ |
474 |
private static Action getScheduleAction(final TaskNode... taskNodes) { |
504 |
private static Action getScheduleAction(final TaskNode... taskNodes) { |
|
|
505 |
// Check the selected nodes - if one of the selected nodes does not |
506 |
// support scheduling - don't offer it in the menu |
507 |
for(TaskNode tn: taskNodes) { |
508 |
if(! tn.getTask().hasSchedule()) { |
509 |
return null; |
510 |
} |
511 |
} |
512 |
|
475 |
IssueScheduleInfo schedule = null; |
513 |
IssueScheduleInfo schedule = null; |
476 |
if (taskNodes.length == 1) { |
514 |
if (taskNodes.length == 1) { |
477 |
schedule = taskNodes[0].getTask().getSchedule(); |
515 |
schedule = taskNodes[0].getTask().getSchedule(); |
Lines 838-843
Link Here
|
838 |
public static List<Action> getQueryPopupActions(QueryNode... queryNodes) { |
876 |
public static List<Action> getQueryPopupActions(QueryNode... queryNodes) { |
839 |
boolean editPossible = true; |
877 |
boolean editPossible = true; |
840 |
boolean openPossible = true; |
878 |
boolean openPossible = true; |
|
|
879 |
boolean deletePossible = true; |
841 |
|
880 |
|
842 |
for (QueryNode queryNode : queryNodes) { |
881 |
for (QueryNode queryNode : queryNodes) { |
843 |
QueryImpl q = queryNode.getQuery(); |
882 |
QueryImpl q = queryNode.getQuery(); |
Lines 847-860
Link Here
|
847 |
if (!q.providesMode(QueryController.QueryMode.VIEW)) { |
886 |
if (!q.providesMode(QueryController.QueryMode.VIEW)) { |
848 |
openPossible = false; |
887 |
openPossible = false; |
849 |
} |
888 |
} |
850 |
if (!editPossible && !openPossible) { |
889 |
if (!q.canRemove()) { |
|
|
890 |
deletePossible = false; |
891 |
} |
892 |
if (!editPossible && !openPossible && !deletePossible) { |
851 |
break; |
893 |
break; |
852 |
} |
894 |
} |
853 |
} |
895 |
} |
854 |
List<Action> actions = new ArrayList<Action>(); |
896 |
List<Action> actions = new ArrayList<Action>(); |
|
|
897 |
if(editPossible) { |
855 |
actions.add(new EditQueryAction(queryNodes)); |
898 |
actions.add(new EditQueryAction(queryNodes)); |
|
|
899 |
} |
900 |
if(openPossible) { |
856 |
actions.add(new OpenQueryAction(queryNodes)); |
901 |
actions.add(new OpenQueryAction(queryNodes)); |
|
|
902 |
} |
903 |
if(deletePossible) { |
857 |
actions.add(new DeleteQueryAction(queryNodes)); |
904 |
actions.add(new DeleteQueryAction(queryNodes)); |
|
|
905 |
} |
858 |
//actions.add(new NotificationQueryAction(queryNodes)); |
906 |
//actions.add(new NotificationQueryAction(queryNodes)); |
859 |
return actions; |
907 |
return actions; |
860 |
} |
908 |
} |