return item;
}
private void createConditionMenu(Menu menu, SearchConditionItem item) {
IModelFactory factory = Owl.getModelFactory();
String news = INews.class.getName();
MenuItem mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("Entire News");
hookSelectionListener(mItem, item, factory.createSearchField(IEntity.ALL_FIELDS, news));
mItem = new MenuItem(menu, SWT.SEPARATOR);
mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("State");
hookSelectionListener(mItem, item, factory.createSearchField(INews.STATE, news));
mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("Location");
hookSelectionListener(mItem, item, factory.createSearchField(INews.LOCATION, news));
new MenuItem(menu, SWT.SEPARATOR);
mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("Title");
hookSelectionListener(mItem, item, factory.createSearchField(INews.TITLE, news));
mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("Description");
hookSelectionListener(mItem, item, factory.createSearchField(INews.DESCRIPTION, news));
mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("Author");
hookSelectionListener(mItem, item, factory.createSearchField(INews.AUTHOR, news));
mItem = new MenuItem(menu, SWT.PUSH);
mItem.setText("Category");
hookSelectionListener(mItem, item, factory.createSearchField(INews.CATEGORIES, news));
mItem = new MenuItem(menu, SWT.CASCADE);
mItem.setText("Date");
Menu dateMenu = new Menu(mItem);
mItem.setMenu(dateMenu);
mItem = new MenuItem(dateMenu, SWT.PUSH);
mItem.setText("Date Modified");
hookSelectionListener(mItem, item, factory.createSearchField(INews.MODIFIED_DATE, news));
mItem = new MenuItem(dateMenu, SWT.PUSH);
mItem.setText("Date Published");
hookSelectionListener(mItem, item, factory.createSearchField(INews.PUBLISH_DATE, news));
mItem = new MenuItem(dateMenu, SWT.PUSH);
mItem.setText("Date Received");
hookSelectionListener(mItem, item, factory.createSearchField(INews.RECEIVE_DATE, news));
new MenuItem(dateMenu, SWT.SEPARATOR);
mItem = new MenuItem(dateMenu, SWT.PUSH);
mItem.setText("Age in Days");
hookSelectionListener(mItem, item, factory.createSearchField(INews.AGE_IN_DAYS, news));
mItem = new MenuItem(menu, SWT.SEPARATOR);
mItem = new MenuItem(menu, SWT.CASCADE);
mItem.setText("Other");
Menu otherMenu = new Menu(mItem);
mItem.setMenu(otherMenu);
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Has Attachments");
hookSelectionListener(mItem, item, factory.createSearchField(INews.HAS_ATTACHMENTS, news));
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Attachment");
hookSelectionListener(mItem, item, factory.createSearchField(INews.ATTACHMENTS_CONTENT, news));
new MenuItem(otherMenu, SWT.SEPARATOR);
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Source");
hookSelectionListener(mItem, item, factory.createSearchField(INews.SOURCE, news));
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Link");
hookSelectionListener(mItem, item, factory.createSearchField(INews.LINK, news));
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Is Sticky");
hookSelectionListener(mItem, item, factory.createSearchField(INews.IS_FLAGGED, news));
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Feed");
hookSelectionListener(mItem, item, factory.createSearchField(INews.FEED, news));
mItem = new MenuItem(otherMenu, SWT.PUSH);
mItem.setText("Label");
hookSelectionListener(mItem, item, factory.createSearchField(INews.LABEL, news));
}