use of org.eclipse.ui.internal.navigator.NavigatorContentService in project liferay-ide by liferay.
the class PortletResourcesContentProvider method refresh.
public void refresh() {
NavigatorContentService s = (NavigatorContentService) getConfig().getService();
Runnable runnable = new Runnable() {
public void run() {
try {
CommonViewer viewer = (CommonViewer) s.getViewer();
TreePath[] paths = viewer.getExpandedTreePaths();
viewer.refresh(true);
viewer.setExpandedTreePaths(paths);
} catch (Exception e) {
}
}
};
UIUtil.sync(runnable);
}
use of org.eclipse.ui.internal.navigator.NavigatorContentService in project translationstudio8 by heartsome.
the class WorkingSetsContentProvider method init.
/* (non-Javadoc)
* @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
*/
public void init(ICommonContentExtensionSite aConfig) {
NavigatorContentService cs = (NavigatorContentService) aConfig.getService();
viewer = (CommonViewer) cs.getViewer();
projectExplorer = viewer.getCommonNavigator();
extensionStateModel = aConfig.getExtensionStateModel();
extensionStateModel.addPropertyChangeListener(rootModeListener);
updateRootMode();
}
use of org.eclipse.ui.internal.navigator.NavigatorContentService in project tmdm-studio-se by Talend.
the class MDMNavigatorDecoratingLabelProvider method getToolTipText.
@Override
public String getToolTipText(Object element) {
if (getViewer() instanceof CommonViewer) {
CommonViewer viewer = (CommonViewer) getViewer();
INavigatorContentService contentService = viewer.getNavigatorContentService();
if (contentService != null && contentService instanceof NavigatorContentService) {
Collection<?> contentExtensions = ((NavigatorContentService) contentService).findPossibleLabelExtensions(element);
for (Iterator<?> itr = contentExtensions.iterator(); itr.hasNext(); ) {
Object extension = itr.next();
if (extension instanceof NavigatorContentExtension) {
ICommonLabelProvider provider = ((NavigatorContentExtension) extension).getLabelProvider();
if (provider instanceof CellLabelProvider) {
String toolTipText = ((CellLabelProvider) provider).getToolTipText(element);
if (toolTipText != null) {
return toolTipText;
}
}
}
}
}
}
return super.getToolTipText(element);
}
use of org.eclipse.ui.internal.navigator.NavigatorContentService in project liferay-ide by liferay.
the class UIUtil method refreshContent.
public static void refreshContent(ICommonContentExtensionSite site, Object elementOrTreePath) {
NavigatorContentService s = (NavigatorContentService) site.getService();
sync(new Runnable() {
public void run() {
try {
CommonViewer viewer = (CommonViewer) s.getViewer();
viewer.refresh(true);
viewer.setExpandedState(elementOrTreePath, true);
} catch (Exception e) {
}
}
});
}
Aggregations