本文整理汇总了Java中org.eclipse.ui.IWorkingSet.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkingSet.isEmpty方法的具体用法?Java IWorkingSet.isEmpty怎么用?Java IWorkingSet.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IWorkingSet
的用法示例。
在下文中一共展示了IWorkingSet.isEmpty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJavaSearchScope
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public IJavaSearchScope createJavaSearchScope(IWorkingSet[] workingSets, int includeMask) {
if (workingSets == null || workingSets.length < 1) return EMPTY_SCOPE;
Set<IJavaElement> javaElements = new HashSet<IJavaElement>(workingSets.length * 10);
for (int i = 0; i < workingSets.length; i++) {
IWorkingSet workingSet = workingSets[i];
if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) {
return createWorkspaceScope(includeMask);
}
addJavaElements(javaElements, workingSet);
}
return createJavaSearchScope(javaElements, includeMask);
}
示例2: addJavaElements
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private void addJavaElements(Set<IJavaElement> javaElements, IWorkingSet workingSet) {
if (workingSet == null) return;
if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) {
try {
IJavaProject[] projects =
JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
javaElements.addAll(Arrays.asList(projects));
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return;
}
IAdaptable[] elements = workingSet.getElements();
for (int i = 0; i < elements.length; i++) {
IJavaElement javaElement = (IJavaElement) elements[i].getAdapter(IJavaElement.class);
if (javaElement != null) {
addJavaElements(javaElements, javaElement);
continue;
}
IResource resource = (IResource) elements[i].getAdapter(IResource.class);
if (resource != null) {
addJavaElements(javaElements, resource);
}
// else we don't know what to do with it, ignore.
}
}
示例3: createJavaSearchScope
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
public IJavaSearchScope createJavaSearchScope(IWorkingSet[] workingSets, int includeMask) {
if (workingSets == null || workingSets.length < 1)
return EMPTY_SCOPE;
Set<IJavaElement> javaElements= new HashSet<IJavaElement>(workingSets.length * 10);
for (int i= 0; i < workingSets.length; i++) {
IWorkingSet workingSet= workingSets[i];
if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) {
return createWorkspaceScope(includeMask);
}
addJavaElements(javaElements, workingSet);
}
return createJavaSearchScope(javaElements, includeMask);
}
示例4: addJavaElements
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private void addJavaElements(Set<IJavaElement> javaElements, IWorkingSet workingSet) {
if (workingSet == null)
return;
if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) {
try {
IJavaProject[] projects= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
javaElements.addAll(Arrays.asList(projects));
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
return;
}
IAdaptable[] elements= workingSet.getElements();
for (int i= 0; i < elements.length; i++) {
IJavaElement javaElement=(IJavaElement) elements[i].getAdapter(IJavaElement.class);
if (javaElement != null) {
addJavaElements(javaElements, javaElement);
continue;
}
IResource resource= (IResource)elements[i].getAdapter(IResource.class);
if (resource != null) {
addJavaElements(javaElements, resource);
}
// else we don't know what to do with it, ignore.
}
}
示例5: restoreDialog
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
@Override
protected void restoreDialog(IDialogSettings settings) {
super.restoreDialog(settings);
if (! BUG_184693) {
boolean showContainer= settings.getBoolean(SHOW_CONTAINER_FOR_DUPLICATES);
fShowContainerForDuplicatesAction.setChecked(showContainer);
fTypeInfoLabelProvider.setContainerInfo(showContainer);
} else {
fTypeInfoLabelProvider.setContainerInfo(true);
}
if (fAllowScopeSwitching) {
String setting= settings.get(WORKINGS_SET_SETTINGS);
if (setting != null) {
try {
IMemento memento= XMLMemento.createReadRoot(new StringReader(setting));
fFilterActionGroup.restoreState(memento);
} catch (WorkbenchException e) {
// don't do anything. Simply don't restore the settings
JavaPlugin.log(e);
}
}
IWorkingSet ws= fFilterActionGroup.getWorkingSet();
if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
setSearchScope(SearchEngine.createWorkspaceScope());
setSubtitle(null);
} else {
setSearchScope(JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true));
setSubtitle(ws.getLabel());
}
}
// TypeNameMatch[] types = OpenTypeHistory.getInstance().getTypeInfos();
//
// for (int i = 0; i < types.length; i++) {
// TypeNameMatch type = types[i];
// accessedHistoryItem(type);
// }
}
示例6: setWorkingSet
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
/**
* Set current active working set.
*
* @param workingSet
* working set to be activated, may be <code>null</code>
*/
protected void setWorkingSet(IWorkingSet workingSet) {
this.workingSet = workingSet;
emptyWorkingSet = workingSet != null && workingSet.isAggregateWorkingSet() && workingSet.isEmpty();
ignoreFilterChangeEvents = true;
try {
workingSetActionGroup.setWorkingSet(workingSet);
} finally {
ignoreFilterChangeEvents = false;
}
if (viewer != null) {
setWorkingSetFilter(workingSet);
if (workingSet == null || emptyWorkingSet
|| !extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS)) {
if (viewer.getInput() != originalViewerInput) {
viewer.setInput(originalViewerInput);
} else {
viewer.refresh();
}
} else {
if (!workingSet.isAggregateWorkingSet()) {
IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
viewer.setInput(workingSetManager.createAggregateWorkingSet(
"", "", new IWorkingSet[] { workingSet })); //$NON-NLS-1$ //$NON-NLS-2$
} else {
viewer.setInput(workingSet);
}
}
}
}
示例7: fillViewMenu
import org.eclipse.ui.IWorkingSet; //导入方法依赖的package包/类
private void fillViewMenu(IMenuManager viewMenu) {
if (!fMultipleSelection) {
ToggleStatusLineAction showStatusLineAction= new ToggleStatusLineAction();
showStatusLineAction.setChecked(fSettings.getBoolean(SHOW_STATUS_LINE));
viewMenu.add(showStatusLineAction);
}
FullyQualifyDuplicatesAction fullyQualifyDuplicatesAction= new FullyQualifyDuplicatesAction();
fullyQualifyDuplicatesAction.setChecked(fSettings.getBoolean(FULLY_QUALIFY_DUPLICATES));
viewMenu.add(fullyQualifyDuplicatesAction);
if (fScope == null) {
fFilterActionGroup= new WorkingSetFilterActionGroup(getShell(),
JavaPlugin.getActivePage(),
new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
IWorkingSet ws= (IWorkingSet)event.getNewValue();
if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
fScope= SearchEngine.createWorkspaceScope();
fTitleLabel.setText(null);
} else {
fScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true);
fTitleLabel.setText(ws.getLabel());
}
fViewer.setSearchScope(fScope, true);
}
});
String setting= fSettings.get(WORKINGS_SET_SETTINGS);
if (setting != null) {
try {
IMemento memento= XMLMemento.createReadRoot(new StringReader(setting));
fFilterActionGroup.restoreState(memento);
} catch (WorkbenchException e) {
}
}
IWorkingSet ws= fFilterActionGroup.getWorkingSet();
if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
fScope= SearchEngine.createWorkspaceScope();
fTitleLabel.setText(null);
} else {
fScope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true);
fTitleLabel.setText(ws.getLabel());
}
fFilterActionGroup.fillViewMenu(viewMenu);
}
}