@Retention(value=SOURCE) @Target(value={TYPE,METHOD}) public static @interface VersioningSystem.Registration
Register a VersioningSystem in the IDE.
If possible, prefer the annotation prior to a ServiceProvider
registration because of a better overall VCS performance. All necessary
information will be available to the VCS infrastructure to create
menu items and handle file visibility without having to activate the particular
VCS System until an explicit user action or relevant file event occurs.
modules.versioning.spi.VersioningSystem
.Modifier and Type | Required Element and Description |
---|---|
String |
actionsCategory
Determines the path under which this VCS Systems actions are registered.
|
String |
displayName
Short name of the versioning system, it will be used as popup menu label, label in tooltips, etc.
|
String |
menuLabel
Short name of the versioning system, it will be used as menu label and it should define a mnemonic key.
|
String[] |
metadataFolderNames
The VCS Systems metadata folder names.
|
public abstract String displayName
Short name of the versioning system, it will be used as popup menu label, label in tooltips, etc.
Examples: CVS, Subversion, Mercurial, Teamware, SourceSafe, VSS, Clearcase, Local History.
Corresponds with the property value modules.versioning.spi.VersioningSystem
when used together with modules.versioning.spi.VersioningSystem
.
modules.versioning.spi.VersioningSystem
public abstract String menuLabel
Short name of the versioning system, it will be used as menu label and it should define a mnemonic key.
Examples: &CVS, &Subversion, &Mercurial, &Teamware, &SourceSafe, &VSS, &Clearcase, Local &History.
Corresponds with the property value modules.versioning.spi.VersioningSystem
.
modules.versioning.spi.VersioningSystem
public abstract String[] metadataFolderNames
getTopmostManagedAncestor
call to the actual Versioning System. With other words - a particular VCS system is queried
about a files ownership only if it lies next to or under a folder containing a VCS metadata folder.#getTopmostManagedAncestor(org.netbeans.modules.versioning.fileproxy.api.VCSFileProxy))
public abstract String actionsCategory
Determines the path under which this VCS Systems actions are registered. The two following subpaths are then derived from it:
ActionReference
paths "Versioning/Subversion/Actions/Unversioned"
and "Versioning/Subversion/Actions/Global"
.
You can also make use of the ActionRegistration.menuText()
and ActionRegistration.popupText()
attributes, in case you need a different text in the Main Menu item and a projects popup menu item.
Also note that this has no direct relevance to ActionID.category()
.
Example:
Register a VersioningSystem
with the actionCategory
"Subversion".
@VersioningSystem.Registration(actionsCategory="Subversion")
public class SubversionVCS extends VersioningSystem {
...
}
Register the ImportAction
under the ActionReference
path
"Versioning/Subversion/Actions/Unversioned"
and set
ActionRegistration.popupText
to "Import into &Subversion Repository..."
and
ActionRegistration.menuText
to "I&mport into Repository..."
.
@ActionID(id = "org.netbeans.modules.subversion.ui.project.ImportAction", category = "Subversion")
@ActionRegistration(displayName = "Import into Repository...", popupText="Import into &Subversion Repository...", menuText="I&mport into Repository...")
@ActionReferences({ @ActionReference(path="Versioning/Subversion/Actions/Unversioned", position=1) })
public final class ImportAction implements ActionListener {
...
}
The Main Menu for an unversioned project then will be:
Main Menu > Team > Subversion > Import into Repository...
The Popup Menu for an unversioned project then will be:
Popup Menu > Versioning > Import into Subversion Repository...
ActionID
,
ActionRegistration
,
ActionReference