本文整理汇总了Java中org.eclipse.ui.ISelectionService.addSelectionListener方法的典型用法代码示例。如果您正苦于以下问题:Java ISelectionService.addSelectionListener方法的具体用法?Java ISelectionService.addSelectionListener怎么用?Java ISelectionService.addSelectionListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.ISelectionService
的用法示例。
在下文中一共展示了ISelectionService.addSelectionListener方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPartControl
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Add selection listener to detect click in problems view or in tree
// view
ISelectionService theService = getSite().getWorkbenchWindow().getSelectionService();
selectionListener = new MarkerSelectionListener(this) {
@Override
public void selectionChanged(IWorkbenchPart thePart, ISelection theSelection) {
selectionInProgress = true;
super.selectionChanged(thePart, theSelection);
selectionInProgress = false;
}
};
theService.addSelectionListener(selectionListener);
getCommonViewer().addSelectionChangedListener(this);
}
示例2: createRootControl
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
@Override
public Composite createRootControl(Composite parent) {
createRootComposite(parent);
createAnnotationList(rootComposite);
// initScrolledComposite(parent);
createBrowser(rootComposite);
// Add selection listener to detect click in problems view or bug tree
// view
ISelectionService theService = getSite().getWorkbenchWindow().getSelectionService();
selectionListener = new MarkerSelectionListener(this);
theService.addSelectionListener(selectionListener);
return rootComposite;
}
示例3: windowActivated
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
public void windowActivated(IWorkbenchWindow window) {
fWindowStack.remove(window);
fWindowStack.push(window);
ISelectionService service = window.getSelectionService();
service.addSelectionListener(this);
IWorkbenchPage page = window.getActivePage();
if (page != null) {
IWorkbenchPart part = page.getActivePart();
if (part != null) {
ISelection selection = service.getSelection();
if (selection != null) {
selectionChanged(part, selection);
}
}
}
}
示例4: windowActivated
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
/**
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
public void windowActivated(IWorkbenchWindow window) {
ISelectionService service = window.getSelectionService();
service.addSelectionListener(this);
IWorkbenchPage page = window.getActivePage();
if (page != null) {
IWorkbenchPart part = page.getActivePart();
if (part != null) {
ISelection selection = service.getSelection();
if (selection != null) {
selectionChanged(part, selection);
}
}
}
}
示例5: EObjectSelectionListener
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
public EObjectSelectionListener() {
IWorkbench _workbench = PlatformUI.getWorkbench();
final IWorkbenchWindow workbenchWindow = _workbench.getActiveWorkbenchWindow();
final ISelectionService selectionService = workbenchWindow.getSelectionService();
selectionService.addSelectionListener(this);
IWorkbenchPage _activePage = workbenchWindow.getActivePage();
IWorkbenchPart _activePart = _activePage.getActivePart();
ISelection _selection = selectionService.getSelection();
this.selectionChanged(_activePart, _selection);
}
示例6: start
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
/**
* @generated not
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
ISelectionService service = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
service.addSelectionListener(new DLIMSelectionListener());
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(new DLIMWorkbenchPartListener());
}
示例7: createPartControl
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
/**
* Create contents of the view part.
*
* @param parent
* the parent
*/
@Override
public void createPartControl(Composite parent) {
metricViewActive = prefStore.getBoolean(Constants.METRICS_VIEW_ACTIVE);
Activator.getDefault().getPreferenceStore()
.addPropertyChangeListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty() == Constants.METRICS_VIEW_ACTIVE) {
metricViewActive = (Boolean) event.getNewValue();
pauseAction.setChecked(metricViewActive);
}
}
});
Composite topContainer = new Composite(parent, SWT.FILL);
topContainer.setLayout(new FillLayout(SWT.HORIZONTAL));
tabFolder = new TabFolder(topContainer, SWT.BOTTOM);
createRawOutputTab(tabFolder);
createActions();
initializeToolBar();
initializeMenu();
ISelectionService selectionService = getSite().getWorkbenchWindow()
.getSelectionService();
selectionService.addSelectionListener(this);
}
示例8: ContentProvider
import org.eclipse.ui.ISelectionService; //导入方法依赖的package包/类
public ContentProvider()
{
selectionListeners = new ArrayList<>();
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
ISelectionService service = window.getSelectionService();
service.addSelectionListener(new CurrentSelectionListener());
scenarioModelListener = new ScenarioModelListener();
addProjectSelectionListener(UiProjectModelManager.getDefault());
}