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


Java IPostSelectionProvider类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.IPostSelectionProvider的典型用法代码示例。如果您正苦于以下问题:Java IPostSelectionProvider类的具体用法?Java IPostSelectionProvider怎么用?Java IPostSelectionProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IPostSelectionProvider类属于org.eclipse.jface.viewers包,在下文中一共展示了IPostSelectionProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TexlipseAnnotationUpdater

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * Creates a new TexlipseAnnotationUpdater and adds itself to the TexEditor via
 * <code>addPostSelectionChangedListener</code>
 * @param editor The TexEditor
 */
public TexlipseAnnotationUpdater (AbstractTextEditor editor) {
    //Add this listener to the current editors IPostSelectionListener (lazy update)
    ((IPostSelectionProvider) editor.getSelectionProvider()).addPostSelectionChangedListener(this);
    fEditor = editor;
    fEnabled = TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(
            TexlipseProperties.TEX_EDITOR_ANNOTATATIONS);
    
    //Add a PropertyChangeListener
    TexlipsePlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new  
            IPropertyChangeListener() {
        
        public void propertyChange(PropertyChangeEvent event) {    
            String property = event.getProperty();
            if (TexlipseProperties.TEX_EDITOR_ANNOTATATIONS.equals(property)) {
                boolean enabled = TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(
                                TexlipseProperties.TEX_EDITOR_ANNOTATATIONS);
                fEnabled = enabled;
            }
        }
    });
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:27,代码来源:TexlipseAnnotationUpdater.java

示例2: setSelectionProviderDelegate

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * Sets a new selection provider to delegate to. Selection listeners registered with the previous delegate
 * are removed before.
 * 
 * @param newDelegate
 *            new selection provider
 */
