* Return a new action to sync a module to a given revision
* @param moduleNameToSync the name of the module to sync with its vault.
* @return Action the new action.
*/
private Action getRevertModuleAction(final ModuleName moduleNameToSync) {
final VaultElementInfo vaultInfo = gemCutter.getWorkspace().getVaultInfo(moduleNameToSync);
boolean hasVaultInfo = vaultInfo != null;
Action revertModuleAction = new AbstractAction (GemCutter.getResourceString("RevertModulePopup")) {
private static final long serialVersionUID = 5546677553785665358L;
public void actionPerformed(ActionEvent evt) {
int moduleRevision = vaultInfo.getRevision(); // shouldn't be null.
gemCutter.doSyncModulesUserAction(Collections.singletonList(new ModuleRevision(moduleNameToSync, moduleRevision)), true);
}
};
// Calculate whether the action should be enabled..