return OwlUI.getImageDescriptor("icons/etool16/filter_active.gif"); //$NON-NLS-1$
}
};
bookmarkFilter.setId(FILTER_ACTION);
bookmarkFilter.setMenuCreator(new IMenuCreator() {
public void dispose() {}
public Menu getMenu(Control parent) {
Menu menu = new Menu(parent);
/* Filter: None */
final MenuItem showAll = new MenuItem(menu, SWT.RADIO);
showAll.setText("Show All");
showAll.setSelection(BookMarkFilter.Type.SHOW_ALL == fBookMarkFilter.getType());
menu.setDefaultItem(showAll);
showAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (showAll.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_ALL)
doFilter(BookMarkFilter.Type.SHOW_ALL);
}
});
/* Separator */
new MenuItem(menu, SWT.SEPARATOR);
/* Filter: New */
final MenuItem showNew = new MenuItem(menu, SWT.RADIO);
showNew.setText("Show New");
showNew.setSelection(BookMarkFilter.Type.SHOW_NEW == fBookMarkFilter.getType());
showNew.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (showNew.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_NEW)
doFilter(BookMarkFilter.Type.SHOW_NEW);
}
});
/* Filter: Unread */
final MenuItem showUnread = new MenuItem(menu, SWT.RADIO);
showUnread.setText("Show Unread");
showUnread.setSelection(BookMarkFilter.Type.SHOW_UNREAD == fBookMarkFilter.getType());
showUnread.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (showUnread.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_UNREAD)
doFilter(BookMarkFilter.Type.SHOW_UNREAD);
}
});
/* Filter: Sticky */
final MenuItem showSticky = new MenuItem(menu, SWT.RADIO);
showSticky.setText("Show Sticky");
showSticky.setSelection(BookMarkFilter.Type.SHOW_STICKY == fBookMarkFilter.getType());
showSticky.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (showSticky.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_STICKY)
doFilter(BookMarkFilter.Type.SHOW_STICKY);
}
});
/* Separator */
new MenuItem(menu, SWT.SEPARATOR);
/* Filter: Erroneous */
final MenuItem showErroneous = new MenuItem(menu, SWT.RADIO);
showErroneous.setText("Show Erroneous");
showErroneous.setSelection(BookMarkFilter.Type.SHOW_ERRONEOUS == fBookMarkFilter.getType());
showErroneous.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (showErroneous.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_ERRONEOUS)
doFilter(BookMarkFilter.Type.SHOW_ERRONEOUS);
}
});
/* Filter: Never Visited */
final MenuItem showNeverVisited = new MenuItem(menu, SWT.RADIO);
showNeverVisited.setText("Show Never Visited");
showNeverVisited.setSelection(BookMarkFilter.Type.SHOW_NEVER_VISITED == fBookMarkFilter.getType());
showNeverVisited.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (showNeverVisited.getSelection() && fBookMarkFilter.getType() != BookMarkFilter.Type.SHOW_NEVER_VISITED)
doFilter(BookMarkFilter.Type.SHOW_NEVER_VISITED);
}
});
return menu;
}
public Menu getMenu(Menu parent) {
return null;
}
});
fToolBarManager.add(bookmarkFilter);
/* Bookmark Group */
fToolBarManager.add(new Separator());
final IAction bookmarkGroup = new Action("Group Bookmarks", IAction.AS_DROP_DOWN_MENU) {
@Override
public void run() {
/* Restore Default */
if (fBookMarkGrouping.getType() != BookMarkGrouping.Type.NO_GROUPING)
doGrouping(BookMarkGrouping.Type.NO_GROUPING);
/* Show Menu */
else
getMenuCreator().getMenu(fToolBarManager.getControl()).setVisible(true);
}
@Override
public ImageDescriptor getImageDescriptor() {
if (fBookMarkGrouping.getType() == BookMarkGrouping.Type.NO_GROUPING)
return OwlUI.getImageDescriptor("icons/etool16/group.gif"); //$NON-NLS-1$
return OwlUI.getImageDescriptor("icons/etool16/group_active.gif"); //$NON-NLS-1$
}
};
bookmarkGroup.setId(GROUP_ACTION);
bookmarkGroup.setMenuCreator(new IMenuCreator() {
public void dispose() {}
public Menu getMenu(Control parent) {
Menu menu = new Menu(parent);