use of org.eclipse.ui.views.IViewRegistry in project knime-core by knime.
the class KNIMEApplicationActionBarAdvisor method createViewAction.
private OpenKnimeViewAction createViewAction(final String viewId) {
IViewRegistry viewReg = PlatformUI.getWorkbench().getViewRegistry();
IViewDescriptor vDesc = viewReg.find(viewId);
if (vDesc == null) {
return null;
}
if (!vDesc.getAllowMultiple()) {
// views that cannot be instantiated multiple times are ignored
return null;
}
OpenKnimeViewAction result = new OpenKnimeViewAction(viewId);
result.setText(vDesc.getLabel());
result.setImageDescriptor(vDesc.getImageDescriptor());
return result;
}
use of org.eclipse.ui.views.IViewRegistry in project mdw-designer by CenturyLinkCloud.
the class ShowViewMenu method getItem.
@SuppressWarnings({ "unchecked", "rawtypes" })
private CommandContributionItemParameter getItem(String viewId) {
IViewRegistry viewReg = Activator.getDefault().getWorkbench().getViewRegistry();
IViewDescriptor viewDesc = viewReg.find(viewId);
if (viewDesc == null)
return null;
String label = viewDesc.getLabel();
CommandContributionItemParameter parms = new PluginCCIP(viewDesc, window, viewId, IWorkbenchCommandConstants.VIEWS_SHOW_VIEW, CommandContributionItem.STYLE_PUSH);
parms.label = label;
parms.icon = viewDesc.getImageDescriptor();
parms.parameters = new HashMap();
parms.parameters.put("org.eclipse.ui.views.showView.viewId", viewId);
return parms;
}
Aggregations