Package org.eclipse.jst.tapestry.core.internal.tapestrylibraryregistry

Examples of org.eclipse.jst.tapestry.core.internal.tapestrylibraryregistry.TapestryLibrary


   * A null is returned when there is no libraries in the registry.
   *
   * @return TapestryLibraryInternalReference
   */
  public TapestryLibraryInternalReference getDefaultTapestryImplementationLibrary() {
    TapestryLibrary dftImplLib = getTapestryLibraryRegistry().getDefaultImplementation();
   
    return ((dftImplLib != null) ?
        getTapestryLibraryReferencebyID(dftImplLib.getID()) :
        null);
  }
View Full Code Here


   */
  public void addTapestryLibrary(final TapestryLibraryInternalReference library) {
     // Library is added only if it does not exist in registry
    if (library != null && getTapestryLibraryRegistry().getTapestryLibraryByID(library.getID()) == null) {
      // Add the library working copy into workspace registry.
      TapestryLibrary jsfLib = library.getLibrary();
      getTapestryLibraryRegistry().addTapestryLibrary(jsfLib.getWorkingCopy());
     
      // Add library into the collection depends on its type.
      List list = (library.isImplementation() ?
              getTapestryImplementationLibraries() :
              getTapestryComponentLibraries());
View Full Code Here

 
 
  private List wrapTapestryLibraries(final EList libs) {
    List list = new ArrayList();
    if (libs != null) {
      TapestryLibrary jsfLib;
      TapestryLibraryInternalReference jsfLibDctr;
     
      Iterator it = libs.iterator();
      while (it.hasNext()) {
        jsfLib = (TapestryLibrary) it.next();
View Full Code Here

  }

  private boolean isAnyLibraryChanged(final List list) {
    Iterator it = list.iterator();
    TapestryLibraryInternalReference wclib = null;    // working copy library
    TapestryLibrary lib = null;
   
    while(it.hasNext()) {
      wclib = (TapestryLibraryInternalReference)it.next();
      lib = getTapestryLibraryRegistry().getTapestryLibraryByID(wclib.getID());
      if (lib == null) {          // removed. Hence, changed.
        return true;
      }
      if (wclib.getArchiveFiles().size() !=
        lib.getArchiveFiles().size()) { // Archives changed..
        return true;
      }
      if (isAnyArchiveFileChanged(wclib.getArchiveFiles(),
          lib.getArchiveFiles())) {   // Check archive file changes.  I.e., name and location
        return true;
      }
    }
    return false;
  }
View Full Code Here

    IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
    IJavaProject[] projects= JavaCore.create(root).getJavaProjects();
    IPath containerPath= new Path(TapestryLibraryConfigurationHelper.Tapestry_LIBRARY_CP_CONTAINER_ID).append(newId);
    IPath oldContainerPath = new Path(TapestryLibraryConfigurationHelper.Tapestry_LIBRARY_CP_CONTAINER_ID).append(oldId);
   
    TapestryLibrary lib = TapestryLibraryRegistryUtil.getInstance().getTapestryLibraryRegistry().getTapestryLibraryByID(newId);
    List affectedProjects= new ArrayList();
    boolean removeAndAddBecauseOfRename = (!oldId.equals(newId));
    // find all projects using the old container name...
    for (int i= 0; i < projects.length; i++) {
      IJavaProject project= projects[i];
View Full Code Here

        saveJSFLibraryRegistry();
      }
      //add adapter to maintain default implementation
      if (tapestryLibraryRegistry != null) {       
        //check that a default impl is set.   if not pick first one if available.
        TapestryLibrary defLib = tapestryLibraryRegistry.getDefaultImplementation();
        if (defLib == null && tapestryLibraryRegistry.getImplTapestryLibraries().size() > 0){
          tapestryLibraryRegistry.setDefaultImplementation((TapestryLibrary)tapestryLibraryRegistry.getImplTapestryLibraries().get(0));
          saveJSFLibraryRegistry();
        }
        tapestryLibraryRegistry.eAdapters().add(MaintainDefaultImplementationAdapter.getInstance());
View Full Code Here

      IExtension[] extensions = point.getExtensions();
      for (int i=0;i < extensions.length;i++){
        IExtension ext = extensions[i];
        for (int j=0;j < ext.getConfigurationElements().length;j++){
          PluginProvidedTapestryLibraryCreationHelper2 newLibCreator = new PluginProvidedTapestryLibraryCreationHelper2(ext.getConfigurationElements()[j]);           
          TapestryLibrary newLib = newLibCreator.create();
         
          /**
           * Additional check on if a plug-in contributes jsflibraries is an expanded folder.
           * Fix related to bug 144954. 
           *
 
View Full Code Here

      IExtension[] extensions = point.getExtensions();
      for (int i=0;i < extensions.length;i++){
        IExtension ext = extensions[i];
        for (int j=0;j < ext.getConfigurationElements().length;j++){
          PluginProvidedTapestryLibraryCreationHelper newLibCreator = new PluginProvidedTapestryLibraryCreationHelper(ext.getConfigurationElements()[j]);           
          TapestryLibrary newLib = newLibCreator.create();
         
          if (newLib != null ) //&& isJSFLibinExpandedFolder(newLib))
            tapestryLibraryRegistry.addTapestryLibrary(newLib);
        }
      }
View Full Code Here

   * @param library JSFLibrary instance
   */
  protected void libraryRemoved(TapestryLibrary library) {
    if (library != null && library.isImplementation()) {
      TapestryLibraryRegistry jsfLibReg = TapestryLibraryRegistryUtil.getInstance().getTapestryLibraryRegistry();
      TapestryLibrary defaultImpl = jsfLibReg.getDefaultImplementation();
      if (defaultImpl == null || library.getID().equals(defaultImpl.getID())) {
        setNewDefaultImplementation();
      }
    }
  }
View Full Code Here

   * @param library JSFLibrary instance
   */
  private void implementationFlagSet(TapestryLibrary library) {
    TapestryLibraryRegistry jsfLibReg = TapestryLibraryRegistryUtil.getInstance().getTapestryLibraryRegistry();
    if (jsfLibReg != null) {
      TapestryLibrary defaultImpl = jsfLibReg.getDefaultImplementation();
      if (
          library.isImplementation() &&
          defaultImpl == null
      ) {
        jsfLibReg.setDefaultImplementation(library);
      } else if (
          !library.isImplementation() &&
          (defaultImpl != null && library.getID().equals(defaultImpl.getID())))
      {
        setNewDefaultImplementation();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.tapestry.core.internal.tapestrylibraryregistry.TapestryLibrary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.