There are 3 code examples for org.eclipse.ui.IWorkbenchWindowActionDelegate.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: rssowl.ui Package: org.rssowl.ui.internal
Source Code: CoolBarAdvisor.java (Click to view .java file)
Method Code:
private void initWithExplorerSelectionAndRunAction(IWorkbenchWindowActionDelegate action){
action.init(fWindow);
IFolder folder=OwlUI.getBookMarkExplorerSelection();
if (folder != null) action.selectionChanged(null,new StructuredSelection(folder));
action.run(null);
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: NewsBrowserViewer.java (Click to view .java file)
Method Code:
private void handleNavigateAction(final String id){
if (!isHeadlinesLayout() && fPageSize != 0 && (NEXT_NEWS_HANDLER_ID.equals(id) || NEXT_UNREAD_NEWS_HANDLER_ID.equals(id))) {
boolean onlyUnread=NEXT_UNREAD_NEWS_HANDLER_ID.equals(id);
int totalNewsCount=fViewModel.getNewsCount();
int visibleNewsCount=fViewModel.getVisibleNewsCount();
if (totalNewsCount != 0 && totalNewsCount > visibleNewsCount) {
long firstHiddenNewsId=fViewModel.getFirstHiddenNews(onlyUnread);
if (firstHiddenNewsId != -1) {
showSelection(new StructuredSelection(new NewsReference(firstHiddenNewsId)));
return;
}
}
}
delayInUI(new Runnable(){
public void run(){
NavigationActionFactory factory=new NavigationActionFactory();
try {
NavigationActionFactory.NavigationActionType type=null;
if (NEXT_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.NEXT_FEED_NEXT_NEWS;
else if (NEXT_UNREAD_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.NEXT_UNREAD_FEED_NEXT_UNREAD_NEWS;
else if (PREVIOUS_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.PREVIOUS_FEED_PREVIOUS_NEWS;
else if (PREVIOUS_UNREAD_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.PREVIOUS_UNREAD_FEED_PREVIOUS_UNREAD_NEWS;
if (type != null) {
factory.setInitializationData(null,null,type.getId());
IWorkbenchWindowActionDelegate action=(IWorkbenchWindowActionDelegate)factory.create();
action.run(null);
}
}
catch ( CoreException e) {
}
}
}
);
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: NewsBrowserViewer.java (Click to view .java file)
Method Code:
public void run(){
NavigationActionFactory factory=new NavigationActionFactory();
try {
NavigationActionFactory.NavigationActionType type=null;
if (NEXT_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.NEXT_FEED_NEXT_NEWS;
else if (NEXT_UNREAD_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.NEXT_UNREAD_FEED_NEXT_UNREAD_NEWS;
else if (PREVIOUS_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.PREVIOUS_FEED_PREVIOUS_NEWS;
else if (PREVIOUS_UNREAD_NEWS_HANDLER_ID.equals(id)) type=NavigationActionFactory.NavigationActionType.PREVIOUS_UNREAD_FEED_PREVIOUS_UNREAD_NEWS;
if (type != null) {
factory.setInitializationData(null,null,type.getId());
IWorkbenchWindowActionDelegate action=(IWorkbenchWindowActionDelegate)factory.create();
action.run(null);
}
}
catch ( CoreException e) {
}
}