org.eclipse.jpt.core.resource
Class AbstractXmlResourceProvider

java.lang.Object
  extended by org.eclipse.jpt.core.resource.AbstractXmlResourceProvider
All Implemented Interfaces:
JpaXmlResourceProvider, org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider, org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator

public abstract class AbstractXmlResourceProvider
extends java.lang.Object
implements JpaXmlResourceProvider, org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider, org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Nested Class Summary
 class AbstractXmlResourceProvider.NotifyRunner
           
 
Field Summary
 
Fields inherited from interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator
OK_STATUS
 
Constructor Summary
AbstractXmlResourceProvider(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IPath resourcePath, org.eclipse.core.runtime.content.IContentType contentType)
          Create a new AbstractResourceModelProvider for the given project and resourcePath.
 
Method Summary
 void addListener(JpaXmlResourceProviderListener listener)
           
 void cacheNonResourceValidateState(java.util.List roNonResourceFiles)
           
 void checkActivation(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
           
 boolean checkReadOnly()
           
 boolean checkSave(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
           
 JpaXmlResource createFileAndResource()
          This will actually create the underlying file and the JpaXmlResource that corresponds to it.
 java.util.List getNonResourceFiles()
           
 java.util.List getNonResourceInconsistentFiles()
           
 org.eclipse.core.resources.IProject getProject()
           
 java.util.List getResources()
           
 org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator getStateValidator()
           
 JpaXmlResource getXmlResource()
          Return the resource, if it exists.
 boolean isDirty()
           
 void lostActivation(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
           
 void removeListener(JpaXmlResourceProviderListener listener)
           
 org.eclipse.core.runtime.IStatus validateEdit(java.lang.Object context)
           
 org.eclipse.core.runtime.IStatus validateState(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXmlResourceProvider

public AbstractXmlResourceProvider(org.eclipse.core.resources.IProject project,
                                   org.eclipse.core.runtime.IPath resourcePath,
                                   org.eclipse.core.runtime.content.IContentType contentType)
Create a new AbstractResourceModelProvider for the given project and resourcePath. The resourcePath may be either a) an absolute platform resource path (e.g. "MyProject/src/META-INF/foobar.xml") or b) a relative deploy path (e.g. "META-INF/foobar.xml".) In either case, buildFileUri(IPath) will attempt to build an absolutely pathed URI for the given path.

Method Detail

getXmlResource

public JpaXmlResource getXmlResource()
Return the resource, if it exists. If no file exists for this resource, this will return a stub resource. You must call #createResource() to create the file on the file system.

Specified by:
getXmlResource in interface JpaXmlResourceProvider

createFileAndResource

public JpaXmlResource createFileAndResource()
                                     throws org.eclipse.core.runtime.CoreException
This will actually create the underlying file and the JpaXmlResource that corresponds to it. It also populates the root of the file.

Throws:
org.eclipse.core.runtime.CoreException

addListener

public void addListener(JpaXmlResourceProviderListener listener)

removeListener

public void removeListener(JpaXmlResourceProviderListener listener)

getProject

public org.eclipse.core.resources.IProject getProject()

validateEdit

public org.eclipse.core.runtime.IStatus validateEdit(java.lang.Object context)
Specified by:
validateEdit in interface JpaXmlResourceProvider

getStateValidator

public org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator getStateValidator()

checkActivation

public void checkActivation(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
                     throws org.eclipse.core.runtime.CoreException
Specified by:
checkActivation in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator
Throws:
org.eclipse.core.runtime.CoreException

lostActivation

public void lostActivation(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
                    throws org.eclipse.core.runtime.CoreException
Specified by:
lostActivation in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator
Throws:
org.eclipse.core.runtime.CoreException

validateState

public org.eclipse.core.runtime.IStatus validateState(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
                                               throws org.eclipse.core.runtime.CoreException
Specified by:
validateState in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator
Throws:
org.eclipse.core.runtime.CoreException

checkSave

public boolean checkSave(org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter presenter)
                  throws org.eclipse.core.runtime.CoreException
Specified by:
checkSave in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator
Throws:
org.eclipse.core.runtime.CoreException

checkReadOnly

public boolean checkReadOnly()
Specified by:
checkReadOnly in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator

isDirty

public boolean isDirty()
Specified by:
isDirty in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider

getNonResourceFiles

public java.util.List getNonResourceFiles()
Specified by:
getNonResourceFiles in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider

getNonResourceInconsistentFiles

public java.util.List getNonResourceInconsistentFiles()
Specified by:
getNonResourceInconsistentFiles in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider

getResources

public java.util.List getResources()
Specified by:
getResources in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider

cacheNonResourceValidateState

public void cacheNonResourceValidateState(java.util.List roNonResourceFiles)
Specified by:
cacheNonResourceValidateState in interface org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider