com.intellij.util.QueryExecutor Java Examples

The following examples show how to use com.intellij.util.QueryExecutor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExtensibleQueryFactory.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected ExtensibleQueryFactory(@NonNls final String epNamespace) {
  myPoint = new NotNullLazyValue<SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>>() {
    @Override
    @Nonnull
    protected SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>> compute() {
      return new SimpleSmartExtensionPoint<QueryExecutor<Result, Parameters>>(new SmartList<QueryExecutor<Result, Parameters>>()){
        @Override
        @Nonnull
        protected ExtensionPoint<QueryExecutor<Result, Parameters>> getExtensionPoint() {
          String epName = ExtensibleQueryFactory.this.getClass().getName();
          int pos = epName.lastIndexOf('.');
          if (pos >= 0) {
            epName = epName.substring(pos+1);
          }
          epName = epNamespace + "." + StringUtil.decapitalize(epName);
          return Application.get().getExtensionPoint(ExtensionPointName.create(epName));
        }
      };
    }
  };
}
 
Example #2
Source File: ExtensibleQueryFactory.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void registerExecutor(final QueryExecutor<Result, Parameters> queryExecutor, Disposable parentDisposable) {
  registerExecutor(queryExecutor);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      unregisterExecutor(queryExecutor);
    }
  });
}
 
Example #3
Source File: ExtensibleQueryFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void registerExecutor(@Nonnull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().addExplicitExtension(queryExecutor);
}
 
Example #4
Source File: ExtensibleQueryFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void unregisterExecutor(@Nonnull final QueryExecutor<Result, Parameters> queryExecutor) {
  myPoint.getValue().removeExplicitExtension(queryExecutor);
}
 
Example #5
Source File: ExtensibleQueryFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
protected List<QueryExecutor<Result, Parameters>> getExecutors() {
  return myPoint.getValue().getExtensions();
}