private void updateLibs(XModelObject object) {
    if (WatcherLoader.isLocked(object.getModel())) {
      return;
    }
    IProject project = EclipseResourceUtil.getProject(object);
    if (project == null) return;
    XModelObject lib = validateLib(object);
    //    	if(lib == null) {
    //    		return;
    //    	}

    Libs libs = FileSystemsHelper.getLibs(object);
    if (libs != null) libs.update();
  }
Exemplo n.º 2
0
  /**
   * builder to build an adapter out of the given information ;D
   *
   * @param context the current context
   * @return a LibsRecyclerViewAdapter with the libraries
   */
  public LibsRecyclerViewAdapter adapter(Context context) {
    Libs libs;
    if (fields == null) {
      libs = new Libs(context);
    } else {
      libs = new Libs(context, fields);
    }

    // apply modifications
    libs.modifyLibraries(libraryModification);

    // fetch the libraries and sort if a comparator was set
    ArrayList<Library> libraries =
        libs.prepareLibraries(context, internalLibraries, excludeLibraries, autoDetect, sort);

    // prepare adapter
    LibsRecyclerViewAdapter adapter = new LibsRecyclerViewAdapter(this);
    adapter.addLibs(libraries);
    return adapter;
  }
Exemplo n.º 3
0
 /**
  * Builder method to pass the R.string.class.getFields() array to the fragment/activity so we can
  * also include all ressources which are within libraries or your app.
  *
  * @param fields R.string.class.getFields()
  * @return this
  */
 public LibsBuilder withFields(Field[] fields) {
   return withFields(Libs.toStringArray(fields));
 }