本文整理汇总了Java中org.eclipse.jface.viewers.IPostSelectionProvider.addPostSelectionChangedListener方法的典型用法代码示例。如果您正苦于以下问题:Java IPostSelectionProvider.addPostSelectionChangedListener方法的具体用法?Java IPostSelectionProvider.addPostSelectionChangedListener怎么用?Java IPostSelectionProvider.addPostSelectionChangedListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.IPostSelectionProvider
的用法示例。
在下文中一共展示了IPostSelectionProvider.addPostSelectionChangedListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: setupSelectionListener
import org.eclipse.jface.viewers.IPostSelectionProvider; //导入方法依赖的package包/类
private void setupSelectionListener(final IPostSelectionProvider postSelectionProvider) {
final ISelectionChangedListener listener = new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
setSelection(event.getSelection());
}
};
postSelectionProvider.addPostSelectionChangedListener(listener);
totalComposite.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
postSelectionProvider.removePostSelectionChangedListener(listener);
}
});
}
示例4: follow
import org.eclipse.jface.viewers.IPostSelectionProvider; //导入方法依赖的package包/类
/**
* Make this EnsembleSelectionProvider to listen to the
* provided ISelectionProvider for changes.
*
* @see leave
* @param provider
*/
public void follow(ISelectionProvider provider) {
if (provider instanceof IPostSelectionProvider) {
IPostSelectionProvider postProvider = (IPostSelectionProvider) provider;
postProvider.addPostSelectionChangedListener(selectionChangedListener);
} else {
provider.addSelectionChangedListener(selectionChangedListener);
}
}
示例5: 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 the selection provider
*/
public void install(ISelectionProvider selectionProvider) {
if (selectionProvider == null)
return;
if (selectionProvider instanceof IPostSelectionProvider) {
IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
provider.addPostSelectionChangedListener(this);
} else {
selectionProvider.addSelectionChangedListener(this);
}
}
示例6: addListener
import org.eclipse.jface.viewers.IPostSelectionProvider; //导入方法依赖的package包/类
/**
* Add the selection changed listener
*
* @param selectionProvider
*/
private void addListener(ISelectionProvider selectionProvider, ISelectionChangedListener listener) {
if (selectionProvider instanceof IPostSelectionProvider) {
IPostSelectionProvider provider= (IPostSelectionProvider) selectionProvider;
provider.addPostSelectionChangedListener(listener);
} else {
selectionProvider.addSelectionChangedListener(listener);
}
}