站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

VcsAttributes (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore
Class VcsAttributes

java.lang.Object
  extended byorg.openide.filesystems.DefaultAttributes
      extended byorg.netbeans.modules.masterfs.providers.Attributes
          extended byorg.netbeans.modules.vcscore.VcsAttributes
All Implemented Interfaces:
AbstractFileSystem.Attr, AbstractFileSystem.List, Serializable

public class VcsAttributes
extends org.netbeans.modules.masterfs.providers.Attributes

Implementation of file attributes for version control systems. All attributes read/write operations are delegated to the DefaultAttributes, whith the exception of VCS-related attributes. These special attributes are not propagated to the DefaultAttributes, but are interpreted as VCS commands.

See Also:
Serialized Form

Field Summary
static String FILE_ATTRIBUTE
          The name of attribute, that contains the java.io.File object for the given FileObject
static String RUNTIME_PROVIDER
           
static String VCS_ACTION
          Attribute name for a VCS action.
static String VCS_ACTION_ADD
          The VCS Add command name.
static String VCS_ACTION_DESCRIPTION
          The description to the action.
static String VCS_ACTION_DONE
          This attribute is set when the action is done.
static String VCS_ACTION_REMOVE
          The VCS Remove command name.
static String VCS_NATIVE_FILEOBJECT
          Name of attribute that contains VcsFilesystem fileobject or null.
static String VCS_NATIVE_FS
          Name of the attribute that contains the instance of the vcs filesystem that the fileobject belongs to.
static String VCS_NATIVE_PACKAGE_NAME_EXT
          Name of the attribute that contains path of the fileobject within the versioning filesystem.
static String VCS_REFRESH
          Attribute name for the refresh action on a VCS filesystem.
static String VCS_SCHEDULED_FILE_ATTR
          The attribute name marking the file as scheduled for later processing.
static String VCS_SCHEDULED_FILES_ATTR
          The attribute name where scheduled files are stored.
static String VCS_SCHEDULING_ADD
          The scheduling VCS Add action name.
static String VCS_SCHEDULING_MASTER_FILE_NAME_ATTR
          The attribute name containing the java.io.File name of the primary file, that contains scheduled files.
static String VCS_SCHEDULING_REMOVE
          The scheduling VCS Remove action name.
static String VCS_SCHEDULING_SECONDARY_FO_ACTION
          Attribute name for a VCS action, that schedules the VCS operation for later processing.
static String VCS_STATUS
          Read the attribute of this name to obtain the VCS file status.
static String VCS_STATUS_LOCAL
          The status, that is returned from readAttribute for files, that are not version controlled.
static String VCS_STATUS_MISSING
          The status, that is returned from readAttribute for files, that are present in VCS repository, but do not exist locally.
static String VCS_STATUS_UNKNOWN
          The status, that is returned from readAttribute for files, that are not recognized.
static String VCS_STATUS_UP_TO_DATE
          The status, that is returned from readAttribute for files, that are version controlled and are present locally.
 
Fields inherited from class org.netbeans.modules.masterfs.providers.Attributes
ATTRNAME
 
Fields inherited from class org.openide.filesystems.DefaultAttributes
ATTR_EXT, ATTR_NAME, ATTR_NAME_EXT
 
Constructor Summary
VcsAttributes(File mountPoint, AbstractFileSystem.Info info, AbstractFileSystem.Change change, AbstractFileSystem.List list, VcsFileSystem fileSystem, VcsActionSupporter supp)
          Creates new VcsAttributes
 
Method Summary
 VcsCommandsProvider getCommandsProvider()
           
 VcsActionSupporter getCurrentSupporter()
           
 org.netbeans.modules.vcscore.runtime.RuntimeCommandsProvider getRuntimeCommandsProvider()
           
 Object readAttribute(String name, String attrName)
          Get the file attribute with the specified name.
 void setCommandsProvider(VcsCommandsProvider commandsProvider)
           
 void setCurrentSupporter(VcsActionSupporter supporter)
           
 void setRuntimeCommandsProvider(org.netbeans.modules.vcscore.runtime.RuntimeCommandsProvider provider)
           
 void writeAttribute(String name, String attrName, Object value)
          Set the file attribute with the specified name.
 
Methods inherited from class org.netbeans.modules.masterfs.providers.Attributes
attributes, children, deleteAttributes, getRootForAttributes, renameAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_ATTRIBUTE

public static final String FILE_ATTRIBUTE
The name of attribute, that contains the java.io.File object for the given FileObject

See Also:
Constant Field Values

VCS_NATIVE_FS

public static final String VCS_NATIVE_FS
Name of the attribute that contains the instance of the vcs filesystem that the fileobject belongs to.

See Also:
Constant Field Values

VCS_NATIVE_PACKAGE_NAME_EXT

public static final String VCS_NATIVE_PACKAGE_NAME_EXT
Name of the attribute that contains path of the fileobject within the versioning filesystem. That can differ when the filesystem is placed within a multifilesystem. In cooperation with the VCS_NATIVE_FS one can retrieve the original fileobject from the vcs filesystem.

See Also:
Constant Field Values

VCS_NATIVE_FILEOBJECT

public static final String VCS_NATIVE_FILEOBJECT
Name of attribute that contains VcsFilesystem fileobject or null. It's typical use case is a wormhole through MasterFileSystem. It's read-only attribute.

See Also:
Constant Field Values

RUNTIME_PROVIDER

public static final String RUNTIME_PROVIDER
See Also:
Constant Field Values

VCS_ACTION

public static final String VCS_ACTION
Attribute name for a VCS action.

See Also:
Constant Field Values

VCS_REFRESH

public static final String VCS_REFRESH
Attribute name for the refresh action on a VCS filesystem.

See Also:
Constant Field Values

VCS_SCHEDULING_SECONDARY_FO_ACTION

public static final String VCS_SCHEDULING_SECONDARY_FO_ACTION
Attribute name for a VCS action, that schedules the VCS operation for later processing. This action should be performed on important secondary file objects.

See Also:
Constant Field Values

VCS_SCHEDULING_ADD

public static final String VCS_SCHEDULING_ADD
The scheduling VCS Add action name. The file will be added to the VCS repository as soon as the primary file will be committed.

See Also:
Constant Field Values

VCS_SCHEDULING_REMOVE

public static final String VCS_SCHEDULING_REMOVE
The scheduling VCS Remove action name. The file will be removed from the VCS repository as soon as the primary file will be committed.

See Also:
Constant Field Values

VCS_SCHEDULED_FILES_ATTR

public static final String VCS_SCHEDULED_FILES_ATTR
The attribute name where scheduled files are stored.

See Also:
Constant Field Values

VCS_SCHEDULED_FILE_ATTR

public static final String VCS_SCHEDULED_FILE_ATTR
The attribute name marking the file as scheduled for later processing. The value should be VCS_SCHEDULING_ADD or VCS_SCHEDULING_REMOVE.

See Also:
Constant Field Values

VCS_SCHEDULING_MASTER_FILE_NAME_ATTR

public static final String VCS_SCHEDULING_MASTER_FILE_NAME_ATTR
The attribute name containing the java.io.File name of the primary file, that contains scheduled files. This will prevent the copy of scheduled attributes to other files, because when the value of this attribue will differ from the actual file path, all scheduled attribues will be deleted.

See Also:
Constant Field Values

VCS_ACTION_ADD

public static final String VCS_ACTION_ADD
The VCS Add command name. This command adds the file to the VCS repository.

See Also:
Constant Field Values

VCS_ACTION_REMOVE

public static final String VCS_ACTION_REMOVE
The VCS Remove command name. This command removes the file from the VCS repository.

See Also:
Constant Field Values

VCS_ACTION_DONE

public static final String VCS_ACTION_DONE
This attribute is set when the action is done. The value is Boolean.TRUE or Boolean.FALSE depending on the command exit status.

See Also:
Constant Field Values

VCS_ACTION_DESCRIPTION

public static final String VCS_ACTION_DESCRIPTION
The description to the action. Usually it is a message, that is given to the VCS command (such as a change log for check in)

See Also:
Constant Field Values

VCS_STATUS

public static String VCS_STATUS
Read the attribute of this name to obtain the VCS file status.


VCS_STATUS_LOCAL

public static String VCS_STATUS_LOCAL
The status, that is returned from readAttribute for files, that are not version controlled.


VCS_STATUS_MISSING

public static String VCS_STATUS_MISSING
The status, that is returned from readAttribute for files, that are present in VCS repository, but do not exist locally.


VCS_STATUS_UP_TO_DATE

public static String VCS_STATUS_UP_TO_DATE
The status, that is returned from readAttribute for files, that are version controlled and are present locally.


VCS_STATUS_UNKNOWN

public static String VCS_STATUS_UNKNOWN
The status, that is returned from readAttribute for files, that are not recognized. We can not say whether they are version controlled or not.

Constructor Detail

VcsAttributes

public VcsAttributes(File mountPoint,
                     AbstractFileSystem.Info info,
                     AbstractFileSystem.Change change,
                     AbstractFileSystem.List list,
                     VcsFileSystem fileSystem,
                     VcsActionSupporter supp)
Creates new VcsAttributes

Method Detail

getCurrentSupporter

public VcsActionSupporter getCurrentSupporter()

setCurrentSupporter

public void setCurrentSupporter(VcsActionSupporter supporter)

getCommandsProvider

public VcsCommandsProvider getCommandsProvider()

setCommandsProvider

public void setCommandsProvider(VcsCommandsProvider commandsProvider)

getRuntimeCommandsProvider

public org.netbeans.modules.vcscore.runtime.RuntimeCommandsProvider getRuntimeCommandsProvider()

setRuntimeCommandsProvider

public void setRuntimeCommandsProvider(org.netbeans.modules.vcscore.runtime.RuntimeCommandsProvider provider)

readAttribute

public Object readAttribute(String name,
                            String attrName)
Get the file attribute with the specified name.

Parameters:
name - the file name
attrName - name of the attribute
Returns:
appropriate (serializable) value or null if the attribute is unset (or could not be properly restored for some reason). If the attribute name is the VCS_STATUS, then the VCS status of the file is returned.

writeAttribute

public void writeAttribute(String name,
                           String attrName,
                           Object value)
                    throws IOException,
                           UnknownServiceException
Set the file attribute with the specified name. If the name is VCS_ACTION, and the value is an instance of FeatureDescriptor, then it's not set as file attribute, but is interpreted as a VCS command. The name of the command is taken from value.getName() and commands options from attributes of that feature descriptor.

Parameters:
name - the file name
attrName - name of the attribute
value - new value or null to clear the attribute. Must be serializable, with the exception of VCS command attribute.
Throws:
IOException - if the attribute cannot be set. If serialization is used to store it, this may in fact be a subclass such as NotSerializableException.
UnknownServiceException - if the requested VCS action is not provided. A subclass of IOException was chosen, since FileObject.setAttribute throws IOException.

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.