本文整理汇总了Java中org.netbeans.spi.tasklist.TaskScanningScope类的典型用法代码示例。如果您正苦于以下问题:Java TaskScanningScope类的具体用法?Java TaskScanningScope怎么用?Java TaskScanningScope使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaskScanningScope类属于org.netbeans.spi.tasklist包,在下文中一共展示了TaskScanningScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
@Override
public synchronized void setScope (TaskScanningScope scope, Callback callback) {
//cancel all current operations:
cancelAllCurrent();
this.scope = scope;
this.callback = callback;
if (scope == null || callback == null)
return ;
for (FileObject file : scope.getLookup().lookupAll(FileObject.class)) {
enqueue(new Work(file, callback));
}
for (Project p : scope.getLookup().lookupAll(Project.class)) {
enqueue(new Work(p, callback));
}
}
示例2: setScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
@Override
public void setScope(TaskScanningScope scope, Callback callback) {
this.callback = callback;
if (scope == null) {
// ignore; for example project switch when ctx menu is displayed
// sets scope to null, then back to the project scope to force refresh/reload
return;
}
synchronized (this) {
boolean newScanning = !callback.isCurrentEditorScope();
if (!callback.isObserved()) {
scope = null;
newScanning = false;
}
this.scope = scope;
if (!callback.isObserved() || callback.isCurrentEditorScope() ||
!newScanning || wasScanning == newScanning || !seenByTlIndexer) {
wasScanning = newScanning;
seenByTlIndexer = false;
return;
}
wasScanning = newScanning;
seenByTlIndexer = false;
IndexingManager.getDefault().refreshAllIndices(TLIndexerFactory.INDEXER_NAME);
}
}
示例3: doRefresh
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
private void doRefresh( TaskScanningScope scopeToRefresh ) {
synchronized( this ) {
if( this.scope.equals( scopeToRefresh ) ) {
taskList.clear();
if( isObserved() ) {
for( PushTaskScanner scanner : ScannerList.getPushScannerList().getScanners() ) {
scanner.setScope( null, null );
if( getFilter().isEnabled( scanner ) )
scanner.setScope( scopeToRefresh, Accessor.createCallback( this, scanner ) );
}
boolean dirtyCache = NbPreferences.forModule(TaskManagerImpl.class).getBoolean("dirtyCache", false);
if (dirtyCache && isCurrentEditorScope()) {
cacheCurrentEditorFile();
} else {
startLoading();
}
}
}
}
}
示例4: setScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
@Override
public void setScope(TaskScanningScope scope, Callback callback) {
cancelAllCurrent();
if (scope == null || callback == null)
return ;
final Set<FileObject> files = new WeakSet<FileObject>();
for (FileObject file : scope.getLookup().lookupAll(FileObject.class)) {
files.add(file);
}
for (Project p : scope.getLookup().lookupAll(Project.class)) {
for (SourceGroup javaSG : ProjectUtils.getSources(p).getSourceGroups("java")) { //NOI18N
files.add(javaSG.getRootFolder());
}
}
for (FileObject fo : files) {
enqueue(new Work(fo, callback));
}
synchronized (this) {
currentFiles = files;
currentCallback = callback;
}
}
示例5: setScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
@Override
public synchronized void setScope(TaskScanningScope scope, Callback callback) {
//cancel all current operations:
cancelAllCurrent();
this.scope = scope;
this.callback = callback;
if (scope == null || callback == null)
return ;
for (FileObject file : scope.getLookup().lookupAll(FileObject.class)) {
enqueue(new Work(file, callback));
}
for (Project p : scope.getLookup().lookupAll(Project.class)) {
for (SourceGroup generic : ProjectUtils.getSources(p).getSourceGroups(Sources.TYPE_GENERIC)) {
for (FileObject root : Utilities.findIndexedRootsUnderDirectory(p, generic.getRootFolder())) {
enqueue(new Work(root, callback));
}
}
}
}
示例6: doSetScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
private void doSetScope(TaskScanningScope scope, Callback callback) {
if (task == null) {
task = new RequestProcessor(HudsonScanner.class).create(this);
task.setPriority(Thread.MIN_PRIORITY);
}
if (scope == null) {
LOG.fine("canceling scan");
task.cancel();
if (taskThread != null) {
taskThread.interrupt();
}
return;
}
this.scope = scope;
this.callback = callback;
// XXX also support individual FileObject scope
if (scope.getLookup().lookup(Project.class) == null) { // shortcut
LOG.finer("no projects to scan");
callback.clearAllTasks();
return;
}
LOG.fine("scheduling scan");
task.schedule(1000);
}
示例7: rebuildToolbar
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
private void rebuildToolbar() {
toolbar.removeAll();
toolbar.setFocusable( false );
//scope buttons
List<TaskScanningScope> scopes = ScanningScopeList.getDefault().getTaskScanningScopes();
for( TaskScanningScope scope : scopes ) {
final ScopeButton scopeButton = new ScopeButton( taskManager, scope );
scopeButton.setSelected(scope.equals(Settings.getDefault().getActiveScanningScope()));
toolbar.add(scopeButton);
}
toolbar.add( new JToolBar.Separator() );
//filter
JToggleButton toggleFilter = new FiltersMenuButton( filters.getActive() );
toolbar.add( toggleFilter );
//grouping & other butons
toolbar.addSeparator();
final JToggleButton toggleGroups = new JToggleButton( ImageUtilities.loadImageIcon("org/netbeans/modules/tasklist/ui/resources/groups.png", false)); //NOI18N
toggleGroups.addItemListener( new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
switchTableModel( e.getStateChange() == ItemEvent.SELECTED );
Settings.getDefault().setGroupTasksByCategory( toggleGroups.isSelected() );
toggleGroups.setToolTipText( toggleGroups.isSelected()
? NbBundle.getMessage( TaskListTopComponent.class, "HINT_TasksAsList" ) //NOI18N
: NbBundle.getMessage( TaskListTopComponent.class, "HINT_GrouppedTasks" ) ); //NOI18N
}
});
toggleGroups.setSelected( Settings.getDefault().getGroupTasksByCategory() );
toggleGroups.setToolTipText( toggleGroups.isSelected()
? NbBundle.getMessage( TaskListTopComponent.class, "HINT_TasksAsList" ) //NOI18N
: NbBundle.getMessage( TaskListTopComponent.class, "HINT_GrouppedTasks" ) ); //NOI18N
toggleGroups.setFocusable( false );
toolbar.add( toggleGroups );
}
示例8: updateText
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
private void updateText() {
StringBuffer buffer = new StringBuffer();
TaskScanningScope scope = taskManager.getScope();
Map<String, String> descriptions = scope.getLookup().lookup(Map.class);
if( null != descriptions ) {
String label = descriptions.get("StatusBarLabel"); //NOI18N
if( null != label ) {
buffer.append( " (" + label + ")" );
}
}
setText( buffer.toString() );
}
示例9: ScopeButton
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
/** Creates a new instance of ScopeButton */
public ScopeButton( TaskManagerImpl tm, TaskScanningScope scope ) {
this.tm = tm;
this.scope = scope;
setText( null );
setIcon( new ImageIcon( Accessor.getIcon( scope ) ) );
ToolTipManager.sharedInstance().registerComponent(this);
setFocusable( false );
}
示例10: getActiveScanningScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
public TaskScanningScope getActiveScanningScope() {
String clazzName = prefs.get( "activeScanningScope", null ); //NOI18N
if( null != clazzName ) {
for( TaskScanningScope scope : ScanningScopeList.getDefault().getTaskScanningScopes() ) {
if( scope.getClass().getName().equals( clazzName ) )
return scope;
}
}
return null;
}
示例11: observe
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
public void observe( final TaskScanningScope newScope, final TaskFilter newFilter ) {
RP.post( new Runnable() {
@Override
public void run() {
doObserve( newScope, newFilter );
}
});
}
示例12: attachPushScanners
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
private void attachPushScanners( TaskScanningScope newScope, TaskFilter newFilter ) {
for( PushTaskScanner scanner : getPushScanners() ) {
if( !newFilter.isEnabled( scanner ) ){
scanner.setScope( null, null );
}else if( newFilter.isEnabled( scanner ) ){
scanner.setScope( newScope, Accessor.createCallback( this, scanner ) );
}
}
}
示例13: refresh
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
@Override
public void refresh( final TaskScanningScope scopeToRefresh ) {
if( this.scope.equals( scopeToRefresh ) ) {
if (null != loader) {
loader.cancel();
}
RP.post( new Runnable() {
@Override
public void run() {
doRefresh( scopeToRefresh );
}
});
}
}
示例14: getTaskScanningScopes
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
public List<TaskScanningScope> getTaskScanningScopes() {
if( null == lookupRes ) {
lookupRes = initLookup();
lookupRes.addLookupListener( new LookupListener() {
public void resultChanged(LookupEvent ev) {
fireScopeListChange();
}
});
}
return new ArrayList<TaskScanningScope>( lookupRes.allInstances() );
}
示例15: getDefaultScope
import org.netbeans.spi.tasklist.TaskScanningScope; //导入依赖的package包/类
public TaskScanningScope getDefaultScope() {
List<TaskScanningScope> scopes = getTaskScanningScopes();
for( TaskScanningScope ss : scopes ) {
if( Accessor.isDefault( ss ) ) {
return ss;
}
}
return scopes.isEmpty() ? null : scopes.get( 0 );
}