當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。