當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。