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


Java IWorkingSet.isEmpty方法代码示例

本文整理汇总了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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaSearchScopeFactory.java

示例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.
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:JavaSearchScopeFactory.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:JavaSearchScopeFactory.java

示例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.
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:JavaSearchScopeFactory.java

示例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);
	// }
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:FilteredTypesSelectionDialog.java

示例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);
			}
		}
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:38,代码来源:WorkingSetActionProvider.java

示例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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:45,代码来源:TypeSelectionComponent.java


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