public void setSelectionProviderDelegate(ISelectionProvider newDelegate) {
	if (delegate != newDelegate) {
		if (delegate != null) {
			delegate.removeSelectionChangedListener(selectionListener);
			if (delegate instanceof IPostSelectionProvider) {
				((IPostSelectionProvider)delegate).removePostSelectionChangedListener(
						postSelectionListener);
			}
		}
		delegate = newDelegate;
		if (newDelegate != null) {
			newDelegate.addSelectionChangedListener(selectionListener);
			if (newDelegate instanceof IPostSelectionProvider) {
				((IPostSelectionProvider)newDelegate).addPostSelectionChangedListener(
						postSelectionListener);
			}
			fireSelectionChanged(newDelegate.getSelection());
			firePostSelectionChanged(newDelegate.getSelection());
		}
	}
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:29,代码来源:SelectionProviderIntermediate.java

示例3: setSelectionProvider

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * The <code>MultiPageEditorSite</code> implementation of this <code>IWorkbenchPartSite</code> method remembers the
 * selection provider, and also hooks a listener on it, which calls <code>handleSelectionChanged</code> when a
 * selection changed event occurs.
 * 
 * @param provider
 *          The selection provider.
 * @see MultiPageEditorSite#handleSelectionChanged(SelectionChangedEvent)
 */
public void setSelectionProvider(ISelectionProvider provider) {
	ISelectionProvider oldSelectionProvider = selectionProvider;
	selectionProvider = provider;
	if (oldSelectionProvider != null) {
		oldSelectionProvider.removeSelectionChangedListener(getSelectionChangedListener());
		if (oldSelectionProvider instanceof IPostSelectionProvider) {
			((IPostSelectionProvider) oldSelectionProvider)
					.removePostSelectionChangedListener(getPostSelectionChangedListener());
		} else {
			oldSelectionProvider.removeSelectionChangedListener(getPostSelectionChangedListener());
		}
	}
	if (selectionProvider != null) {
		selectionProvider.addSelectionChangedListener(getSelectionChangedListener());
		if (selectionProvider instanceof IPostSelectionProvider) {
			((IPostSelectionProvider) selectionProvider).addPostSelectionChangedListener(getPostSelectionChangedListener());
		} else {
			selectionProvider.addSelectionChangedListener(getPostSelectionChangedListener());
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:31,代码来源:MultiPageToolbarEditorSite.java

示例4: setSelectionProviderDelegate

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * Sets a new selection provider to delegate to. Selection listeners registered with the
 * previous delegate are removed before.
 * 
 * @param newDelegate
 *            new selection provider
 */
public void setSelectionProviderDelegate(ISelectionProvider newDelegate){
	if (delegate == newDelegate) {
		return;
	}
	if (delegate != null) {
		delegate.removeSelectionChangedListener(selectionListener);
		if (delegate instanceof IPostSelectionProvider) {
			((IPostSelectionProvider) delegate)
				.removePostSelectionChangedListener(postSelectionListener);
		}
	}
	delegate = newDelegate;
	if (newDelegate != null) {
		newDelegate.addSelectionChangedListener(selectionListener);
		if (newDelegate instanceof IPostSelectionProvider) {
			((IPostSelectionProvider) newDelegate)
				.addPostSelectionChangedListener(postSelectionListener);
		}
		fireSelectionChanged(newDelegate.getSelection());
		firePostSelectionChanged(newDelegate.getSelection());
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:30,代码来源:DelegatingSelectionProvider.java

示例5: setSelectionProvider

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * Sets a new {@link ISelectionProvider} for this
 * {@link SwitchingSelectionProvider}. Any {@link ISelectionChangedListener}
 * s that are registered with this {@link SwitchingSelectionProvider} will
 * receive {@link SelectionChangedEvent}s. The new
 * {@link ISelectionProvider} may be <code>null</code>.
 *
 * @param selectionProvider
 *        a new {@link ISelectionProvider} to use (may be <code>null</code>)
 */
public void setSelectionProvider(final ISelectionProvider selectionProvider) {
    synchronized (currentWrappedProviderLock) {
        if (currentWrappedProvider != null) {
            currentWrappedProvider.removeSelectionChangedListener(selectionChangedListener);
            if (currentWrappedProvider instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider) currentWrappedProvider).removePostSelectionChangedListener(
                    postSelectionChangedListener);
            }
        }

        currentWrappedProvider = selectionProvider;

        if (selectionProvider != null) {
            selectionProvider.addSelectionChangedListener(selectionChangedListener);
            if (selectionProvider instanceof IPostSelectionProvider) {
                ((IPostSelectionProvider) selectionProvider).addPostSelectionChangedListener(
                    postSelectionChangedListener);
            }
        }

        final ISelection selection =
            (selectionProvider != null ? selectionProvider.getSelection() : StructuredSelection.EMPTY);
        selectionChangedListener.fireChildListeners(selection);
        postSelectionChangedListener.fireChildListeners(selection);
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:37,代码来源:SwitchingSelectionProvider.java

示例6: disconnect

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
protected void disconnect() {
	if(editor != null) {
		if (editor.getSelectionProvider() instanceof IPostSelectionProvider) {
			((IPostSelectionProvider) editor.getSelectionProvider()).removePostSelectionChangedListener(this);
		}
		editor.getSite().getPage().removePartListener(partListener);
		editor = null;
		document = null;
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:11,代码来源:AnnotateView.java

示例7: connect

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
private void connect() {
	Assert.isNotNull(fCurrentTarget);
	ITextViewer viewer = fCurrentTarget.getViewer();
	Assert.isNotNull(viewer);
	fCurrentTarget.fWidget = viewer.getTextWidget();
	if (fCurrentTarget.fWidget == null)
		leave(ILinkedModeListener.EXIT_ALL);

	if (fCurrentTarget.fKeyListener == null) {
		fCurrentTarget.fKeyListener = new KeyListener();
		((ITextViewerExtension) viewer).prependVerifyKeyListener(fCurrentTarget.fKeyListener);
	} else
		fCurrentTarget.fKeyListener.setEnabled(true);

	registerAutoEditVetoer(viewer);

	((IPostSelectionProvider) viewer).addPostSelectionChangedListener(fSelectionListener);

	createAnnotationModel();

	showSelection();

	fCurrentTarget.fShell = fCurrentTarget.fWidget.getShell();
	if (fCurrentTarget.fShell == null)
		leave(ILinkedModeListener.EXIT_ALL);
	fCurrentTarget.fShell.addShellListener(fCloser);

	fAssistant.install(viewer);

	viewer.addTextInputListener(fCloser);

	viewer.getDocument().addDocumentListener(fDocumentListener);
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:34,代码来源:TweakedLinkedModeUI.java

示例8: disconnect

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
private void disconnect() {
	Assert.isNotNull(fCurrentTarget);
	ITextViewer viewer = fCurrentTarget.getViewer();
	Assert.isNotNull(viewer);

	viewer.getDocument().removeDocumentListener(fDocumentListener);

	fAssistant.uninstall();
	fAssistant.removeProposalListener(fProposalListener);

	fCurrentTarget.fWidget = null;

	Shell shell = fCurrentTarget.fShell;
	fCurrentTarget.fShell = null;

	if (shell != null && !shell.isDisposed())
		shell.removeShellListener(fCloser);

	// this one is asymmetric: we don't install the model in
	// connect, but leave it to its callers to ensure they
	// have the model installed if they need it
	uninstallAnnotationModel(fCurrentTarget);

	unregisterAutoEditVetoer(viewer);

	// don't remove the verify key listener to let it keep its position
	// in the listener queue
	if (fCurrentTarget.fKeyListener != null)
		fCurrentTarget.fKeyListener.setEnabled(false);

	((IPostSelectionProvider) viewer).removePostSelectionChangedListener(fSelectionListener);

	redraw();
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:35,代码来源:TweakedLinkedModeUI.java

示例9: createPartControl

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/** 
 * Create the part control.
 * 
 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 */
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    // enable projection support (for code folder)
    ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
    fProjectionSupport = new ProjectionSupport(projectionViewer,
            getAnnotationAccess(), getSharedColors());
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
    fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
    fProjectionSupport.install();

    if (TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.CODE_FOLDING)) {
    	projectionViewer.doOperation(ProjectionViewer.TOGGLE);
    }
    
    fAnnotationUpdater = new TexlipseAnnotationUpdater(this);
    
    ((IPostSelectionProvider) getSelectionProvider()).addPostSelectionChangedListener(
            new ISelectionChangedListener(){
                public void selectionChanged(SelectionChangedEvent event) {
                    //Delete all StatuslineErrors after selection changes
                    documentModel.removeStatusLineErrorMessage();
                }
            });

    // register documentModel as documentListener
    // in initializeEditor this would cause NPE
    this.getDocumentProvider().getDocument(getEditorInput()).addDocumentListener(this.documentModel);
    this.documentModel.initializeModel();
    this.documentModel.updateNow();

    ISourceViewer sourceViewer = getSourceViewer();
    if (sourceViewer instanceof ITextViewerExtension) {
        if (fBracketInserter == null)
            fBracketInserter = new BracketInserter(getSourceViewer(), this);
        ((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(fBracketInserter);
    }
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:43,代码来源:TexEditor.java

示例10: install

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * Installs this selection changed listener with the given selection
 * provider. If the selection provider is a post selection provider,
 * post selection changed events are the preferred choice, otherwise
 * normal selection changed events are requested.
 *
 * @param selectionProvider
 */
public void install(ISelectionProvider selectionProvider) {
	if (selectionProvider == null)
		return;

	if (selectionProvider instanceof IPostSelectionProvider) {
		IPostSelectionProvider provider = (IPostSelectionProvider) selectionProvider;
		provider.addPostSelectionChangedListener(this);
	} else {
		selectionProvider.addSelectionChangedListener(this);
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:20,代码来源:JavaScriptLightWeightEditor.java

示例11: uninstall

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
/**
 * Removes this selection changed listener from the given selection
 * provider.
 *
 * @param selectionProvider
 *            the selection provider
 */
public void uninstall(ISelectionProvider selectionProvider) {
	if (selectionProvider == null)
		return;

	if (selectionProvider instanceof IPostSelectionProvider) {
		IPostSelectionProvider provider = (IPostSelectionProvider) selectionProvider;
		provider.removePostSelectionChangedListener(this);
	} else {
		selectionProvider.removeSelectionChangedListener(this);
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:19,代码来源:JavaScriptLightWeightEditor.java

示例12: activate

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
public void activate(OutlinePage outlinePage) {
	this.outlinePage = outlinePage;
	treeViewer = outlinePage.getTreeViewer();
	treeListener = new TreeListener();
	treeViewer.addPostSelectionChangedListener(treeListener);
	treeViewer.addDoubleClickListener(treeListener);
	textViewer = outlinePage.getSourceViewer();
	textListener = new TextListener();
	ISelectionProvider textSelectionProvider = textViewer.getSelectionProvider();
	if (textSelectionProvider instanceof IPostSelectionProvider)
		((IPostSelectionProvider) textSelectionProvider).addPostSelectionChangedListener(textListener);
	else
		textSelectionProvider.addSelectionChangedListener(textListener);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:OutlineWithEditorLinker.java

示例13: deactivate

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
public void deactivate() {
	ISelectionProvider textSelectionProvider = textViewer.getSelectionProvider();
	if (textSelectionProvider instanceof IPostSelectionProvider)
		((IPostSelectionProvider) textSelectionProvider).removePostSelectionChangedListener(textListener);
	else
		textSelectionProvider.removeSelectionChangedListener(textListener);
	textListener = null;
	textViewer = null;
	treeViewer.removePostSelectionChangedListener(treeListener);
	treeViewer.removeDoubleClickListener(treeListener);
	treeViewer = null;
	treeListener = null;
	outlinePage = null;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:OutlineWithEditorLinker.java

示例14: installSelectionChangedListener

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
private void installSelectionChangedListener() {
	selectionChangedListener = new ISelectionChangedListener() {
		public void selectionChanged(final SelectionChangedEvent event) {
			updateStatusLine();
		}
	};
	final ISelectionProvider selectionProvider = getSelectionProvider();
	if (selectionProvider instanceof IPostSelectionProvider) {
		final IPostSelectionProvider postSelectionProvider = (IPostSelectionProvider) selectionProvider;
		postSelectionProvider.addPostSelectionChangedListener(selectionChangedListener);
	} else {
		getSelectionProvider().addSelectionChangedListener(selectionChangedListener);
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:XtextEditor.java

示例15: uninstallSelectionChangedListener

import org.eclipse.jface.viewers.IPostSelectionProvider; //导入依赖的package包/类
private void uninstallSelectionChangedListener() {
	ISelectionProvider selectionProvider = getSelectionProvider();
	if (selectionProvider != null) {
		if (selectionProvider instanceof IPostSelectionProvider) {
			final IPostSelectionProvider postSelectionProvider = (IPostSelectionProvider) selectionProvider;
			postSelectionProvider.removePostSelectionChangedListener(selectionChangedListener);
		} else {
			selectionProvider.removeSelectionChangedListener(selectionChangedListener);
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:XtextEditor.java


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