本文整理汇总了Java中org.eclipse.ui.IWorkingSetManager.addPropertyChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkingSetManager.addPropertyChangeListener方法的具体用法?Java IWorkingSetManager.addPropertyChangeListener怎么用?Java IWorkingSetManager.addPropertyChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IWorkingSetManager
的用法示例。
在下文中一共展示了IWorkingSetManager.addPropertyChangeListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WorkingSetFilterActionGroup
import org.eclipse.ui.IWorkingSetManager; //导入方法依赖的package包/类
public WorkingSetFilterActionGroup(IWorkbenchPartSite site, IPropertyChangeListener changeListener) {
Assert.isNotNull(site);
Assert.isNotNull(changeListener);
fChangeListener= changeListener;
fWorkbenchPage= site.getPage();
fAllowWindowWorkingSetByDefault= true;
fClearWorkingSetAction= new ClearWorkingSetAction(this);
fSelectWorkingSetAction= new SelectWorkingSetAction(this, site);
fEditWorkingSetAction= new EditWorkingSetAction(this, site);
fWorkingSetListener= new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
doPropertyChange(event);
}
};
fWorkingSetFilter= new WorkingSetFilter();
IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager();
manager.addPropertyChangeListener(fWorkingSetListener);
if (useWindowWorkingSetByDefault()) {
setWorkingSet(site.getPage().getAggregateWorkingSet(), false);
}
}
示例2: resetEclipseWorkingSetsBaseOnCurrentState
import org.eclipse.ui.IWorkingSetManager; //导入方法依赖的package包/类
/**
* Resets the state of all Eclipse based working sets that belong to the 'Resources' type.
*/
private void resetEclipseWorkingSetsBaseOnCurrentState() {
try {
if (getWorkbench() == null || getWorkbench().getWorkingSetManager() == null) {
return; // happens during shutdown
}
// Removed listener otherwise due to the Eclipse based working set deletion
// we would delete our content.
getWorkbench().getWorkingSetManager().removePropertyChangeListener(this);
deleteEclipseResourcesWorkingSets();
final IWorkingSetManager manager = getWorkbench().getWorkingSetManager();
for (final WorkingSet workingSet : getAllWorkingSets()) {
if (!OTHERS_WORKING_SET_ID.equals(workingSet.getId())) {
org.eclipse.ui.internal.WorkingSet eclipseWorkingSet = createEclipseWorkingSet(workingSet);
eclipseWorkingSet.setId(WorkingSetManagerModificationStrategy.RESOURCE_WORKING_SET_ID);
manager.addWorkingSet(eclipseWorkingSet);
}
}
} finally {
IWorkbench wb = getWorkbench();
if (wb != null) {
IWorkingSetManager wsm = wb.getWorkingSetManager();
if (wsm != null) { // null-safe re-adding (can be null during shutdown)
wsm.addPropertyChangeListener(this);
}
}
}
}