}
/* Ask for ContentProvider of Viewer */
ContentViewer viewer = fRegistry.get(viewerId);
if (viewer instanceof NewsBrowserViewer && viewer.getContentProvider() != null) {
IStructuredContentProvider newsContentProvider = (IStructuredContentProvider) viewer.getContentProvider();
/* Look for Folders that are to displayed */
int displayFolderIndex = parameters.indexOf(OP_DISPLAY_FOLDER);
if (displayFolderIndex >= 0) {
start = displayFolderIndex + OP_DISPLAY_FOLDER.length();
end = parameters.indexOf('&', start);
if (end < 0)
end = parameters.length();
StringTokenizer tokenizer = new StringTokenizer(parameters.substring(start, end), ",");//$NON-NLS-1$
while (tokenizer.hasMoreElements()) {
FolderReference ref = new FolderReference(Long.valueOf((String) tokenizer.nextElement()));
elements.addAll(Arrays.asList(newsContentProvider.getElements(ref)));
}
}
/* Look for BookMarks that are to displayed */
int displayBookMarkIndex = parameters.indexOf(OP_DISPLAY_BOOKMARK);
if (displayBookMarkIndex >= 0) {
start = displayBookMarkIndex + OP_DISPLAY_BOOKMARK.length();
end = parameters.indexOf('&', start);
if (end < 0)
end = parameters.length();
StringTokenizer tokenizer = new StringTokenizer(parameters.substring(start, end), ",");//$NON-NLS-1$
while (tokenizer.hasMoreElements()) {
BookMarkReference ref = new BookMarkReference(Long.valueOf((String) tokenizer.nextElement()));
elements.addAll(Arrays.asList(newsContentProvider.getElements(ref)));
}
}
/* Look for NewsBins that are to displayed */
int displayNewsBinsIndex = parameters.indexOf(OP_DISPLAY_NEWSBIN);
if (displayNewsBinsIndex >= 0) {
start = displayNewsBinsIndex + OP_DISPLAY_NEWSBIN.length();
end = parameters.indexOf('&', start);
if (end < 0)
end = parameters.length();
StringTokenizer tokenizer = new StringTokenizer(parameters.substring(start, end), ",");//$NON-NLS-1$
while (tokenizer.hasMoreElements()) {
NewsBinReference ref = new NewsBinReference(Long.valueOf((String) tokenizer.nextElement()));
elements.addAll(Arrays.asList(newsContentProvider.getElements(ref)));
}
}
/* Look for SearchMarks that are to displayed */
int displaySearchMarkIndex = parameters.indexOf(OP_DISPLAY_SEARCHMARK);
if (displaySearchMarkIndex >= 0) {
start = displaySearchMarkIndex + OP_DISPLAY_SEARCHMARK.length();
end = parameters.indexOf('&', start);
if (end < 0)
end = parameters.length();
StringTokenizer tokenizer = new StringTokenizer(parameters.substring(start, end), ",");//$NON-NLS-1$
while (tokenizer.hasMoreElements()) {
SearchMarkReference ref = new SearchMarkReference(Long.valueOf((String) tokenizer.nextElement()));
elements.addAll(Arrays.asList(newsContentProvider.getElements(ref)));
}
}
/* Look for News that are to displayed */
int displayNewsIndex = parameters.indexOf(OP_DISPLAY_NEWS);
if (displayNewsIndex >= 0) {
start = displayNewsIndex + OP_DISPLAY_NEWS.length();
end = parameters.indexOf('&', start);
if (end < 0)
end = parameters.length();
StringTokenizer tokenizer = new StringTokenizer(parameters.substring(start, end), ",");//$NON-NLS-1$
while (tokenizer.hasMoreElements()) {
NewsReference ref = new NewsReference(Long.valueOf((String) tokenizer.nextElement()));
elements.addAll(Arrays.asList(newsContentProvider.getElements(ref)));
}
}
}
/* Reply to the Socket */