use of org.eclipse.jface.action.IStatusLineManager in project iobserve-analysis by research-iobserve.
the class cloudprofileEditor method getContentOutlinePage.
/**
* This accesses a cached version of the content outliner.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
if (contentOutlinePage == null) {
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
contentOutlineViewer = getTreeViewer();
contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
createContextMenuFor(contentOutlineViewer);
if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
contentOutlineStatusLineManager = statusLineManager;
}
@Override
public void setActionBars(IActionBars actionBars) {
super.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, actionBars);
}
}
contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
public void selectionChanged(SelectionChangedEvent event) {
handleContentOutlineSelection(event.getSelection());
}
});
}
return contentOutlinePage;
}
use of org.eclipse.jface.action.IStatusLineManager in project translationstudio8 by heartsome.
the class XLIFFEditorImplWithNatTable method getProgressMonitor.
/**
* 返回与此编辑器相关的进度监视器。
* @return 与此编辑器相关的进度监视器
*/
protected IProgressMonitor getProgressMonitor() {
IProgressMonitor pm = null;
IStatusLineManager manager = getStatusLineManager();
if (manager != null)
pm = manager.getProgressMonitor();
return pm != null ? pm : new NullProgressMonitor();
}
use of org.eclipse.jface.action.IStatusLineManager in project tdi-studio-se by Talend.
the class SWTResourceFilteredTree method updateStatusLine.
/**
* Updates the status line.
*
* @param resourceElements The SWT resource elements
*/
public void updateStatusLine(ISWTResourceElement[] resourceElements) {
IStatusLineManager manager = actionBars.getStatusLineManager();
IContributionItem[] items = manager.getItems();
StatusLineContributionItem resourceCountContributionItem = null;
for (IContributionItem item : items) {
if (item instanceof StatusLineContributionItem) {
resourceCountContributionItem = (StatusLineContributionItem) item;
}
}
// create the status line
if (resourceCountContributionItem == null) {
//$NON-NLS-1$
resourceCountContributionItem = new StatusLineContributionItem("ResourceCountContributionItem");
manager.add(resourceCountContributionItem);
}
if (resourceElements == null) {
resourceCountContributionItem.setText(Util.ZERO_LENGTH_STRING);
return;
}
Map<String, Integer> resources = new HashMap<String, Integer>();
for (ISWTResourceElement resourceElement : resourceElements) {
//$NON-NLS-1$
String name = resourceElement.getName().split(" ")[0];
Integer count = resources.get(name);
resources.put(name, count == null ? 1 : ++count);
}
// set text on status line
List<String> list = new ArrayList<String>(resources.keySet());
Collections.sort(list);
StringBuffer buffer = new StringBuffer();
//$NON-NLS-1$
buffer.append("Total: ").append(resourceElements.length);
for (String name : list) {
//$NON-NLS-1$
buffer.append(", ").append(name);
//$NON-NLS-1$
buffer.append(": ").append(resources.get(name));
}
resourceCountContributionItem.setText(buffer.toString());
}
use of org.eclipse.jface.action.IStatusLineManager in project tdi-studio-se by Talend.
the class AbstractJvmPropertySection method clearStatusLine.
/**
* Clears the status line.
*/
public void clearStatusLine() {
IStatusLineManager manager = propertySheet.getViewSite().getActionBars().getStatusLineManager();
IContributionItem[] items = manager.getItems();
for (IContributionItem item : items) {
if (item instanceof StatusLineContributionItem) {
((StatusLineContributionItem) item).setText(Util.ZERO_LENGTH_STRING);
}
}
}
use of org.eclipse.jface.action.IStatusLineManager in project eclipse.platform.text by eclipse.
the class AbstractTextEditor method getProgressMonitor.
/**
* Returns the progress monitor related to this editor. It should not be
* necessary to extend this method.
*
* @return the progress monitor related to this editor
* @since 2.1
*/
protected IProgressMonitor getProgressMonitor() {
IProgressMonitor pm = null;
IStatusLineManager manager = getStatusLineManager();
if (manager != null)
pm = manager.getProgressMonitor();
return pm != null ? pm : new NullProgressMonitor();
}
Aggregations