当前位置: 首页>>代码示例>>Java>>正文


Java ISelectionService.addSelectionListener方法代码示例

本文整理汇总了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);
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:18,代码来源:BugExplorerView.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:19,代码来源:BugInfoView.java

示例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);
            }
        }
    }
}
 
开发者ID:Elphel,项目名称:vdt-plugin,代码行数:20,代码来源:SelectedResourceManager.java

示例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);
            }
        }
    }
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:18,代码来源:SelectedResourceManager.java

示例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);
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:11,代码来源:EObjectSelectionListener.java

示例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());
}
 
开发者ID:joakimkistowski,项目名称:LIMBO,代码行数:12,代码来源:DlimEditorPlugin.java

示例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);
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:39,代码来源:MetricsView.java

示例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());
}
 
开发者ID:vobject,项目名称:maru,代码行数:14,代码来源:ContentProvider.java


注:本文中的org.eclipse.ui.ISelectionService.addSelectionListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。